Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp297663rdb; Mon, 22 Jan 2024 04:44:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTPhQLjGeJ382lh6NztG2+84VqTUU2yrMC8U9Cecf8VMbA5LnTT+hC5vWkS0UnWq6CF0hp X-Received: by 2002:a05:6402:3595:b0:55a:8a40:5807 with SMTP id y21-20020a056402359500b0055a8a405807mr2742030edc.38.1705927480671; Mon, 22 Jan 2024 04:44:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705927480; cv=pass; d=google.com; s=arc-20160816; b=yeX1TF/AIGYEHxJY5ihTPCSctJrGVQgODaUxHHj4D8zsq0w8nmVJwBBRo6M1z975XA ruaz+5U+7P08y3FvGrp+hqkjXMUM3Ta49lHvSkswZ97TAlvURh2M9Odtwjz8dfDZ2SdU oO0oXxAwTdyIhBm6owm1e3HLBseDf2evZKzELN0zO+j7Wgv6CSFKu41tgugRwmCbzcEJ uH0nfx4XooSwSWM91KN8qiftvTUHlIOhcPOT0T0ns4+vWyGZ56Ft3zUeiuSZ8yBQf8uC GDFOGN7wmlk/Bmo+4Ib+NVVpD5JhU38ZEarVmoMaidNerN0fH1XG6pe3TIEiObb6G8Uf ymHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2EbxtrFCFvcK5IiuVsAPW/KUPjjRaC8uqKzNdD5mRDM=; fh=xQ9BRuHhT0C0qZDw0d0x02mqoMfIRGw/QyOdR1fGSOM=; b=ZNOnksRzgqer76FCrbav8gCXLmzAEZ1IwZcKuke//yQ4RiUMCUnEU5LtSfusl7xOcW gBCVqF+PBWECnYJ4kLjjv+ZpXcDG5bAprZZSgbxD2eMElz+IcSe1/YJJo1s4IAFMH/qX cyONYuvL6U25O95ycAuDkBauGoWZNdMRov8SIafG/WzKmetqf1eYXpmwhddne2liEylo YyjvTWm2+/opTYwmdVUSO4S03sd/sOTuAI0MCpDEgLdVq2Kcwv908NXO2m8ig3eeFnrI E+gb2+Dt6YItJ0gLQANvIh4Z+/3nSMJdflSvPkYeWlC7aArgTBPsLkTH+CTtH3jcY0Rq KVHQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T7hSSHGr; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q10-20020a5085ca000000b00557c1791121si11181212edh.439.2024.01.22.04.44.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:44:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1234-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=@redhat.com header.s=mimecast20190719 header.b=T7hSSHGr; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 6E3181F2493D for ; Mon, 22 Jan 2024 12:44:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E2FE3CF43; Mon, 22 Jan 2024 12:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="T7hSSHGr" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 986A23FB1B for ; Mon, 22 Jan 2024 12:39:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927165; cv=none; b=hUAFOjwrkkjlUfeL35f8ChiM5580Dx90Jhtxg2w8VFerlYgCV8n9GoTKaDfvd6uxyJsziDX8Ym4sXtg/GC3wpRReiYT8pPlKhigtD/n1WHA0u5dba4Q8qBoXZk2TrXg56lbVbmGxIrqOv7HPhzrgjLIxhOrdhG7kKUeKXQEbdiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927165; c=relaxed/simple; bh=BGYCQmdxuK36T0p5PfoL1bkyJdAK5JMIMZ5+TCMUjLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P50lJaK3m173Ryb5MHXKor+k0hFF2ojq3xh4G2ujdBRZxN2jTYTCwhATvYzgfbJR7XZGqN1REwVfYDqyLjhK3puTuI4y56r9RFC9p/mOdRrrzjfH5YdtRxhOK/VkUtlvBm4Ckoh+hgjnJ7sPatJAm81xerUzj33Gl+VJjp1r1TA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=T7hSSHGr; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705927162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2EbxtrFCFvcK5IiuVsAPW/KUPjjRaC8uqKzNdD5mRDM=; b=T7hSSHGrvhXyexpy0CQHO5m1CdFLeLKuuoUrQcc7MBEqBdGcK2W+CKyUcptUXQbYfcPKLY chS+K/9fgAJs+xnR/yk12YOk/Sr9KnrZyhMaGL+Ms6YM+9ttZ7yR7HQveVJgp3wWOKzO2Q tdQ3LeWlkKxw4aH5iLvI2jF8CmHU1wE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-cT5bUUrvOPuNd97vS-GVBg-1; Mon, 22 Jan 2024 07:39:19 -0500 X-MC-Unique: cT5bUUrvOPuNd97vS-GVBg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9CAD88D283; Mon, 22 Jan 2024 12:39:18 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id E643B492BE2; Mon, 22 Jan 2024 12:39:16 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel test robot Subject: [PATCH 10/10] afs: Fix missing/incorrect unlocking of RCU read lock Date: Mon, 22 Jan 2024 12:38:43 +0000 Message-ID: <20240122123845.3822570-11-dhowells@redhat.com> In-Reply-To: <20240122123845.3822570-1-dhowells@redhat.com> References: <20240122123845.3822570-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 In afs_proc_addr_prefs_show(), we need to unlock the RCU read lock in both places before returning (and not lock it again). Fixes: f94f70d39cc2 ("afs: Provide a way to configure address priorities") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202401172243.cd53d5f6-oliver.sang@intel.com 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(-) 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) if (!preflist) { seq_puts(m, "NO PREFS\n"); - return 0; + goto out; } seq_printf(m, "PROT SUBNET PRIOR (v=%u n=%u/%u/%u)\n", @@ -191,7 +191,8 @@ static int afs_proc_addr_prefs_show(struct seq_file *m, void *v) } } - rcu_read_lock(); +out: + rcu_read_unlock(); return 0; }