mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
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: Hao Chen <flank3rsky@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
820d1d5eba
commit
3ea15452ee
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue