Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp631938imn; Tue, 26 Jul 2022 05:32:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmxzvgr4JYoV+lJgGZtLRbEjl8oks+L9P8dKds/3dDwRf711bB3dvwNm+W3KU0muVgG7mv X-Received: by 2002:aa7:9583:0:b0:52a:f076:5043 with SMTP id z3-20020aa79583000000b0052af0765043mr17341985pfj.9.1658838766752; Tue, 26 Jul 2022 05:32:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658838766; cv=pass; d=google.com; s=arc-20160816; b=TsLW3o1IKg4IfwfLLdL21y72j6n7g3c35ypTdcQQ1GDosIG48y464LQL2H+8fX5zoz K/yu5XiMpSzAfhe+X/YUAXaXmcdVE+G3X0Y1anZ/FH3p9dTyDgM7mgry6f4xhw+hjFrC K8j2kv7TSxKe9Et2GqrKBvVF1eIS2u1k4tFaEfW9Q3cIb3xBHgA95OckOZolXBCSTfLh PZ3eVbDd+UChyHvdWPY1/TvL3I+DJFdG9BlIcVADx3EZ+izJHcDW8h9gpmqCA5BoMRGq maKyDPfNTal0sALkGEAJ8YlwazYoBA6nHb8+G7GtMJhSPPnG0a2TnceiaRu8TcQU0q7o hbRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=18GXarUQ3jL1O2RMagJvrp6VQJVu7m+DREZ1/MUGIKE=; b=LjqMvO2uRX/KBWjUtKAqMlKJcuoS8LrS3bi7DHDXol6q9RXhzDUJNxYii9gzJKIQu5 BTGqFSbR4e/MRSApqEXvxvOdQp3ZyHV8TrvtdK09Ca+v+HcZelj0Q2dLHrueoXOsgyoT soh1W5FaKS7TVeub+mMMVOZf5Gg3e65mxoAUZ1MM0V1Zh90gJrpMPmb88R4QUpcg8Ozg Gh/gjr6Uv0fawxSjdnSmarmV73gHVF1xkAdq/U4QJ3ZGhM59WGNRZiwj9YZjVtWUFUlx S1krpL3GSTS5tFHlK8JOB9VXj/DWy0jiLJk5067lo01d45Pd8w9hjtMv6afz9lQ75f/K 2h0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=nUa2GObI; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s132-20020a632c8a000000b0041b3478e9c7si691829pgs.510.2022.07.26.05.32.32; Tue, 26 Jul 2022 05:32:46 -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=@siddh.me header.s=zmail header.b=nUa2GObI; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); 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=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233491AbiGZMRx (ORCPT + 65 others); Tue, 26 Jul 2022 08:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232573AbiGZMRw (ORCPT ); Tue, 26 Jul 2022 08:17:52 -0400 Received: from sender-of-o53.zoho.in (sender-of-o53.zoho.in [103.117.158.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C29CAE5F; Tue, 26 Jul 2022 05:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658837831; cv=none; d=zohomail.in; s=zohoarc; b=DwvStKCMX7XoSZbjyoswQoy4twyd44xhM49CK5T8sZq0ysHOuMdHO4gEucz21a+caA0AUUfMpjRLtcrLsZRG8h8J/+STMIB5fpYYq0xypc+ki3wyJOf18uTj1zi6G0xZUgjrQE0fXQPIKTdW5P/8XWaHUmDqTVsnYZHzIw5tNwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1658837831; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=18GXarUQ3jL1O2RMagJvrp6VQJVu7m+DREZ1/MUGIKE=; b=ZTDAh/jHJfjZlzakiKGVEgaNoU2l59n863+h41BvGV/RSPSEN95p0lAoyrTIRGo9k3PFGX2vls1Fw85SUtFcOYfRWRe3L9oCIHvCdyGM2w6L7J8WLPeMMEHlyAyLqjWO2tH7KuIseNlAgjw91Oz3WJJDmKuzWYFwyYeKaE11NhI= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1658837831; s=zmail; d=siddh.me; i=code@siddh.me; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=18GXarUQ3jL1O2RMagJvrp6VQJVu7m+DREZ1/MUGIKE=; b=nUa2GObIJsbmqiwdL3ub9h03vWog6RC7JII2RTx/fKCgQ8v8ELiwY0Ngrgqh8GYR AwGzeXfwiyF9Gpbp7HRRmdSlI+lIwdoSY744F7S6JMSRnnQXiPZ4DWC+JbbLkZAL1lg SZ//HSLlFEaFW/Y6g0NP+HJGgkFgQyXE8dOlQzOE= Received: from mail.zoho.in by mx.zoho.in with SMTP id 165883781910727.618496178340138; Tue, 26 Jul 2022 17:46:59 +0530 (IST) Date: Tue, 26 Jul 2022 17:46:59 +0530 From: Siddh Raman Pant To: "Eric Dumazet" Cc: "Johannes Berg" , "David S . Miller" , "Jakub Kicinski" , "Paolo Abeni" , "linux-wireless" , "netdev" , "linux-kernel" , "linux-kernel-mentees" , "Paul E. McKenney" Message-ID: <1823a705ed0.2c95d162772051.7830246635749918178@siddh.me> In-Reply-To: References: <20220701145423.53208-1-code@siddh.me> Subject: Re: [PATCH] net: Fix UAF in ieee80211_scan_rx() MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 Tue, 26 Jul 2022 15:37:16 +0530 Eric Dumazet wrote: > Note: this is slightly racy. > > You are supposed to follow this order in this situation. > > 1) Clear the pointer > > Then: > > 2) wait an rcu grace period (synchronize_rcu()) or use call_rcu()/kfree_rcu(). > Noted. Due to rcu_dereference() used to get scan_req, null ptr dereference cannot happen. That had completely missed my eyes, sorry for that. I will send a v2. Thanks, Siddh