diff options
| author | Longlong Xia <xialonglong@kylinos.cn> | 2026-08-26 09:55:06 +0800 |
|---|---|---|
| committer | Vlastimil Babka (SUSE) <vbabka@kernel.org> | 2026-09-02 16:04:16 +0200 |
| commit | 208854282dab2100a33c5eb8859407b5d36b7723 (patch) | |
| tree | 4378d9d33067ef588316444fac720004da1876e1 /tools/lib/python/kdoc/parse_data_structs.py | |
| parent | 874d785e89a6925a08a59c65a93526d7a8c91403 (diff) | |
| download | linux-next-208854282dab2100a33c5eb8859407b5d36b7723.tar.gz linux-next-208854282dab2100a33c5eb8859407b5d36b7723.zip | |
mm/slab_common: reject zero object_size before calculate_alignment
calculate_alignment() with SLAB_HWCACHE_ALIGN halves ralign in a
while (size <= ralign / 2) loop. When size is 0, ralign eventually
reaches 0 and the condition stays true indefinitely, hanging the
kernel.
kmem_cache_sanity_check() rejected size > KMALLOC_MAX_SIZE but not
size == 0. Add !size to the check so a 0-size kmem_cache_create() is
caught on CONFIG_DEBUG_VM builds, where it can be diagnosed when it
surfaces.
Suggested-by: Hao Li <hao.li@linux.dev>
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
Reviewed-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Harry Yoo (Meta) <harry@kernel.org>
Link: https://patch.msgid.link/20260826015506.3178758-1-xialonglong2025@163.com
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/parse_data_structs.py')
0 files changed, 0 insertions, 0 deletions
