Received: by 10.223.176.5 with SMTP id f5csp896132wra; Sat, 3 Feb 2018 12:50:51 -0800 (PST) X-Google-Smtp-Source: AH8x224RVnJaLL5d6A27Y1bVufcrUKEjuFStChqNVwUCX6XooNzMhczoL/i5SrTgNFdC5iGyD6jC X-Received: by 10.98.14.3 with SMTP id w3mr43497475pfi.154.1517691051853; Sat, 03 Feb 2018 12:50:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517691051; cv=none; d=google.com; s=arc-20160816; b=EjQcg1UUrhzL00RKuHBV05p2HaEklzyGa3+4Tkt+C5GEPx2vU8z4tz8lbVeGqB3cLB vo2JGr/NJvOUZWOoIPta7MU/fb1xSGakGH9E4lprA1psiW7bCZ6HiifWky+y6SkjZSeG M+TZK2vUioiO0+a8BZquvr8ad6ri0zdMyTuak8X2KAeVWnKf8he8hzIwoS4ESR6uglAg zayqPaYdMIW31vvhIJ9dG4c3TsK5gOHLzaJCJycuXERcyeVbbUwMV9Lu0m812GhsoG28 MKZ892lFTE59hMRoawEDOsbx62S0xiJS0yEVbHUZaJ+/9kvSTzK06RNW/IsTg3PS8KjN +Icg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=pQYTa54LEx0aI41ujyIyAuYmbklIJNmo5BKSeExzDvg=; b=U0sHJi6hF5SyjNv98El+xAReVun9FFILPMF1OritKmxdG0XgjaUJCb1EfyM59ysWYQ gWXvoeJI41PvwOQiWx0nyHjQB2G0GheGs1bto+QVfH6MicOGGGP1uzLYN2U92GyJRWUU yy4f1Buelh//lMgUGrdeopbHYS91pm+LFOLfCJuOhVodvt8idFBOcw5kRLUDCi/NHGJm +ZlzFz8haGiIoIPp42CEeFhyKsJmpUUpw2XzbT26yc/Oei6y+Dz9t5cUnydBkvUe3orP 80hezS0SdGS9YrJITO0rxFLilWStkyi6UTm9pjxXWandkC4JJ9ru96arfM8E4K3w6QEi 8wcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=D4VLmAov; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si3372210pgp.162.2018.02.03.12.50.37; Sat, 03 Feb 2018 12:50:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=D4VLmAov; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbeBCSh1 (ORCPT + 99 others); Sat, 3 Feb 2018 13:37:27 -0500 Received: from mail-bl2nam02on0139.outbound.protection.outlook.com ([104.47.38.139]:53867 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753254AbeBCSDq (ORCPT ); Sat, 3 Feb 2018 13:03:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pQYTa54LEx0aI41ujyIyAuYmbklIJNmo5BKSeExzDvg=; b=D4VLmAovr7VQLm5VW8RBU7GTlZFeCSS98NiTMS227sq1c4YrHiW7rTXnBBe+ztu3nrT0NlR7BNvshd4kvGmbWpxi7Xuh9ci54LW156I6t7MRS64DGKbKy/wbd6F+SX4Krli3vi4Putw1idTXZeGj1lIONbWup5tCCLtmMTG2VsM= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1041.namprd21.prod.outlook.com (52.132.23.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:02:14 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:14 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Hao Chen , Johannes Berg , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 087/110] nl80211: Check for the required netlink attribute presence Thread-Topic: [PATCH AUTOSEL for 4.14 087/110] nl80211: Check for the required netlink attribute presence Thread-Index: AQHTnRkBwUdZONWnUkWXayVe2sGL5g== Date: Sat, 3 Feb 2018 18:01:24 +0000 Message-ID: <20180203180015.29073-87-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1041;6:mdK227OdsN/VFM5m4gH6wyYc+TzG4twfQNKlPE/LHro2LQ8oki6zP+J6VFMxlNJKxx+R8Z4MzemgPBIpArNVkGE0snLZfOecbJ51cGaqpAXPRSlyA2dCrAqEuvbamzih5lzuJb297o1OAnSF3XeoPT2AL5vXVtVv7vWNbaZPsFEc52N4bZFRUU6JP10V8WAc4m/DASr1g959XXlQmqUJSl3aBcv10uJxAsXgzxHFVr54OPK2xsAemRcg0klXivWAmssnf5NyOQQlyFTSoknkQ24TffHVPYEN9gnFk6nhn6HF+KV2XWU5ajeg09jfYlBNFJa3uZIH0tpmROa7TxQPZYC7Y3YSE5nCaS4yzqOaSD94Ydh6gvJ4xcog+7ujPbtn;5:4ujEsGyAug0SCAJoiyQLO8hdY2qywEQ2om+qPFMm0mJ2APPdbqrMh37XqnEQB1/QO4J/BpYVSPhI9OPskwqWUBiryVWP9hPbMD0fUTAD5R8D0bvX5NyQkSXfKc4HdVZTw6+tQPk5pvIFSxPSBbYtZSj3VamGuQs4B3PwkdKufEQ=;24:HdBdXiwpvsakB0rc0HjkLskjBt6TuhyGPiKz0loZ9KbDnI2GOReQN9WTqtu8LGST3SGfhRW+KDdBN6R2fEj/+Eggr053YG5RTWmxfmhzT8M=;7:FJm284e20PKZt+61tQa/OZED4tnPESjB7bj5QVXG7O15r7ZCTR6K3vEC996IhR1xSseRc95PkwvRghv5swpIc5HjoV1jJ/oYpwVuw/QffV1g3rD5KanymI0IvqM5f5RWDxq+Gkwg0qBrS6+UDJd0rJIh0V8FRLn3YV836nlcEmmz0389/gHhvT+qq6l1Ko8rTIvpfKbad/WjReyNYjYHzUDabjz6w+SbEdp99SNaHK0Q1SuwYhCceBio5xOGJEtA x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c4605fbe-eae6-4fa3-f4ef-08d56b3041a2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1041; x-ms-traffictypediagnostic: BL0PR2101MB1041: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1041;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1041; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(366004)(39860400002)(376002)(346002)(189003)(199004)(2501003)(305945005)(3660700001)(5250100002)(81156014)(99286004)(81166006)(36756003)(7736002)(10290500003)(106356001)(53936002)(5660300001)(316002)(22452003)(8936002)(54906003)(110136005)(3280700002)(478600001)(72206003)(4326008)(39060400002)(25786009)(107886003)(102836004)(97736004)(76176011)(59450400001)(6666003)(66066001)(6506007)(2950100002)(2900100001)(68736007)(8676002)(6116002)(3846002)(186003)(1076002)(6346003)(105586002)(26005)(10090500001)(2906002)(6512007)(86612001)(14454004)(86362001)(6436002)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1041;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: nhYz8gUWZMoJ4VDyFqnXtJ0WEkl0tUiD3/YXzUF+FxwzRTkTsYySLnEQ7k8xxsRVzBvIZYEcEDuz90a6TF/nXw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4605fbe-eae6-4fa3-f4ef-08d56b3041a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:24.4721 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hao Chen [ 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 Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- 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 =3D -EINVAL; goto out; } --=20 2.11.0