Commit graph

1345 commits

Author SHA1 Message Date
Filipe Manana
506bbb9474 btrfs: reinitialize delayed ref list after deleting it from the list
commit c9a75ec45f1111ef530ab186c2a7684d0a0c9245 upstream.

At insert_delayed_ref() if we need to update the action of an existing
ref to BTRFS_DROP_DELAYED_REF, we delete the ref from its ref head's
ref_add_list using list_del(), which leaves the ref's add_list member
not reinitialized, as list_del() sets the next and prev members of the
list to LIST_POISON1 and LIST_POISON2, respectively.

If later we end up calling drop_delayed_ref() against the ref, which can
happen during merging or when destroying delayed refs due to a transaction
abort, we can trigger a crash since at drop_delayed_ref() we call
list_empty() against the ref's add_list, which returns false since
the list was not reinitialized after the list_del() and as a consequence
we call list_del() again at drop_delayed_ref(). This results in an
invalid list access since the next and prev members are set to poison
pointers, resulting in a splat if CONFIG_LIST_HARDENED and
CONFIG_DEBUG_LIST are set or invalid poison pointer dereferences
otherwise.

So fix this by deleting from the list with list_del_init() instead.

Fixes: 1d57ee941692 ("btrfs: improve delayed refs iterations")
CC: stable@vger.kernel.org # 4.19+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-30 02:33:25 +01:00
Roberto Sassu
b55da2e129 nfs: Fix KMSAN warning in decode_getfattr_attrs()
commit dc270d7159699ad6d11decadfce9633f0f71c1db upstream.

Fix the following KMSAN warning:

CPU: 1 UID: 0 PID: 7651 Comm: cp Tainted: G    B
Tainted: [B]=BAD_PAGE
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009)
=====================================================
=====================================================
BUG: KMSAN: uninit-value in decode_getfattr_attrs+0x2d6d/0x2f90
 decode_getfattr_attrs+0x2d6d/0x2f90
 decode_getfattr_generic+0x806/0xb00
 nfs4_xdr_dec_getattr+0x1de/0x240
 rpcauth_unwrap_resp_decode+0xab/0x100
 rpcauth_unwrap_resp+0x95/0xc0
 call_decode+0x4ff/0xb50
 __rpc_execute+0x57b/0x19d0
 rpc_execute+0x368/0x5e0
 rpc_run_task+0xcfe/0xee0
 nfs4_proc_getattr+0x5b5/0x990
 __nfs_revalidate_inode+0x477/0xd00
 nfs_access_get_cached+0x1021/0x1cc0
 nfs_do_access+0x9f/0xae0
 nfs_permission+0x1e4/0x8c0
 inode_permission+0x356/0x6c0
 link_path_walk+0x958/0x1330
 path_lookupat+0xce/0x6b0
 filename_lookup+0x23e/0x770
 vfs_statx+0xe7/0x970
 vfs_fstatat+0x1f2/0x2c0
 __se_sys_newfstatat+0x67/0x880
 __x64_sys_newfstatat+0xbd/0x120
 x64_sys_call+0x1826/0x3cf0
 do_syscall_64+0xd0/0x1b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The KMSAN warning is triggered in decode_getfattr_attrs(), when calling
decode_attr_mdsthreshold(). It appears that fattr->mdsthreshold is not
initialized.

Fix the issue by initializing fattr->mdsthreshold to NULL in
nfs_fattr_init().

