net: ieee802154: fix nl802154 del llsec key
Subsystems (3)
PATCH 1/4 net: ieee802154: fix nl802154 del llsec key
This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_KEY is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1592,7 +1592,8 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info)struct nlattr *attrs[NL802154_KEY_ATTR_MAX +1 ];struct ieee802154_llsec_key_id id; -if (nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_KEY ] || +nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ;if (ieee802154_llsec_parse_key_id (attrs[NL802154_KEY_ATTR_ID ], &id) <0 )
Signature · 1 line
2.26.2
PATCH 2/4 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.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1758,7 +1758,8 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info)struct nlattr *attrs[NL802154_DEV_ATTR_MAX +1 ];__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVICE ] || +nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR ])
Signature · 1 line
2.26.2
PATCH 3/4 net: ieee802154: fix nl802154 add llsec key
In reply to Alexander AringThis patch fixes a nullpointer dereference if NL802154_ATTR_SEC_KEY is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1544,7 +1544,8 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)struct ieee802154_llsec_key_id id = { };u32 commands[NL802154_CMD_FRAME_NR_IDS /32 ] = { }; -if (nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_KEY ] || +nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ; if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
Signature · 1 line
2.26.2
PATCH 4/4 net: ieee802154: fix nl802154 del llsec devkey
In reply to Alexander AringThis patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVKEY is not set by the user. If this is the case nl802154 will return -EINVAL.
--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ieee802154/nl802154.c +2 -1
@@ -1916,7 +1916,8 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVKEY ] || +nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR ])
Signature · 1 line
2.26.2
Jakub Kicinski
maintainerQuoted 5 lines · On Sun, 21 Feb 2021 12:43:18 -0500 Alexander Aring wrote:
This patch fixes a nullpointer dereference if
NL802154_ATTR_SEC_KEYis 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]>
Looks like there is a wpan tree, but in recent years Dave just applies ieee802154 patches directly. I'm going to apply these directly as well, please let me know if I shouldn't, or more review time is needed.
Stefan Schmidt
maintainerRe: [PATCH wpan 3/4] net: ieee802154: fix nl802154 add llsec key
In reply to Alexander AringHello.
Quoted 15 lines · Alexander Aring
This patch fixes a nullpointer dereference if
NL802154_ATTR_SEC_KEYis 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]>--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/ieee802154/nl802154.c +0
-0
net/ieee802154/nl802154.c static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info) · line 1551
Quoted 9 lines
net/ieee802154/nl802154.c +2
-1@@ -1544,7 +1544,8 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)struct ieee802154_llsec_key_id id = { };u32 commands[NL802154_CMD_FRAME_NR_IDS /32 ] = { }; -if (nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_KEY ] || +nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ; if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] ||
This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks!
regards
Stefan Schmidt
Stefan Schmidt
maintainerRe: [PATCH wpan 4/4] net: ieee802154: fix nl802154 del llsec devkey
In reply to Alexander AringHello.
Quoted 15 lines · Alexander Aring
This patch fixes a nullpointer dereference if
NL802154_ATTR_SEC_DEVKEYis 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]>--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/ieee802154/nl802154.c +0
-0
net/ieee802154/nl802154.c static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info · line 1923
Quoted 9 lines
net/ieee802154/nl802154.c +2
-1@@ -1916,7 +1916,8 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVKEY ] || +nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR ])
This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks!
regards
Stefan Schmidt
Stefan Schmidt
maintainerRe: [PATCH wpan 4/4] net: ieee802154: fix nl802154 del llsec devkey
In reply to Alexander AringHello.
Quoted 24 lines · Alexander Aring
This patch fixes a nullpointer dereference if
NL802154_ATTR_SEC_DEVKEYis 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]>--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/ieee802154/nl802154.c +2
-1@@ -1916,7 +1916,8 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVKEY ] || +nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR ])
Stefan Schmidt
maintainerRe: [PATCH wpan 2/4] net: ieee802154: fix nl802154 del llsec dev
In reply to Alexander AringHello.
Quoted 15 lines · Alexander Aring
This patch fixes a nullpointer dereference if
NL802154_ATTR_SEC_DEVICEis 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]>--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/ieee802154/nl802154.c +0
-0
net/ieee802154/nl802154.c static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) · line 1765
Quoted 9 lines
net/ieee802154/nl802154.c +2
-1@@ -1758,7 +1758,8 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info)struct nlattr *attrs[NL802154_DEV_ATTR_MAX +1 ];__le64 extended_addr; -if (nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_DEVICE ] || +nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack))return -EINVAL ;if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR ])
This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks!
regards
Stefan Schmidt
Stefan Schmidt
maintainerHello.
Quoted 15 lines · Alexander Aring
This patch fixes a nullpointer dereference if
NL802154_ATTR_SEC_KEYis 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]>--- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)net/ieee802154/nl802154.c +0
-0
net/ieee802154/nl802154.c static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) · line 1599
Quoted 9 lines
net/ieee802154/nl802154.c +2
-1@@ -1592,7 +1592,8 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info)struct nlattr *attrs[NL802154_KEY_ATTR_MAX +1 ];struct ieee802154_llsec_key_id id; -if (nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack)) +if (!info->attrs[NL802154_ATTR_SEC_KEY ] || +nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ;if (ieee802154_llsec_parse_key_id (attrs[NL802154_KEY_ATTR_ID ], &id) <0 )
This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks!
regards
Stefan Schmidt