Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1524184imi; Sat, 23 Jul 2022 08:16:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tk7RsVOajaQFIczjzTTn1mqlbKVNAqVoQf9IoMbKceYM4ftouNkC6+BpwviZbIWMed3Lqv X-Received: by 2002:a05:6402:268e:b0:43a:8f91:582 with SMTP id w14-20020a056402268e00b0043a8f910582mr4788489edd.419.1658589390697; Sat, 23 Jul 2022 08:16:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658589390; cv=pass; d=google.com; s=arc-20160816; b=pGyLDuYZyM8NEYYGVbX6rHceS523pLeQf6S8FY1ZFPHbJAMX4r4+2miU4PL5mqDxli R3EofMruCuGD59wl5mrT4xFJPH5DXZh03UZESdhgkFHpadGfOrQifJ5etHryt/4n+Thl 4ouXERHHMq0T8jy6qePcMaUXq8ENp4ftAO6nOKPo/FXvQrGwvOiv6A+mwlULTU0CHP98 yvlEqgu84s06oDSJHnvAKSnCUbySeOzW2l3i6oQrWZWCs+r/c6xfcDBfsXNTzCW/JtCV G1MyMawnKa2V0SjudDZ/xWtLUww1edoC4Qfg0v6stNGP2rwGefEIkJI3SbyPCWqjAVLL wfkQ== 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=nrLqE1VQZTfewo+huIJiOECXb8Z/AkxV3GsY/VPoroA=; b=iAIpfRmNwMDB7aEcRRxbIAeO2EI/TW7aWvVtwNofAAXuP82P2SPEfHo+dy3fHTx5AC Zzjg0wnHz2Qo0XvX6XMjYCbdJ1159mpjVgR2zS90q4hTse1QQYFCPt1b31E1/NiThVkG uD+Jn7TaQ00of7HulzBNahcXc6ObTh2JfR1u0rlf2teZJvs6gRMcr2riUc7UqCAyiWk8 0hVqFcvI2HcRc8LpqgUpGdFx2yZBqgtScyELakL29+QHLhocSlFYZ2HuofG75a8wG3RW aVfZo7qj7NtG+EZzucDLBI+kvKxhjw8UFA/YuBYEOfKfTeWhUkxcsesXs6U9FDjkDIrU WFYA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=HAwK2u2f; 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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 gn21-20020a1709070d1500b007123c7ecf90si9690229ejc.476.2022.07.23.08.16.00; Sat, 23 Jul 2022 08:16:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=HAwK2u2f; 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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S238402AbiGWOa1 (ORCPT + 99 others); Sat, 23 Jul 2022 10:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238014AbiGWOaG (ORCPT ); Sat, 23 Jul 2022 10:30:06 -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 4187E17E04; Sat, 23 Jul 2022 07:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658586576; cv=none; d=zohomail.in; s=zohoarc; b=Cdk5zB8spFUck32lES6ymvWOW49Nk2dX62Ga5BzHiEMuUVqsF+VOY0B6Xd8XbFfH5G56ExBvuWYOSsk5g+HWOyjIaF7xqmwNNTz6f/r3tUYOJlmBaxKm0LEEAbEAanSYrU8oskEZqNdQIv+UWUBlbPnq4V4G5ds0OGP7xcLRPgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1658586576; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=nrLqE1VQZTfewo+huIJiOECXb8Z/AkxV3GsY/VPoroA=; b=TGXEGLyCPRw7jo2oPjtSaayeHmx0mwu5QPW9yhNoVwvYF6agE0ruM2srciLqk0aR+OB+ZFhst6wJutv1gI5Sg53KTnryGX+XS4/rPstaBIPgejnD4vPPbBdb484yXGuvgVctvF96UIyRpDFVacRDFbxnY+ePUhN89MD8h/32ck8= 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=1658586576; 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=nrLqE1VQZTfewo+huIJiOECXb8Z/AkxV3GsY/VPoroA=; b=HAwK2u2fVT4U+qrBKk2SJpEACflR3vDhV78T1rrMbXVDqo/6SCTTmQFzR1+X6ppZ MUq22UDFeKpknOEywseYLkVEs53BkHwqtlfFE76BK8v0IWOkCjp4pqBO5H8TK8J8aZy ootDBrMvSQQuZ+LPAGFVwpYPC4KAhKwC/cwPXLx4= Received: from mail.zoho.in by mx.zoho.in with SMTP id 1658586563873727.0268161715809; Sat, 23 Jul 2022 19:59:23 +0530 (IST) Date: Sat, 23 Jul 2022 19:59:23 +0530 From: Siddh Raman Pant To: "Greg KH" Cc: "David Howells" , "Christophe JAILLET" , "Eric Dumazet" , "Fabio M. De Francesco" , "linux-security-modules" , "linux-kernel-mentees" , "linux-kernel" , "syzbot+c70d87ac1d001f29a058" Message-ID: <1822b768504.1d4e377e236061.5518350412857967240@siddh.me> In-Reply-To: References: <20220723135447.199557-1-code@siddh.me> Subject: Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue 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-kernel@vger.kernel.org On Sat, 23 Jul 2022 19:34:17 +0530 Greg KH wrote: > Also you now have a spinlock held when calling rcu_read_unlock(), are > you sure that's ok? > > We logically should not do write operations in a read critical section, so the nulling of `wqueue->pipe->watch_queue` should happen after rcu_read_unlock(). Also, since we already have a spinlock, we can use it to ensure the nulling. So I think it is okay. Though, it is my first time encountering a spinlock and an rcu lock together, so if I am wrong, please do correct me. Thanks, Siddh