lkml.org 
[lkml]   [2018]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.14 087/110] nl80211: Check for the required netlink attribute presence
    Date
    From: Hao Chen <flank3rsky@gmail.com>

    [ Upstream commit 3ea15452ee85754f70f3b9fa1f23165ef2e77ba7 ]

    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>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    net/wireless/nl80211.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
    index d396cb61a280..93837c1b49eb 100644
    --- a/net/wireless/nl80211.c
    +++ b/net/wireless/nl80211.c
    @@ -11298,7 +11298,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;
    }
    --
    2.11.0
    \
     
     \ /
      Last update: 2018-02-03 19:38    [W:4.624 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site