Centos-kernel-stream-9/fs/afs
Marc Dionne 6f05bd5024 afs: Fix merge preference rule failure condition
JIRA: https://issues.redhat.com/browse/RHEL-77202

CVE: CVE-2025-21672

commit 17a4fde81d3a7478d97d15304a6d61094a10c2e3
Author: Lizhi Xu <lizhi.xu@windriver.com>
Date:   Tue Jan 7 14:52:32 2025 +0000

    afs: Fix merge preference rule failure condition

    syzbot reported a lock held when returning to userspace[1].  This is
    because if argc is less than 0 and the function returns directly, the held
    inode lock is not released.

    Fix this by store the error in ret and jump to done to clean up instead of
    returning directly.

    [dh: Modified Lizhi Xu's original patch to make it honour the error code
    from afs_split_string()]

    [1]
    WARNING: lock held when returning to user space!
    6.13.0-rc3-syzkaller-00209-g499551201b5f #0 Not tainted
    ------------------------------------------------
    syz-executor133/5823 is leaving the kernel with locks still held!
    1 lock held by syz-executor133/5823:
     #0: ffff888071cffc00 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline]
     #0: ffff888071cffc00 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: afs_proc_addr_prefs_write+0x2bb/0x14e0 fs/afs/addr_prefs.c:388

    Reported-by: syzbot+76f33569875eb708e575@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=76f33569875eb708e575
    Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Link: https://lore.kernel.org/r/20241226012616.2348907-1-lizhi.xu@windriver.com/
    Link: https://lore.kernel.org/r/529850.1736261552@warthog.procyon.org.uk
    Tested-by: syzbot+76f33569875eb708e575@syzkaller.appspotmail.com
    cc: Marc Dionne <marc.dionne@auristor.com>
    cc: linux-afs@lists.infradead.org
    Signed-off-by: Christian Brauner <brauner@kernel.org>

Signed-off-by: Marc Dionne <mdionne@redhat.com>
2025-02-27 12:04:25 -04:00
..
Kconfig
Makefile afs: Move the vnode/volume validity checking code into its own file 2024-02-13 08:47:44 -04:00
addr_list.c afs: Remove the unimplemented afs_cmp_addr_list() 2024-02-13 08:47:43 -04:00
addr_prefs.c afs: Fix merge preference rule failure condition 2025-02-27 12:04:25 -04:00
afs.h afs: Fix the maximum cell name length 2025-02-06 08:53:48 -04:00
afs_cm.h
afs_fs.h
afs_vl.h afs: Fix the maximum cell name length 2025-02-06 08:53:48 -04:00
callback.c afs: Add more tracepoints to do with tracking validity 2025-02-06 08:53:49 -04:00
cell.c afs: Add rootcell checks 2025-02-06 08:53:48 -04:00
cmservice.c use less confusing names for iov_iter direction initializers 2024-05-15 13:56:26 +08:00
dir.c afs: Add more tracepoints to do with tracking validity 2025-02-06 08:53:49 -04:00
dir_edit.c afs: Add more tracepoints to do with tracking validity 2025-02-06 08:53:49 -04:00
dir_silly.c afs: Simplify error handling 2024-02-13 08:47:43 -04:00
dynroot.c afs: Make /afs/.<cell> as well as /afs/<cell> mountpoints 2025-02-06 08:53:48 -04:00
file.c afs: Don't use folio->private to record partial modification 2025-02-06 08:14:11 -04:00
flock.c afs: Use the operation issue time instead of the reply time for callbacks 2023-03-15 12:16:28 -03:00
fs_operation.c afs: Don't use mutex for I/O operation lock 2025-02-06 08:48:58 -04:00
fs_probe.c afs: Fix possible infinite loop with unresponsive servers 2025-02-06 08:15:13 -04:00
fsclient.c afs: trace: Log afs_make_call(), including server address 2024-02-13 08:47:44 -04:00
inode.c afs: Add more tracepoints to do with tracking validity 2025-02-06 08:53:49 -04:00
internal.h afs: Fix lock recursion 2025-02-27 12:04:21 -04:00
main.c afs: Fix ignored callbacks over ipv4 2024-02-28 15:47:42 -04:00
misc.c afs: Simplify error handling 2024-02-13 08:47:43 -04:00
mntpt.c afs: Don't cross .backup mountpoint from backup volume 2024-06-25 11:18:30 -03:00
proc.c afs: Add rootcell checks 2025-02-06 08:53:48 -04:00
protocol_afs.h
protocol_uae.h
protocol_yfs.h
rotate.c afs: Add more tracepoints to do with tracking validity 2025-02-06 08:53:49 -04:00
rxrpc.c afs: Fix lock recursion 2025-02-27 12:04:21 -04:00
security.c fs: port ->permission() to pass mnt_idmap 2024-10-16 10:45:20 +08:00
server.c afs: Fix ignored callbacks over ipv4 2024-02-28 15:47:42 -04:00
server_list.c afs: Fix fileserver rotation 2024-02-13 08:47:44 -04:00
super.c afs: Don't use mutex for I/O operation lock 2025-02-06 08:48:58 -04:00
validation.c afs: Add more tracepoints to do with tracking validity 2025-02-06 08:53:49 -04:00
vl_alias.c afs: Fix the maximum cell name length 2025-02-06 08:53:48 -04:00
vl_list.c afs: Dispatch vlserver probes in priority order 2024-02-13 08:47:43 -04:00
vl_probe.c afs: Keep a record of the current fileserver endpoint state 2024-02-13 08:47:43 -04:00
vl_rotate.c afs: Add some more info to /proc/net/afs/servers 2024-02-13 08:47:43 -04:00
vlclient.c afs: Fix the maximum cell name length 2025-02-06 08:53:48 -04:00
volume.c afs: Increase buffer size in afs_update_volume_status() 2024-02-28 15:47:42 -04:00
write.c afs: Don't use folio->private to record partial modification 2025-02-06 08:14:11 -04:00
xattr.c afs: Add __counted_by for struct afs_acl and use struct_size() 2025-02-06 08:14:49 -04:00
xdr_fs.h afs: Fix directory format encoding struct 2025-02-06 08:53:48 -04:00
yfsclient.c afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call 2025-02-06 08:53:48 -04:00