Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2628433rwd; Wed, 14 Jun 2023 05:37:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Gt+8/Asi3F6DAjZFFhJsWASZb3uEjdOcm0GNp/tXWvBEesoArCPCQZ3OWNl+q/k47KHly X-Received: by 2002:a05:6a20:4426:b0:11a:efaa:eb3e with SMTP id ce38-20020a056a20442600b0011aefaaeb3emr1422789pzb.33.1686746222859; Wed, 14 Jun 2023 05:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686746222; cv=none; d=google.com; s=arc-20160816; b=YC1yU+xYwlHdhbj4RyoQqKErigs9H6tBEEquZFbjcZvk8Jqao3pOGNdIt8AdWUZnHF 5royVomxYq7KAhI/8whqwk9oQw3qCbuX3aUt9En70MtrrFnrM8aTWCkNp9QfRWOdYewC WHjhkHXiR6u0gnh6mjYdwSRGNPKXHv5xeyVjeTj6ml8HIjvi9lY7EYpHy0VkoKBf8PZJ NAjnUwvKNC+X044pkLVGCxmmJg6xUFvIw1f3rEoXu0ZANFS2A9sirF/OUcupUCWza4UR QdYv2Me5pcmZTtrcMqEQ3k9bw6DCPH3VxMOwuLqSw2SOqighTZ82YldGQZBiJtn3t6OT ASTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=iKNDkocZpavorovVWZXECbv8Vc+7HiWanqVcNNoSqAA=; b=P91xGNOwGELZw+9Fqx9b8J/USOI3JMLNkC3TSk2K1vd6k/Qa1WNP/D2uhJZoYI1DCX XOCQTOnJCso7ypHkhLB/xPHnzGZvqPCc49qlkQEynx08zvWIw1bF2vmoCYOVZoifHBuA ZEFIBSa68SMzwDpMbEGZSm1TzLULw5hCqDUq6XAhnaY4zilMwmGjQZfTTGK0YoSvbki0 Nl5TKa7E1B3rZfO0aqkJ/xI/zzZdRiOare/ngpTlbRiw+E4FE5Y1HffY6fKmbX+9IvCa ZYL5aLGwBuH6a1m7y/beOMRPVwpDAmNRFJdySOQlbE7iWlVFJsSul2o0i4PztIGOTMIU e/EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=kjehX2zq; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020aa79f11000000b006645f87dbf2si7322724pfr.223.2023.06.14.05.35.25; Wed, 14 Jun 2023 05:37:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=kjehX2zq; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244595AbjFNMcr (ORCPT + 62 others); Wed, 14 Jun 2023 08:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243690AbjFNMcp (ORCPT ); Wed, 14 Jun 2023 08:32:45 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A211FD5 for ; Wed, 14 Jun 2023 05:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=iKNDkocZpavorovVWZXECbv8Vc+7HiWanqVcNNoSqAA=; t=1686745936; x=1687955536; b=kjehX2zqKTVGDaPWl1JkZrJanm35ayDDOBUNxBNSspbHvf0 s6zFCb3n2xGwPiqH8Pz1uch2pdYp6pJFZJP+qLm9lX9cuRg5xFBy1DjBY6keGQfw6Tg6f/a0Zv87c RnUu1f0q1hqCDnyjMMIa4WSQ4YkVMlJJ8UIOpXu09yP760DPIDcaQSbsnyEUD2M5uk79vaI6pSB+a 8ZDwZB1XKezAnlZSyfK7u7tdIduGxy/gKvAbn7unFTjtydlUGR0rH7AGmXqN4lq/3QrjJ7XeOQbzh VimDuZyOoSXud2ptbHmRnRtO0xHnInL56Zb4SWokpuyvpDwEOFSKtm03p+dSeyDQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1q9PfY-0068Eh-0U; Wed, 14 Jun 2023 14:32:12 +0200 Message-ID: Subject: Re: [PATCH 08/15] wifi: iwlwifi: mvm: Add NULL check before dereferencing the pointer From: Johannes Berg To: "Greenman, Gregory" Cc: "linux-wireless@vger.kernel.org" , "Sisodiya, Mukesh" Date: Wed, 14 Jun 2023 14:32:11 +0200 In-Reply-To: <75ea42d01f6397f5b46842e6eccd3fced9b6e31a.camel@intel.com> References: <20230612155116.168000-1-gregory.greenman@intel.com> <20230612184434.cf7a5ce82fb0.Id3c05d13eeee6638f0930f750e93fb928d5c9dee@changeid> <416fc1eba88e13c245fac4499ee0af2efbd5485a.camel@sipsolutions.net> <75ea42d01f6397f5b46842e6eccd3fced9b6e31a.camel@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.3 (3.48.3-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2023-06-14 at 12:28 +0000, Greenman, Gregory wrote: > On Wed, 2023-06-14 at 12:07 +0200, Johannes Berg wrote: > > On Mon, 2023-06-12 at 18:51 +0300, gregory.greenman@intel.com=C2=A0wrot= e: > > > From: Mukesh Sisodiya > > >=20 > > > The p2p, bss and ap vif pointers are assigned based on the mode. > > > All pointers will not have valid value at same time and can be > > > NULL, based on configured mode. This can lead to NULL pointer > > > access. > >=20 > > This is not true. > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* enable PM on bss i= f bss stand alone */ > > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (vifs->bss_active && !v= ifs->p2p_active && !vifs->ap_active) { > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (bss_mvmvif && vifs->bs= s_active && !vifs->p2p_active && > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !vifs->= ap_active) { > > >=20 > >=20 > > The pointers can only be NULL iff *_active is false, however, it may be > > false even if the pointer is non-NULL, so it's not exactly the same. > >=20 > > Probably a static checker thing that didn't understand it? > >=20 > > johannes >=20 > Right, so the commit message could be rephrased like this: > "While vif pointers are protected by the corresponding "*active" fields, > static checkers can get confused sometimes. Add an explicit check." >=20 > Do you want me to resend it with the fixed commit message? Yes please. I also delegated this and the other one to you in patchwork again. johannes