Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9584747ybi; Wed, 24 Jul 2019 06:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzz/OQPRCZidrWiasPckUhZEct0k4638YOUkeu0RUsm+g6P9UeJWscvYiLvql03eUo5dfZG X-Received: by 2002:a63:553:: with SMTP id 80mr83838113pgf.280.1563975532443; Wed, 24 Jul 2019 06:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563975532; cv=none; d=google.com; s=arc-20160816; b=YiTWplquSO1ctp01nZU0u67afFK7xjaJ+qq/9NqdAOh1tv57cwR5E/gPOdlEa1mOlF 1hz2/6GhiRji3mpWD1aAcyZkpcEtNu2E0Ga3d34fWDpU/U6VPfhYBhzSJ2iLYyONHI7w 2LGio+PeP5jFyXSxEuOn1A+C1gPhz07ZUGx+QLwhpALYEE69hGNHiZW5zzKKMDd4qky+ Qp8M18vmpHTIlS6AZQgazhJi2MX7mDeAFQEbxneA6Td05R8lAs6v9tCNJaKCdhImEtDI QpJUiTWytnAZNA7568g7sRunXgtsb8cx0o4ZOxbcLj6oFRH+izVVCvAw+rweT0CvN9Fj 97zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=bJ8JrlMKpykOayRrj/Xq/56Pm7RuKTygUibNOK/k0Uo=; b=T0vaQO1SvrSQ8btP3SABuB3ODk7jQmfi0KUvTI+S7XbR6n/6+go3olaJOiFiOt7u9j xKRhnPF3PTM7LAbIm5CHqMedr/YvMYGocdzejKPeH3sqbtDGqrePFwunoYXR00h5tXdq voyFak8cpcfgqudlJHcQjz/YpnGUc7kVaZSv5Y384sCqZHm1/WIZUsFjcQyaJE9UUeAW x8suc00Z0MrudJU3md5eqvFPh6FSkx025It2BcBBjo2hvvLHHrMgSa27CMqYVNXQQBv8 5btwb3YH+0rea3oCuP5qGQgwmUfkdB7y6auNum/oCGIU4ffA0jRTuiZV4Xzqame49rfE SAcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si15946379pfg.286.2019.07.24.06.38.38; Wed, 24 Jul 2019 06:38:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbfGXMkl (ORCPT + 99 others); Wed, 24 Jul 2019 08:40:41 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:52926 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfGXMkk (ORCPT ); Wed, 24 Jul 2019 08:40:40 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hqGZO-0005pu-SF; Wed, 24 Jul 2019 14:40:34 +0200 Message-ID: <127c411cc06e04b61220a571f5332b9155c69f77.camel@sipsolutions.net> Subject: Re: [PATCH 1/2] net: mac80211: Fix possible null-pointer dereferences in ieee80211_setup_sdata() From: Johannes Berg To: Jia-Ju Bai , davem@davemloft.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 24 Jul 2019 14:40:33 +0200 In-Reply-To: <20190724123623.10093-1-baijiaju1990@gmail.com> (sfid-20190724_143632_658051_4FE62E07) References: <20190724123623.10093-1-baijiaju1990@gmail.com> (sfid-20190724_143632_658051_4FE62E07) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2019-07-24 at 20:36 +0800, Jia-Ju Bai wrote: > In ieee80211_setup_sdata(), there is an if statement on line 1410 to > check whether sdata->dev is NULL: > if (sdata->dev) > > When sdata->dev is NULL, it is used on lines 1458 and 1459: > sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP; > sdata->dev->netdev_ops = &ieee80211_monitorif_ops; > > Thus, possible null-pointer dereferences may occur. No, this cannot happen, monitor interfaces (NL80211_IFTYPE_MONITOR) must have a valid ->dev, only P2P device and NAN might not. johannes