diff options
| author | Andrey Skvortsov <[email protected]> | 2024-09-23 16:48:43 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-09-26 21:01:44 +0000 |
| commit | 486fd58af7ac1098b68370b1d4d9f94a2a1c7124 (patch) | |
| tree | 19e6a9dcca1bca5f273732ccf89f81bd00b0fb86 /drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |
| parent | memory tiers: use default_dram_perf_ref_source in log message (diff) | |
| download | kernel-486fd58af7ac1098b68370b1d4d9f94a2a1c7124.tar.gz kernel-486fd58af7ac1098b68370b1d4d9f94a2a1c7124.zip | |
zram: don't free statically defined names
When CONFIG_ZRAM_MULTI_COMP isn't set ZRAM_SECONDARY_COMP can hold
default_compressor, because it's the same offset as ZRAM_PRIMARY_COMP, so
we need to make sure that we don't attempt to kfree() the statically
defined compressor name.
This is detected by KASAN.
==================================================================
Call trace:
kfree+0x60/0x3a0
zram_destroy_comps+0x98/0x198 [zram]
zram_reset_device+0x22c/0x4a8 [zram]
reset_store+0x1bc/0x2d8 [zram]
dev_attr_store+0x44/0x80
sysfs_kf_write+0xfc/0x188
kernfs_fop_write_iter+0x28c/0x428
vfs_write+0x4dc/0x9b8
ksys_write+0x100/0x1f8
__arm64_sys_write+0x74/0xb8
invoke_syscall+0xd8/0x260
el0_svc_common.constprop.0+0xb4/0x240
do_el0_svc+0x48/0x68
el0_svc+0x40/0xc8
el0t_64_sync_handler+0x120/0x130
el0t_64_sync+0x190/0x198
==================================================================
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 684826f8271a ("zram: free secondary algorithms names")
Signed-off-by: Andrey Skvortsov <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Reported-by: Venkat Rao Bagalkote <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Tested-by: Venkat Rao Bagalkote <[email protected]>
Cc: Christophe JAILLET <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Cc: Venkat Rao Bagalkote <[email protected]>
Cc: Chris Li <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c')
0 files changed, 0 insertions, 0 deletions
