Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2470931rwd; Wed, 14 Jun 2023 03:23:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5V1FNF4VWdA06dF8NIEZdNAtxFU75RkCTsux6cjQDTshb1VkWULbOVFsbymG1Hue24afCO X-Received: by 2002:a05:6a00:986:b0:64f:f478:2294 with SMTP id u6-20020a056a00098600b0064ff4782294mr1803316pfg.0.1686738194196; Wed, 14 Jun 2023 03:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686738194; cv=none; d=google.com; s=arc-20160816; b=SCUFJIOZuaLO+XdLl5iD7SMgv6G21UAhNZNg/TxfBIUS4/NKsbZSRxywh/BeMKOhdx hx8Yp0hgh6OgUUNFJJlh49wj0UISN2oPr2lRyQfcVf5EF9FS2dnQsENL9dpffpUb1MDk DrESMSR9MNs+EZLOI1YKteN/2nFE9O9/RBDvQhHVvF56DOPMiIWVDbMG8McR565JDfSs vIfn9xz9ziIYw+U8kdN4Cig1fWVJIMj1bSc7QqUqs1PUqOOYVyS2G3t7z9zpY+fqwGEi 5YH1G21mLcQlxiLZW+AP3vTJWtcagFrxj1tqsz08HCkDWWr1ztOs9YzVV8iVOiYFz4QK qU2A== 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=bv33olME/P1SJGBsr2FZLMiFk6Mc9y73BiLXf0hBm88=; b=EjiwcoTQMKvCbSHdBAFmv2qdCQX6YqwmvOUO+RwD7Q9eyX2W9k+shDPOXHKyHMTsdf 3FGyqK0aDG1LcaDCPgygX82UckU6yShIGjMCD9kOf+U+lmQWt8gHgAqVvZq+fJoa4XTc N4tnIDb8gZFqBm9eQM2uKiuYeZ29QrOgXqAXRKgIL3tb0ZmrtBACV4ePgKtil8146/Ab 3ZaVnXl6usOvFJ6faXGKjfPeCzstMOuk6fB4OUhuhr+Fut3hbUbnjFB7VJBIglV6i7vM GVYFxxyN8pegjWCQIU0DGNDNQTx0NPwV6I+X33WucKwoj/qHqNZb51Z8dyeqPm2Y/8OT khvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=mndXLMPp; 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 a189-20020a621ac6000000b00643bb2643f5si6842474pfa.124.2023.06.14.03.23.06; Wed, 14 Jun 2023 03:23:14 -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=mndXLMPp; 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 S235121AbjFNKIG (ORCPT + 61 others); Wed, 14 Jun 2023 06:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243789AbjFNKHm (ORCPT ); Wed, 14 Jun 2023 06:07:42 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B218B1FD6 for ; Wed, 14 Jun 2023 03:07:31 -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=bv33olME/P1SJGBsr2FZLMiFk6Mc9y73BiLXf0hBm88=; t=1686737251; x=1687946851; b=mndXLMPpAt7iTWr+nfVWV8E52tuz1b0b1MND7Qn5sXPfdtD cEBlK79nN7TpJIZJROJzD7wGXknAt6HldQlitUorJ7UTuzLnAJguWbPT2J5+RAdTFHfL08lcqYZ5b cYxQuebUKvg8zckOnTf4sx9Gsa4FXVlp/cWnE+hQ1v6AOJy9JZto/DQbYWU6eXlgWYWn4fxUTx1ek CAFgTs/pONTtseqVtRt0fZmTTo1kT8bAW2fbQMrdQIKGcbRAZpZ64df2EXrh3EZ/oxB6N+Xbw9DB4 FEbyXNdAPF4MapjwQKzo5q88PatQane20TEp2SBJpYXP+O365n+fWMuyTT1l7R4Q==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1q9NPV-0063tW-2r; Wed, 14 Jun 2023 12:07:29 +0200 Message-ID: <416fc1eba88e13c245fac4499ee0af2efbd5485a.camel@sipsolutions.net> Subject: Re: [PATCH 08/15] wifi: iwlwifi: mvm: Add NULL check before dereferencing the pointer From: Johannes Berg To: gregory.greenman@intel.com Cc: linux-wireless@vger.kernel.org, Mukesh Sisodiya Date: Wed, 14 Jun 2023 12:07:28 +0200 In-Reply-To: <20230612184434.cf7a5ce82fb0.Id3c05d13eeee6638f0930f750e93fb928d5c9dee@changeid> References: <20230612155116.168000-1-gregory.greenman@intel.com> <20230612184434.cf7a5ce82fb0.Id3c05d13eeee6638f0930f750e93fb928d5c9dee@changeid> 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 Mon, 2023-06-12 at 18:51 +0300, gregory.greenman@intel.com wrote: > 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. This is not true. > /* enable PM on bss if bss stand alone */ > - if (vifs->bss_active && !vifs->p2p_active && !vifs->ap_active) { > + if (bss_mvmvif && vifs->bss_active && !vifs->p2p_active && > + !vifs->ap_active) { >=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. Probably a static checker thing that didn't understand it? johannes