Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp535239rdb; Wed, 17 Jan 2024 09:17:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMjvLBbHYsfq2LdGecW8CxY35Iokv2BioECqixXpZ0Z56yfk+N4QYGAitVFdfmeQjK7QaL X-Received: by 2002:a05:600c:4f48:b0:40e:6195:239c with SMTP id m8-20020a05600c4f4800b0040e6195239cmr5162458wmq.90.1705511854527; Wed, 17 Jan 2024 09:17:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705511854; cv=pass; d=google.com; s=arc-20160816; b=drB9QfIMNORHQpCJH5UBS2FFrtjP1oKhrBd9E///g25BWvs/GK1SbyPNj/YJGECVKK h7/GJNGV3ovN4FuC3oP0rJDtLxcqftzv7DQTMHY6vRWnPD8qYAz6SG+BAxInXDeFAfIC i06/NTuDxwyECHYj7WTLwYxf/JP99tYgwO47Gcf+EXAOgEdiQcO9fdYAHwKX9H8vJGO6 V2GSlyfHi2DxaGRvI0KKTmz9JZkRrkbrWKwp6mUD9k4kMjaAps4r1avG5km2EUHpfHSL kcYq37BKeP/cbUq2d7WhMhIn+Br4KWaqrswjZWJYK0mILb4HqW8fEkg5VMlntruAdwKk 9nMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=TSQYgrBx5fi8DsH2MSKPE2LLO3oMaLJBOPol1630iF8=; fh=8xemq92HvJDbfgP0Laj2JM65iHO73M2bFH+7FYIK4AE=; b=0+r8X0n5DPVi9XUn6fcizFgSu0kRMSDISHgWhMwSp/Qyd1o2LhfWkV46a9qjNHS9VE cNB/tqocM48gnSrtTAKskS1C4nXgJJxy2kGyej5/JZFVRDcWOUXifVla91OszGoCuMnW HqMAXTdMJnT2E5dEaWc83VxWUqECB/ZidU8xkCJnzOvLiN5/4UgrrhfuiXiOvW1el2+2 CRn33MO5YhW9WSv8kHXknKgymc4ea8559Ecpl0oqZOa1vKLQwZpvX8WNVKtNBLTgaa+s bt6D5mnimT3T0EpAEyx2N6fu2Mfr5of8EHOKgYAn0m7wEo6Y/SxcuPd+4EQSBFRLCkF6 kE3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lz3ZGuPF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fk3-20020a056402398300b00559eed310b0si283066edb.396.2024.01.17.09.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 09:17:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lz3ZGuPF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 498911F22659 for ; Wed, 17 Jan 2024 17:17:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8587B22612; Wed, 17 Jan 2024 17:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lz3ZGuPF" Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81ACB224E2; Wed, 17 Jan 2024 17:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511841; cv=none; b=KMRypw/eFm7U7Tpf1ICFA1uMG+GD/InSGq6UL5H/pAP9Hl2xdfCsmUu5yW2fa2I8HyoPSugGKYlAa1TM/KlHbYdLGHM3LFfqiWnX9cjYGd2rG5OxVImFlXwdINkOeH0DGvSkzb5jO3icPEUe7AMwv5CkEwYvuWyGsJRkIzqRf0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705511841; c=relaxed/simple; bh=ejjzp/N6GXN4bKMnwIhWefZoBsy9/Ncj1iYqg76d+58=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=M6qspfOgsXlC04t+N1b2F64eQm6Dr8Ow63oA8yNVqRXyRZUBYplDejbMHfZYH/E7jDyIH8oZorTLObq8ZilYvTsBvVOe5EQgNoqz1i/3Kgj7tZYI/QYJbRxbgPB9+JMq4hRSFo1ZkG7kIAH/RcGP1t6lwH/+tFsVi2F9iuR3Zn0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lz3ZGuPF; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso8894851a12.2; Wed, 17 Jan 2024 09:17:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705511839; x=1706116639; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TSQYgrBx5fi8DsH2MSKPE2LLO3oMaLJBOPol1630iF8=; b=lz3ZGuPFXJY9Un1zMmQ0Fj8dEg2EOOVA1TLPeggyGfky/IeF08RUe8w6PDo4xyPKDK NksAdoc5L+gkqL30SYcHFepJYmKYN7Moe/eseUPaTAvhp3rxRSKuoxnmQY9Nb6uwla1N 0MtV4pfplvXh+AApg4IRW2Rp3FTfBnU0mGVS+EB9kaVSjQWvB4L3BYI1r96v2v3UGQ6o SzabGSQVB6HeJWeg4bIN0y0ObizMzUGV2IzDJBp7rDtKAe15R8u+dHd0DDk2dMiPfJOM fwa+p0Zu7hbqMpCCifGMo92VdeFfnRHaEzSVugqnHFiATzPAM0N9+fyKRbMNe+aGLRLj OWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705511839; x=1706116639; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TSQYgrBx5fi8DsH2MSKPE2LLO3oMaLJBOPol1630iF8=; b=mphvV957IBUkLp00zBWyC+I6mrSmj4Him2AevkC9+MgJxTFRXAE4G4kgnSpHU2k4mC oPQ2FhkX5h/p3y8o0b9zkBNqh3mIkVKBa1HwLHpcL7yTyd8ekzgw5qAsye3SaeaxZy5W cjk8IDjdYvFsx+/INgl2FWXEq/IAS75zzcd0Eqm6dlyXIQfQKHlDsBv/QluRPTq2Q2sl eUdA0hS5le2J4qRdg8sknugmQbURHmKVD3VNDfavSFYaljE4wnk1wqQNhXWXMBCEnbfS /SBi2iB0RPD/lPyIBroODZoTx0xOtp86fAYJkkdwbOZq6Q7hdQ4F0dyMPCrFOccRyRdG OINQ== X-Gm-Message-State: AOJu0YwTckMRqRlKQRrgOOBktl5cCxlMZVBWmBM4sqYdu7XlolcNVJuI n6hFsybg3MeDRMNGcFTfPYk= X-Received: by 2002:a05:6a21:a597:b0:199:144b:e205 with SMTP id gd23-20020a056a21a59700b00199144be205mr10417656pzc.99.1705511839576; Wed, 17 Jan 2024 09:17:19 -0800 (PST) Received: from smtpclient.apple ([2402:d0c0:11:86::1]) by smtp.gmail.com with ESMTPSA id jw10-20020a056a00928a00b006d9af59eecesm1685787pfb.20.2024.01.17.09.17.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2024 09:17:19 -0800 (PST) Content-Type: text/plain; charset=utf-8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: [PATCH] afs: Fix missing/incorrect unlocking of RCU read lock From: Alan Huang In-Reply-To: <2929034.1705508082@warthog.procyon.org.uk> Date: Thu, 18 Jan 2024 01:15:02 +0800 Cc: Marc Dionne , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <2929034.1705508082@warthog.procyon.org.uk> To: David Howells X-Mailer: Apple Mail (2.3774.300.61.1.2) > 2024=E5=B9=B41=E6=9C=8818=E6=97=A5 00:14=EF=BC=8CDavid Howells = =E5=86=99=E9=81=93=EF=BC=9A >=20 > In afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in = both > places before returning (and not lock it again). >=20 > Fixes: f94f70d39cc2 ("afs: Provide a way to configure address = priorities") > Reported-by: Marc Dionne > Signed-off-by: David Howells > cc: linux-afs@lists.infradead.org > cc: linux-fsdevel@vger.kernel.org > --- > fs/afs/proc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/afs/proc.c b/fs/afs/proc.c > index 3bd02571f30d..15eab053af6d 100644 > --- a/fs/afs/proc.c > +++ b/fs/afs/proc.c > @@ -166,7 +166,7 @@ static int afs_proc_addr_prefs_show(struct = seq_file *m, void *v) >=20 > if (!preflist) { > seq_puts(m, "NO PREFS\n"); > - return 0; > + goto out; > } >=20 > seq_printf(m, "PROT SUBNET PRIOR = (v=3D%u n=3D%u/%u/%u)\n", > @@ -191,7 +191,8 @@ static int afs_proc_addr_prefs_show(struct = seq_file *m, void *v) > } > } >=20 > - rcu_read_lock(); > +out: > + rcu_read_unlock(); What about using: guard(rcu)(); Thanks, Alan > return 0; > } >=20 >=20