nl80211: Check for the required netlink attribute presence
Subsystems (3)
PATCH 1/1 nl80211: Check for the required netlink attribute presence
nl80211_nan_add_func() does not check if the required attribute NL80211_NAN_FUNC_FOLLOW_UP_DEST is present when processing NL80211_CMD_ADD_NAN_FUNCTION request. This request can be issued by users with CAP_NET_ADMIN privilege and may result in NULL dereference and a system crash. Add a check for the required attribute presence.
--- net/wireless/nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/wireless/nl80211.c +2 -1
@@ -11361,7 +11361,8 @@ static int nl80211_nan_add_func(struct sk_buff *skb,break ;case NL80211_NAN_FUNC_FOLLOW_UP :if (!tb[NL80211_NAN_FUNC_FOLLOW_UP_ID ] || - !tb[NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID ]) { + !tb[NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID ] || + !tb[NL80211_NAN_FUNC_FOLLOW_UP_DEST ]) { err = -EINVAL ; goto out; }
Signature · 1 line
1.9.1
Quoted 5 lines · Hao Chen
nl80211_nan_add_func()does not check if the required attributeNL80211_NAN_FUNC_FOLLOW_UP_DESTis present when processingNL80211_CMD_ADD_NAN_FUNCTIONrequest. This request can be issued by users withCAP_NET_ADMINprivilege and may result in NULL dereference and a system crash. Add a check for the required attribute presence.
Applied, thanks.
johannes