]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: don't rewrite ret from inode_permission
authorJosef Bacik <josef@toxicpanda.com>
Tue, 18 Nov 2025 16:08:41 +0000 (17:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:08 +0000 (12:57 +0100)
commit98d65b62ddf84db83aafe4a9ef914428c835cd07
tree4d2c68ee6ea154cc6c22be8ebf5f0fd639dd7f2f
parent498e286941b961903be570d52d44e57f150d55ea
btrfs: don't rewrite ret from inode_permission

commit 0185c2292c600993199bc6b1f342ad47a9e8c678 upstream.

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.

Note: The patch was taken from v5 of fscrypt patchset
(https://lore.kernel.org/linux-btrfs/cover.1706116485.git.josef@toxicpanda.com/)
which was handled over time by various people: Omar Sandoval, Sweet Tea
Dorminy, Josef Bacik.

Fixes: 23d0b79dfaed ("btrfs: Add unprivileged version of ino_lookup ioctl")
CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add note ]
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ioctl.c