Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp131196rdb; Mon, 22 Jan 2024 14:37:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/90YyjpKU38ctCvZBACltAD9d/sZPwKM893cWFrzgB7DZQOK1UthYQPhFyqJ/uVXR+PBA X-Received: by 2002:a05:6871:522b:b0:210:a1fb:5ee4 with SMTP id ht43-20020a056871522b00b00210a1fb5ee4mr569599oac.65.1705963046521; Mon, 22 Jan 2024 14:37:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705963046; cv=pass; d=google.com; s=arc-20160816; b=p4PIzfJK9XVz+KhAFhxJc7qdSjfxI4b626n/XYLTUSFls9OvQfOB9DatJrxfeyMEuW q4CrPtXtNuF282GZwjKa10PIkpIaNTNclmea8ycu26Keh8opqQ0pOg1DiP10cRA8QUUB gX+jqV654q71a5FNmDt6DYs4k5/Jkbw2SrlN0Lcajld3dWmBq74QDwXXOVnAi8KTuuA4 II91vQvjp8D0eB/Dk1vHqXs8ylRmOmpOJMRfOfwa6begLvHjRiQgmbce/+m+5s62XdxM jUlvTSO6JIeMLcRZH06vQrQ9GK/oen0dKczhXJsvZOBgVIE4idPoaxYLvGWU9Mx9NMAc OXbg== 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=jTFvjm7uTauZ+34Vgmb8EmPjNMwv3gKMhN5HXnXSFkYP3VObe0PAILITohX3dIg04k 8xFIgY5p6Q7CBnAqNRlJKB/YAXOCDi4FRVcFtxaeLQKGj/OPD3LHGcQ75NKeSdQjdCaF y6iiGldVa/EbE1e2aoPXkNndzOtfH4dl2+Bhhru2Tf/+l547EsevRkSqQnKB/eAUV15m DFtTZx4GhTCFa1mQLI+VBGJevYWV92U7GscI4tUQr1T4oTQRRoNRHEUm/64a0+xaG9AQ QYq9KWRYvut9HnAsiRcJo8hOzlh6ddq+IT5FqBSJtkBt6SpQ1zTZpr98lPwiNl6rLcN4 NYhg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H0voxf5a; 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-kernel+bounces-34249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z13-20020a63190d000000b005c6cc61ff0csi8674798pgl.152.2024.01.22.14.37.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 14:37:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H0voxf5a; 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-kernel+bounces-34249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34249-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9221D286832 for ; Mon, 22 Jan 2024 22:36:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AF4B4CDE6; Mon, 22 Jan 2024 22:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H0voxf5a" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 2479713AE5 for ; Mon, 22 Jan 2024 22:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705962787; cv=none; b=bRRQGf4SBedczT6SEIG0Bs4jaJfVQrXxHiAAJJhYTl1Hlh2C5j0QQXQZG2NC5ymNlNihN0irRiBeMzt5+QsBN78XYRwCIqGJZJmQ7EN/YYzL/MzZgBBWRVDSqwwc9/B+HTr8tu67SZqA5uEVn6++KCFOqGFCLDbD3cCQ/ooJx/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705962787; c=relaxed/simple; bh=BGYCQmdxuK36T0p5PfoL1bkyJdAK5JMIMZ5+TCMUjLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k8DkcIEt5EI8J3ldVn0UFO+8p0WwytZQ+ZeA6/zYOJiSeYLKP/EuMQlKWIBYEDMyippq9lDSU3C+XsL1S+zmD8igsq/8vmHfaWX4U/pNbmSZJ6NZEG9kuTCdDNTGsqKBsmr7BsBDTNPOalLX4zkXF5PJ2YKc3y+rklbMHOoECK4= 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=H0voxf5a; arc=none smtp.client-ip=170.10.133.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=1705962785; 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=H0voxf5a9jvuuZr2NXD6+orrDGoYH6YpyTa2UsELewal1HxL2vGVJRRq4fOhWgrOgtYYH/ mS4E3arziHNc6A1iyBmEd63YpKGD7AeZI35VF5872txIj8h7J+/ldv0AX2g2Qiyeo37Iw7 oPnk5+kYx88XB72VrklvjDn1zNXUnBs= 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-646-7Wyv8Y6KNviaO9h4wF-rXg-1; Mon, 22 Jan 2024 17:33:03 -0500 X-MC-Unique: 7Wyv8Y6KNviaO9h4wF-rXg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 0FF28863062; Mon, 22 Jan 2024 22:33:03 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC8335012; Mon, 22 Jan 2024 22:33:00 +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 v2 10/10] afs: Fix missing/incorrect unlocking of RCU read lock Date: Mon, 22 Jan 2024 22:32:23 +0000 Message-ID: <20240122223230.4000595-11-dhowells@redhat.com> In-Reply-To: <20240122223230.4000595-1-dhowells@redhat.com> References: <20240122223230.4000595-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@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.5 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; }