Skip to content

Commit 02f1866

Browse files
miquelraynalStefan-Schmidt
authored andcommitted
ieee802154: Prevent user from crashing the host
Avoid crashing the machine by checking info->attrs[NL802154_ATTR_SCAN_TYPE] presence before de-referencing it, which was the primary intend of the blamed patch. Reported-by: Sanan Hasanov <[email protected]> Suggested-by: Eric Dumazet <[email protected]> Fixes: a0b6106 ("ieee802154: Convert scan error messages to extack") Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 6c99377 commit 02f1866

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ieee802154/nl802154.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
14121412
return -EOPNOTSUPP;
14131413
}
14141414

1415-
if (!nla_get_u8(info->attrs[NL802154_ATTR_SCAN_TYPE])) {
1415+
if (!info->attrs[NL802154_ATTR_SCAN_TYPE]) {
14161416
NL_SET_ERR_MSG(info->extack, "Malformed request, missing scan type");
14171417
return -EINVAL;
14181418
}

0 commit comments

Comments
 (0)