Commit 80da026
mm/slub: fix slab double-free in case of duplicate sysfs filename
sysfs_slab_add() shouldn't call kobject_put at error path: this puts last
reference of kmem-cache kobject and frees it. Kmem cache will be freed
second time at error path in kmem_cache_create().
For example this happens when slub debug was enabled in runtime and
somebody creates new kmem cache:
# echo 1 | tee /sys/kernel/slab/*/sanity_checks
# modprobe configfs
"configfs_dir_cache" cannot be merged because existing slab have debug and
cannot create new slab because unique name ":t-0000096" already taken.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent 588f8ba commit 80da026
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5283 | 5283 | | |
5284 | 5284 | | |
5285 | 5285 | | |
5286 | | - | |
| 5286 | + | |
5287 | 5287 | | |
5288 | 5288 | | |
5289 | 5289 | | |
| |||
5310 | 5310 | | |
5311 | 5311 | | |
5312 | 5312 | | |
5313 | | - | |
5314 | | - | |
5315 | 5313 | | |
5316 | 5314 | | |
5317 | 5315 | | |
| |||
0 commit comments