Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8649FC38142 for ; Tue, 31 Jan 2023 15:12:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232691AbjAaPMh (ORCPT ); Tue, 31 Jan 2023 10:12:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232362AbjAaPMO (ORCPT ); Tue, 31 Jan 2023 10:12:14 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A400B564A7 for ; Tue, 31 Jan 2023 07:10:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 40E59B81D1B for ; Tue, 31 Jan 2023 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90123C433D2; Tue, 31 Jan 2023 15:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675177754; bh=T51uegKuzukl3ZkjeIiLZP9VBhsaBt4W7GSHPwVxG9k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cyOknRSiZm0+nA3YMUt66CXZx9HirEFqUcaWgzflzztTO+EMI9+EuH6i0SONTpZyo yA7nsHpLa5raKX2AxJmlT92m4ZtKraxwTuTMvLjoyJNm6PJYCw0Kkp5BnpLz7IuhEl GGE0NPK1VQRF8/AIz7KEDt3a59Ou5dz+xtRn8EwM= Date: Tue, 31 Jan 2023 16:09:11 +0100 From: Greg Kroah-Hartman To: Martin Kaiser Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: r8188eu: fix NULL check for rcu pointer Message-ID: References: <20230131090057.241779-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230131090057.241779-1-martin@kaiser.cx> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 31, 2023 at 10:00:57AM +0100, Martin Kaiser wrote: > Fix the NULL check for padapter->pnetdev->rx_handler_data. > > The current code calls rcu_dereference while it holds the rcu read lock > and checks the pointer after releasing the lock. An rcu pointer may only be > used between calls to rcu_read_lock and rcu_read_unlock. > > Replace the check with rcu_access_pointer. My understanding is that this > function returns the value of the pointer and needs no locking. We can > then check the pointer but we must not dereference it. > > Signed-off-by: Martin Kaiser What commit id does this fix? thanks, greg k-h