From nobody Mon Feb 9 16:50:53 2026 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 5C499354AE1 for ; Wed, 12 Nov 2025 19:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762976220; cv=none; b=WSOXaeXzf8E4l3OPKj+BWpM2tq16coGuooV5EEvPQ1zKmDwk60AEHghREQqX80AxtnC+P85agpCBQP9ai7iUtdDxYMvC8yqc/fw//1KMXdY0oMBygZF+iGvwKWgbKOndMqfhmct6R/SsdBaYcy++5DXpmF509UwzyNDM+Fcyd7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762976220; c=relaxed/simple; bh=PFv1OmBfIMgSJ3pXO9p+5/cBcBjYjG4mM7vYgMXZFLo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rBMj/4Rnc2KHZCUrZz+wns/wvpRwUZOPlIBnHlpKGr6oNS9YxcRX9o/oc5nZ/MeRVBVE6ahKPC8e+KQt2CLLQ1O89MhvcUof0yn1zzPyW4eGYpOEbbhmgLSve2E/833AJsoIIkLnfeG04bpaxuG8nPdQnoM2XuZo5FmQcVVtWpU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 249FB1F798; Wed, 12 Nov 2025 19:36:43 +0000 (UTC) Authentication-Results: smtp-out2.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0D8113EA61; Wed, 12 Nov 2025 19:36:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0LvQAsvhFGm+YgAAD6G6ig (envelope-from ); Wed, 12 Nov 2025 19:36:43 +0000 From: Daniel Vacek To: Chris Mason , Josef Bacik , David Sterba Cc: Daniel Vacek , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 5/8] btrfs: don't rewrite ret from inode_permission Date: Wed, 12 Nov 2025 20:36:05 +0100 Message-ID: <20251112193611.2536093-6-neelx@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251112193611.2536093-1-neelx@suse.com> References: <20251112193611.2536093-1-neelx@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 249FB1F798 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="utf-8" From: Josef Bacik In our user safe ino resolve ioctl we'll just turn any ret into -EACCES from inode_permission. This is redundant, and could potentially be wrong if we had an ENOMEM in the security layer or some such other error, so simply return the actual return value. Signed-off-by: Josef Bacik --- No changes since v5 other than context. --- fs/btrfs/ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b524db8a4973..2973230f2988 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1910,10 +1910,8 @@ static int btrfs_search_path_in_tree_user(struct mnt= _idmap *idmap, ret =3D inode_permission(idmap, &temp_inode->vfs_inode, MAY_READ | MAY_EXEC); iput(&temp_inode->vfs_inode); - if (ret) { - ret =3D -EACCES; + if (ret) goto out_put; - } =20 if (key.offset =3D=3D upper_limit) break; --=20 2.51.0