Commit adef2ae
slab: don't put freepointer outside of object if only orig_size
The commit 946fa0d ("mm/slub: extend redzone check to extra
allocated kmalloc space than requested") will extend right redzone
when allocating for orig_size < object_size. So we can't overlay the
freepointer in the object space in this case.
But the code looks like it forgot to check SLAB_RED_ZONE, since there
won't be extended right redzone if only orig_size enabled.
As we are here, make this complex conditional expressions a little
prettier and add some comments about extending right redzone when
slub_debug_orig_size() enabled.
Reviewed-by: Feng Tang <feng.tang@intel.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent 47d911b commit adef2ae
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5167 | 5167 | | |
5168 | 5168 | | |
5169 | 5169 | | |
5170 | | - | |
5171 | | - | |
5172 | | - | |
5173 | | - | |
| 5170 | + | |
| 5171 | + | |
| 5172 | + | |
5174 | 5173 | | |
5175 | 5174 | | |
5176 | 5175 | | |
5177 | 5176 | | |
5178 | 5177 | | |
5179 | 5178 | | |
5180 | 5179 | | |
5181 | | - | |
| 5180 | + | |
| 5181 | + | |
| 5182 | + | |
5182 | 5183 | | |
5183 | 5184 | | |
5184 | 5185 | | |
| |||
0 commit comments