net: ieee802154: forbid sec params for monitors
Subsystems (3)
cover net: ieee802154: forbid sec params for monitors
Hi,
this patch series contains fixes to forbid various security parameters settings for monitor types. Monitor types doesn't use the llsec security currently and we don't support it. With this patch series the user will be notified with a EOPNOTSUPP error that for monitor interfaces security is not supported yet. However there might be a possibility in future that the kernel will decrypt frames with llsec information for sniffing frames and deliver plaintext to userspace, but this isn't supported yet.
- Alex
Alexander Aring (15):
net: ieee802154: nl-mac: fix check on panid
net: ieee802154: forbid monitor for set llsec params
net: ieee802154: stop dump llsec keys for monitors
net: ieee802154: forbid monitor for add llsec key
net: ieee802154: forbid monitor for del llsec key
net: ieee802154: stop dump llsec devs for monitors
net: ieee802154: forbid monitor for add llsec dev
net: ieee802154: forbid monitor for del llsec dev
net: ieee802154: stop dump llsec devkeys for monitors
net: ieee802154: forbid monitor for add llsec devkey
net: ieee802154: forbid monitor for del llsec devkey
net: ieee802154: stop dump llsec seclevels for monitors
net: ieee802154: forbid monitor for add llsec seclevel
net: ieee802154: forbid monitor for del llsec seclevel
net: ieee802154: stop dump llsec params for monitors
net/ieee802154/nl-mac.c | 7 +++--- net/ieee802154/nl802154.c | 52 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-)
Signature · 1 line
2.26.3
PATCH RESEND 1/15 net: ieee802154: nl-mac: fix check on panid
This patch fixes a null pointer derefence for panid handle by move the check for the netlink variable directly before accessing them.
--- net/ieee802154/nl-mac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/ieee802154/nl-mac.c +4 -3
@@ -551,9 +551,7 @@ ieee802154_llsec_parse_key_id(struct genl_info *info, desc->mode =nla_get_u8 (info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE ]);if (desc->mode ==IEEE802154_SCF_KEY_IMPLICIT ) { -if (!info->attrs[IEEE802154_ATTR_PAN_ID ] && - !(info->attrs[IEEE802154_ATTR_SHORT_ADDR ] || - info->attrs[IEEE802154_ATTR_HW_ADDR ])) +if (!info->attrs[IEEE802154_ATTR_PAN_ID ])return -EINVAL ; desc->device_addr.pan_id =nla_get_shortaddr (info->attrs[IEEE802154_ATTR_PAN_ID ]);
@@ -562,6 +560,9 @@ ieee802154_llsec_parse_key_id(struct genl_info *info, desc->device_addr.mode =IEEE802154_ADDR_SHORT ; desc->device_addr.short_addr =nla_get_shortaddr (info->attrs[IEEE802154_ATTR_SHORT_ADDR ]); }else { +if (!info->attrs[IEEE802154_ATTR_HW_ADDR ]) +return -EINVAL ; + desc->device_addr.mode =IEEE802154_ADDR_LONG ; desc->device_addr.extended_addr =nla_get_hwaddr (info->attrs[IEEE802154_ATTR_HW_ADDR ]); }
Signature · 1 line
2.26.3
PATCH RESEND 2/15 net: ieee802154: forbid monitor for set llsec params
In reply to Alexander AringThis patch forbids to set llsec params for monitor interfaces which we don't support yet.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1384,6 +1384,9 @@ static int nl802154_set_llsec_params(struct sk_buff *skb,u32 changed =0 ;int ret; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (info->attrs[NL802154_ATTR_SEC_ENABLED ]) {u8 enabled;
Signature · 1 line
2.26.3
PATCH RESEND 3/15 net: ieee802154: stop dump llsec keys for monitors
In reply to Alexander AringThis patch stops dumping llsec keys for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -1493,6 +1493,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.26.3
PATCH RESEND 4/15 net: ieee802154: forbid monitor for add llsec key
In reply to Alexander AringThis patch forbids to add llsec key for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1552,6 +1552,9 @@ 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 (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +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 ;
Signature · 1 line
2.26.3
PATCH RESEND 5/15 net: ieee802154: forbid monitor for del llsec key
In reply to Alexander AringThis patch forbids to del llsec key for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1604,6 +1604,9 @@ 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 (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +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 ;
Signature · 1 line
2.26.3
PATCH RESEND 6/15 net: ieee802154: stop dump llsec devs for monitors
In reply to Alexander AringThis patch stops dumping llsec devs for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -1672,6 +1672,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.26.3
PATCH RESEND 7/15 net: ieee802154: forbid monitor for add llsec dev
In reply to Alexander AringThis patch forbids to add llsec dev for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1763,6 +1763,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info)struct wpan_dev *wpan_dev = dev->ieee802154_ptr;struct ieee802154_llsec_device dev_desc; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (ieee802154_llsec_parse_device (info->attrs[NL802154_ATTR_SEC_DEVICE ], &dev_desc) <0 )return -EINVAL ;
Signature · 1 line
2.26.3
PATCH RESEND 8/15 net: ieee802154: forbid monitor for del llsec dev
In reply to Alexander AringThis patch forbids to del llsec dev for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1781,6 +1781,9 @@ 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 (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +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 ;
Signature · 1 line
2.26.3
PATCH RESEND 9/15 net: ieee802154: stop dump llsec devkeys for monitors
In reply to Alexander AringThis patch stops dumping llsec devkeys for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -1853,6 +1853,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.26.3
PATCH RESEND 10/15 net: ieee802154: forbid monitor for add llsec devkey
In reply to Alexander AringThis patch forbids to add llsec devkey for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1915,6 +1915,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +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) <0 )return -EINVAL ;
Signature · 1 line
2.26.3
PATCH RESEND 11/15 net: ieee802154: forbid monitor for del llsec devkey
In reply to Alexander AringThis patch forbids to del llsec devkey for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1949,6 +1949,9 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +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 ;
Signature · 1 line
2.26.3
PATCH RESEND 12/15 net: ieee802154: stop dump llsec seclevels for monitors
In reply to Alexander AringThis patch stops dumping llsec seclevels for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -2026,6 +2026,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.26.3
PATCH RESEND 13/15 net: ieee802154: forbid monitor for add llsec seclevel
In reply to Alexander AringThis patch forbids to add llsec seclevel for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -2115,6 +2115,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb,struct wpan_dev *wpan_dev = dev->ieee802154_ptr;struct ieee802154_llsec_seclevel sl; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (llsec_parse_seclevel (info->attrs[NL802154_ATTR_SEC_LEVEL ], &sl) <0 )return -EINVAL ;
Signature · 1 line
2.26.3
PATCH RESEND 14/15 net: ieee802154: forbid monitor for del llsec seclevel
In reply to Alexander AringThis patch forbids to del llsec seclevel for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -2133,6 +2133,9 @@ static int nl802154_del_llsec_seclevel(struct sk_buff *skb,struct wpan_dev *wpan_dev = dev->ieee802154_ptr;struct ieee802154_llsec_seclevel sl; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_LEVEL ] ||llsec_parse_seclevel (info->attrs[NL802154_ATTR_SEC_LEVEL ], &sl) <0 )
Signature · 1 line
2.26.3
PATCH RESEND 15/15 net: ieee802154: stop dump llsec params for monitors
In reply to Alexander AringThis patch stops dumping llsec params for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -820,8 +820,13 @@ nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, goto nla_put_failure;#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) + goto out; +if (nl802154_get_llsec_params (msg, rdev, wpan_dev) <0 ) goto nla_put_failure; + +out:#endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ genlmsg_end (msg, hdr);
Signature · 1 line
2.26.3
Alexander Aring
maintainerHi,
Quoted 11 lines · Alexander Aring
Hi,
this patch series contains fixes to forbid various security parameters settings for monitor types. Monitor types doesn't use the llsec security currently and we don't support it. With this patch series the user will be notified with a EOPNOTSUPP error that for monitor interfaces security is not supported yet. However there might be a possibility in future that the kernel will decrypt frames with llsec information for sniffing frames and deliver plaintext to userspace, but this isn't supported yet.
- Alex
Stefan Schmidt
maintainerHello.
Quoted 29 lines · Alexander Aring
Hi,
this patch series contains fixes to forbid various security parameters settings for monitor types. Monitor types doesn't use the llsec security currently and we don't support it. With this patch series the user will be notified with a EOPNOTSUPP error that for monitor interfaces security is not supported yet. However there might be a possibility in future that the kernel will decrypt frames with llsec information for sniffing frames and deliver plaintext to userspace, but this isn't supported yet.
- Alex
Alexander Aring (15):
net: ieee802154: nl-mac: fix check on panid
net: ieee802154: forbid monitor for set llsec params
net: ieee802154: stop dump llsec keys for monitors
net: ieee802154: forbid monitor for add llsec key
net: ieee802154: forbid monitor for del llsec key
net: ieee802154: stop dump llsec devs for monitors
net: ieee802154: forbid monitor for add llsec dev
net: ieee802154: forbid monitor for del llsec dev
net: ieee802154: stop dump llsec devkeys for monitors
net: ieee802154: forbid monitor for add llsec devkey
net: ieee802154: forbid monitor for del llsec devkey
net: ieee802154: stop dump llsec seclevels for monitors
net: ieee802154: forbid monitor for add llsec seclevel
net: ieee802154: forbid monitor for del llsec seclevel
net: ieee802154: stop dump llsec params for monitors
Quoted 4 lines
net/ieee802154/nl-mac.c | 7 +++--- net/ieee802154/nl802154.c | 52 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-)
This series has been applied to the wpan tree and will be part of the next pull request to net. Thanks!
regards
Stefan Schmidt