mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
ext4: avoid ptr null pointer dereference
When commit13df4d44a3("ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists()") was backported to stable, the commitf536808adc("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:b829687ae1("ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists()") Signed-off-by: Baokun Li <libaokun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d4b66460b1
commit
7fe6e3132d
@@ -473,6 +473,8 @@ static ssize_t ext4_attr_store(struct kobject *kobj,
|
||||
*((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;
|
||||
|
||||
Reference in New Issue
Block a user