Cc: stable@vger.kernel.org # v3.5.x
Fixes: 88034c3d88c2 ("NFSv4.1 mdsthreshold attribute xdr")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-30 02:33:25 +01:00
Ksawlii
c193da6e53 Revert "virtiofs: forbid newlines in tags"
This reverts commit e07d94ea1d.
2024-11-24 00:23:52 +01:00
Ksawlii
254706192f Revert "fsnotify: clear PARENT_WATCHED flags lazily"
This reverts commit 887fdf24d2.
2024-11-24 00:23:48 +01:00
Ksawlii
bbcbbc3b23 Revert "udf: Limit file size to 4TB"
This reverts commit db611d177b.
2024-11-24 00:23:46 +01:00
Ksawlii
e254363d4c Revert "ext4: handle redirtying in ext4_bio_write_page()"
This reverts commit 952c89ac51.
2024-11-24 00:23:46 +01:00
Ksawlii
4a63b68b74 Revert "NFSD: Refactor nfsd_reply_cache_free_locked()"
This reverts commit 06ca7ef647.
2024-11-24 00:23:45 +01:00
Ksawlii
7232cc0acc Revert "NFSD: Rename nfsd_reply_cache_alloc()"
This reverts commit bf9e2edffb.
2024-11-24 00:23:45 +01:00
Ksawlii
679a5499d6 Revert "NFSD: Replace nfsd_prune_bucket()"
This reverts commit 11242ff0bf.
2024-11-24 00:23:45 +01:00
Ksawlii
a77ba247a7 Revert "NFSD: Refactor the duplicate reply cache shrinker"
This reverts commit ddc87a28f9.
2024-11-24 00:23:45 +01:00
Ksawlii
370fd3e8ce Revert "NFSD: simplify error paths in nfsd_svc()"
This reverts commit 3890c7c53c.
2024-11-24 00:23:45 +01:00
Ksawlii
6d767ecd3e Revert "NFSD: Rewrite synopsis of nfsd_percpu_counters_init()"
This reverts commit b26ad58084.
2024-11-24 00:23:45 +01:00
Ksawlii
18f77282d9 Revert "NFSD: Fix frame size warning in svc_export_parse()"
This reverts commit 2f282ed1a9.
2024-11-24 00:23:45 +01:00
Ksawlii
ac304417cc Revert "nfsd: stop setting ->pg_stats for unused stats"
This reverts commit 1f1c36f524.
2024-11-24 00:23:44 +01:00
Ksawlii
181d28ae2b Revert "sunrpc: pass in the sv_stats struct through svc_create_pooled"
This reverts commit bdc4a7b40a.
2024-11-24 00:23:44 +01:00
Ksawlii
279ec1c17f Revert "sunrpc: remove ->pg_stats from svc_program"
This reverts commit 2f7108a6c4.
2024-11-24 00:23:44 +01:00
Ksawlii
06b45d7dd6 Revert "nfsd: rename NFSD_NET_* to NFSD_STATS_*"
This reverts commit 4004e4dc9d.
2024-11-24 00:23:44 +01:00
Ksawlii
7dd81aa9d2 Revert "nfsd: expose /proc/net/sunrpc/nfsd in net namespaces"
This reverts commit cc1ec49fa8.
2024-11-24 00:23:44 +01:00
Ksawlii
2a0e4e700f Revert "nfsd: make all of the nfsd stats per-network namespace"
This reverts commit 8e153e6f02.
2024-11-24 00:23:43 +01:00
Ksawlii
e7983f03a7 Revert "nfsd: remove nfsd_stats, make th_cnt a global counter"
This reverts commit 32028a262e.
2024-11-24 00:23:43 +01:00
Ksawlii
d494229215 Revert "nfsd: make svc_stat per-network namespace instead of global"
This reverts commit 886f600c8d.
2024-11-24 00:23:43 +01:00
Ksawlii
4bd71292a1 Revert "udf: Avoid excessive partition lengths"
This reverts commit 53de2c2b51.
2024-11-24 00:23:43 +01:00
Ksawlii
a82373ed36 Revert "btrfs: replace BUG_ON with ASSERT in walk_down_proc()"
This reverts commit 833703b1be.
2024-11-24 00:23:39 +01:00
Ksawlii
9dfd5971af Revert "btrfs: clean up our handling of refs == 0 in snapshot delete"
This reverts commit c6dfc73da3.
2024-11-24 00:23:39 +01:00
Ksawlii
1944f01920 Revert "btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry()"
This reverts commit ccb6b6363d.
2024-11-24 00:23:39 +01:00
Ksawlii
367c3c0607 Revert "Squashfs: sanity check symbolic link size"
This reverts commit 56685ee756.
2024-11-24 00:23:38 +01:00
Ksawlii
223197c81f Revert "NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations"
This reverts commit 3f033e95e7.
2024-11-24 00:23:38 +01:00
Ksawlii
2a04905087 Revert "nilfs2: replace snprintf in show functions with sysfs_emit"
This reverts commit bd580a7fd9.
2024-11-24 00:23:37 +01:00
Ksawlii
acfc7f60d9 Revert "nilfs2: protect references to superblock parameters exposed in sysfs"
This reverts commit 29b2aeb40d.
2024-11-24 00:23:37 +01:00
Ksawlii
495ede5554 Revert "btrfs: update target inode's ctime on unlink"
This reverts commit 0bc0b0b3e1.
2024-11-24 00:23:35 +01:00
Ksawlii
e4328eacde Revert "NFS: Avoid unnecessary rescanning of the per-server delegation list"
This reverts commit bf7d380b4c.
2024-11-24 00:23:35 +01:00
Ksawlii
ea2eef284d Revert "ocfs2: add bounds checking to ocfs2_xattr_find_entry()"
This reverts commit 9f8e960daa.
2024-11-24 00:23:33 +01:00
Ksawlii
288d6adf78 Revert "ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()"
This reverts commit e5a4f3990a.
2024-11-24 00:23:32 +01:00
Ksawlii
f45a13db54 Revert "fs: explicitly unregister per-superblock BDIs"
This reverts commit 716f0f8e49.
2024-11-24 00:23:31 +01:00
Ksawlii
fd797305e8 Revert "mount: warn only once about timestamp range expiration"
This reverts commit c9b4f8d73e.
2024-11-24 00:23:31 +01:00
Ksawlii
9ba56941a6 Revert "fs/namespace: fnic: Switch to use %ptTd"
This reverts commit 7c72670e6a.
2024-11-24 00:23:31 +01:00
Ksawlii
a9b3c9fff3 Revert "mount: handle OOM on mnt_warn_timestamp_expiry"
This reverts commit 3e27e86884.
2024-11-24 00:23:31 +01:00
Ksawlii
a83bba270c Revert "ext4: clear EXT4_GROUP_INFO_WAS_TRIMMED_BIT even mount with discard"
This reverts commit 2305ff5e44.
2024-11-24 00:23:23 +01:00
Ksawlii
84c804134c Revert "ext4: avoid buffer_head leak in ext4_mark_inode_used()"
This reverts commit 4e2ca3b317.
2024-11-24 00:23:23 +01:00
Ksawlii
1b82c86b6e Revert "ext4: avoid potential buffer_head leak in __ext4_new_inode()"
This reverts commit 919de34d5e.
2024-11-24 00:23:23 +01:00
Ksawlii
edcb108ec3 Revert "ext4: avoid negative min_clusters in find_group_orlov()"
This reverts commit aa2552d473.
2024-11-24 00:23:22 +01:00
Ksawlii
484646c44e Revert "ext4: return error on ext4_find_inline_entry"
This reverts commit 84e6545d45.
2024-11-24 00:23:22 +01:00
Ksawlii
c3584f20ca Revert "nilfs2: fix potential null-ptr-deref in nilfs_btree_insert()"
This reverts commit 8bb2d85f57.
2024-11-24 00:23:22 +01:00
Ksawlii
83721b0c9f Revert "nilfs2: determine empty node blocks as corrupted"
This reverts commit d436afe369.
2024-11-24 00:23:22 +01:00
Ksawlii
50c89bbfce Revert "nilfs2: fix potential oob read in nilfs_btree_check_delete()"
This reverts commit 4bb27977a9.
2024-11-24 00:23:22 +01:00
Ksawlii
1bde9f1a58 Revert "nfsd: remove unneeded EEXIST error check in nfsd_do_file_acquire"
This reverts commit 047ae79564.
2024-11-24 00:23:21 +01:00
Ksawlii
4e72477dc9 Revert "nfsd: fix refcount leak when file is unhashed after being found"
This reverts commit 5d70e0c71b.
2024-11-24 00:23:21 +01:00
Ksawlii
d9dfdb4f9a Revert "nfsd: call cache_put if xdr_reserve_space returns NULL"
This reverts commit 230230cbc0.
2024-11-24 00:23:20 +01:00
Ksawlii
916f5cf5c7 Revert "nfsd: return -EINVAL when namelen is 0"
This reverts commit a7d5a90335.
2024-11-24 00:23:20 +01:00
Ksawlii
ee72aa29e3 Revert "f2fs: fix to update i_ctime in __f2fs_setxattr()"
This reverts commit fc4e788a8f.
2024-11-24 00:23:20 +01:00
Ksawlii
ed27a80717 Revert "f2fs: remove unneeded check condition in __f2fs_setxattr()"
This reverts commit 7aff4e5b85.
2024-11-24 00:23:19 +01:00
Ksawlii
02b4e700f3 Revert "f2fs: prevent possible int overflow in dir_block_index()"
This reverts commit 67b4e793e4.
2024-11-24 00:23:15 +01:00
Ksawlii
9c15f09887 Revert "f2fs: avoid potential int overflow in sanity_check_area_boundary()"
This reverts commit 331eb7909d.
2024-11-24 00:23:15 +01:00
Ksawlii
075c794bc1 Revert "vfs: fix race between evice_inodes() and find_inode()&iput()"
This reverts commit 3b9c45c479.
2024-11-24 00:23:15 +01:00
Ksawlii
831814b413 Revert "fs: Fix file_set_fowner LSM hook inconsistencies"
This reverts commit 33a22518e4.
2024-11-24 00:23:15 +01:00
Ksawlii
40cd6892ab Revert "nfs: fix memory leak in error path of nfs4_do_reclaim"
This reverts commit 33d69e565e.
2024-11-24 00:23:15 +01:00
Ksawlii
ae928b45d6 Revert "ceph: remove the incorrect Fw reference check when dirtying pages"
This reverts commit 0c92def6af.
2024-11-24 00:23:13 +01:00
Ksawlii
96a727b0c0 Revert "f2fs: Require FMODE_WRITE for atomic write ioctls"
This reverts commit 3877a33618.
2024-11-24 00:23:11 +01:00
Ksawlii
8b17ca6430 Revert "proc: add config & param to block forcing mem writes"
This reverts commit 72291ae00f.
2024-11-24 00:23:07 +01:00
Ksawlii
3797787773 Revert "jfs: UBSAN: shift-out-of-bounds in dbFindBits"
This reverts commit 41aeda6a14.
2024-11-24 00:23:06 +01:00
Ksawlii
6fa39039f4 Revert "jfs: Fix uaf in dbFreeBits"
This reverts commit 6122749c1d.
2024-11-24 00:23:06 +01:00
Ksawlii
ee8a73fdde Revert "jfs: check if leafidx greater than num leaves per dmap tree"
This reverts commit 9fcdffe74e.
2024-11-24 00:23:06 +01:00
Ksawlii
7fdbc2acb2 Revert "jfs: Fix uninit-value access of new_ea in ea_buffer"
This reverts commit 2ff373f85e.
2024-11-24 00:23:06 +01:00
Ksawlii
ac0ea5a530 Revert "ext4: avoid use-after-free in ext4_ext_show_leaf()"
This reverts commit 2997f7a995.
2024-11-24 00:23:05 +01:00
Ksawlii
260c648056 Revert "ext4: fix i_data_sem unlock order in ext4_ind_migrate()"
This reverts commit fe7c357e85.
2024-11-24 00:23:05 +01:00
Ksawlii
8e669b0469 Revert "ext4: no need to continue when the number of entries is 1"
This reverts commit 3e2686893a.
2024-11-24 00:23:04 +01:00
Ksawlii
cf3b0a3d32 Revert "ext4: fix slab-use-after-free in ext4_split_extent_at()"
This reverts commit 36cf824440.
2024-11-24 00:23:04 +01:00
Ksawlii
9d13a5c8be Revert "ext4: propagate errors from ext4_find_extent() in ext4_insert_range()"
This reverts commit d833f09638.
2024-11-24 00:23:04 +01:00
Ksawlii
d97a370085 Revert "ext4: fix incorrect tid assumption in __jbd2_log_wait_for_space()"
This reverts commit 12dbad5099.
2024-11-24 00:23:04 +01:00
Ksawlii
c8162dd5e3 Revert "ext4: drop ppath from ext4_ext_replay_update_ex() to avoid double-free"
This reverts commit a92dad3741.
2024-11-24 00:23:04 +01:00
Ksawlii
93a6c5ff53 Revert "ext4: aovid use-after-free in ext4_ext_insert_extent()"
This reverts commit d6a31f504e.
2024-11-24 00:23:04 +01:00
Ksawlii
28ec6970cd Revert "ext4: fix double brelse() the buffer of the extents path"
This reverts commit 1751fc5974.
2024-11-24 00:23:03 +01:00
Ksawlii
2f34213701 Revert "ext4: update orig_path in ext4_find_extent()"
This reverts commit 39b44a0c92.
2024-11-24 00:23:03 +01:00
Ksawlii
3b0ddcb83c Revert "ext4: fix incorrect tid assumption in ext4_wait_for_tail_page_commit()"
This reverts commit 4af33d15cb.
2024-11-24 00:23:03 +01:00
Ksawlii
7229d80fef Revert "parisc: Fix stack start for ADDR_NO_RANDOMIZE personality"
This reverts commit 603d38c5da.
2024-11-24 00:23:03 +01:00
Ksawlii
f542f45344 Revert "jbd2: stop waiting for space when jbd2_cleanup_journal_tail() returns error"
This reverts commit 7477cade32.
2024-11-24 00:23:03 +01:00
Ksawlii
79fa380062 Revert "jbd2: correctly compare tids with tid_geq function in jbd2_fc_begin_commit"
This reverts commit b9329bdfe6.
2024-11-24 00:23:03 +01:00
Ksawlii
16ded01ec1 Revert "ocfs2: fix the la space leak when unmounting an ocfs2 volume"
This reverts commit 0ff194d066.
2024-11-24 00:23:03 +01:00
Ksawlii
2de4d41368 Revert "ocfs2: fix uninit-value in ocfs2_get_block()"
This reverts commit 33b11064c4.
2024-11-24 00:23:03 +01:00
Ksawlii
dfe3742af2 Revert "ocfs2: reserve space for inline xattr before attaching reflink tree"
This reverts commit 63e2db6c0b.
2024-11-24 00:23:03 +01:00
Ksawlii
c5c1ab676d Revert "ocfs2: cancel dqi_sync_work before freeing oinfo"
This reverts commit 687a6ab8c4.
2024-11-24 00:23:03 +01:00
Ksawlii
947732bc18 Revert "ocfs2: remove unreasonable unlock in ocfs2_read_blocks"
This reverts commit c656a23346.
2024-11-24 00:23:02 +01:00
Ksawlii
25c64d5629 Revert "ocfs2: fix null-ptr-deref when journal load failed."
This reverts commit e7014629c9.
2024-11-24 00:23:02 +01:00
Ksawlii
d751cc7fe8 Revert "ocfs2: fix possible null-ptr-deref in ocfs2_set_buffer_uptodate"
This reverts commit e721564d9c.
2024-11-24 00:23:02 +01:00
Ksawlii
5ef504acd1 Revert "exfat: fix memory leak in exfat_load_bitmap()"
This reverts commit defa602d2c.
2024-11-24 00:23:02 +01:00
Ksawlii
9378ee00ac Revert "nfsd: fix delegation_blocked() to block correctly for at least 30 seconds"
This reverts commit 2f271f8591.
2024-11-24 00:23:02 +01:00
Ksawlii
ab71c81dd8 Revert "nfsd: map the EBADMSG to nfserr_io to avoid warning"
This reverts commit 5b22601874.
2024-11-24 00:23:02 +01:00
Ksawlii
dc047d3806 Revert "NFSD: Fix NFSv4's PUTPUBFH operation"
This reverts commit 770d812d36.
2024-11-24 00:23:02 +01:00
Ksawlii
212baf41d2 Revert "btrfs: fix a NULL pointer dereference when failed to start a new trasacntion"
This reverts commit e03ae5b888.
2024-11-24 00:23:01 +01:00
Ksawlii
7628389383 Revert "btrfs: wait for fixup workers before stopping cleaner kthread during umount"
This reverts commit cfbf212995.
2024-11-24 00:23:01 +01:00
Ksawlii
8a062fad2b Revert "ext4: properly sync file size update after O_SYNC direct IO"
This reverts commit 8d891d670a.
2024-11-24 00:23:01 +01:00
Ksawlii
1c4245ba87 Revert "ext4: dax: fix overflowing extents beyond inode size when partially writing"
This reverts commit eb2d9a8577.
2024-11-24 00:23:00 +01:00
Ksawlii
8e8df408d7 Revert "ext4: fix inode tree inconsistency caused by ENOMEM"
This reverts commit 9a68c22120.
2024-11-24 00:23:00 +01:00
Ksawlii
a64018a67a Revert "unicode: Don't special case ignorable code points"
This reverts commit 52bec9283f.
2024-11-24 00:23:00 +01:00
Ksawlii
603407d8ff Revert "ext4: nested locking for xattr inode"
This reverts commit b9112f49aa.
2024-11-24 00:22:59 +01:00
Ksawlii
6407d85670 Revert "NFSD: Mark filecache "down" if init fails"
This reverts commit 504cb79c21.
2024-11-24 00:22:57 +01:00
Ksawlii
8d52581ad5 Revert "SUNRPC: Fix integer overflow in decode_rc_list()"
This reverts commit 8f25df6566.
2024-11-24 00:22:57 +01:00
Ksawlii
0381b2073a Revert "NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()"
This reverts commit 4bb48602f3.
2024-11-24 00:22:57 +01:00
Ksawlii
a7cd6c4b5a Revert "ext4: fix warning in ext4_dio_write_end_io()"
This reverts commit b4693ba24d.
2024-11-24 00:22:54 +01:00
Ksawlii
2baef39fde Revert "fat: fix uninitialized variable"
This reverts commit e739627286.
2024-11-24 00:22:53 +01:00