提交 3ea15452 编写于 作者: H Hao Chen 提交者: Johannes Berg

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.
Signed-off-by: NHao Chen <flank3rsky@gmail.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 820d1d5e
...@@ -11361,7 +11361,8 @@ static int nl80211_nan_add_func(struct sk_buff *skb, ...@@ -11361,7 +11361,8 @@ static int nl80211_nan_add_func(struct sk_buff *skb,
break; break;
case NL80211_NAN_FUNC_FOLLOW_UP: case NL80211_NAN_FUNC_FOLLOW_UP:
if (!tb[NL80211_NAN_FUNC_FOLLOW_UP_ID] || 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; err = -EINVAL;
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册