Skip to content

Commit 3d1eac2

Browse files
Alexander AringStefan-Schmidt
authored andcommitted
net: ieee802154: fix nl802154 del llsec dev
This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVICE is not set by the user. If this is the case nl802154 will return -EINVAL. Reported-by: [email protected] Signed-off-by: Alexander Aring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 37feaaf commit 3d1eac2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/ieee802154/nl802154.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,8 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info)
17581758
struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1];
17591759
__le64 extended_addr;
17601760

1761-
if (nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack))
1761+
if (!info->attrs[NL802154_ATTR_SEC_DEVICE] ||
1762+
nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack))
17621763
return -EINVAL;
17631764

17641765
if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR])

0 commit comments

Comments
 (0)