From: Baokun Li <libaokun1@xxxxxxxxxx> When commit 13df4d44a3aa ("ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists()") was backported to stable, the commit f536808adcc3 ("ext4: refactor out ext4_generic_attr_store()") that uniformly determines if the ptr is null is not merged in, so it needs to be judged whether ptr is null or not in each case of the switch, otherwise null pointer dereferencing may occur. Fixes: b829687ae122 ("ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists()") Signed-off-by: Baokun Li <libaokun1@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/sysfs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/ext4/sysfs.c +++ b/fs/ext4/sysfs.c @@ -473,6 +473,8 @@ static ssize_t ext4_attr_store(struct ko *((unsigned int *) ptr) = t; return len; case attr_clusters_in_group: + if (!ptr) + return 0; ret = kstrtouint(skip_spaces(buf), 0, &t); if (ret) return ret; Patches currently in stable-queue which might be from libaokun@xxxxxxxxxxxxxxx are queue-6.9/cachefiles-propagate-errors-from-vfs_getxattr-to-avo.patch queue-6.9/cachefiles-cancel-all-requests-for-the-object-that-i.patch queue-6.9/cachefiles-add-missing-lock-protection-when-polling.patch queue-6.9/cachefiles-cyclic-allocation-of-msg_id-to-avoid-reus.patch queue-6.9/cachefiles-stop-sending-new-request-when-dropping-ob.patch queue-6.9/ext4-avoid-ptr-null-pointer-dereference.patch queue-6.9/cachefiles-wait-for-ondemand_object_worker-to-finish.patch