linux/lib
Maninder Singh 30cee1e486 lib/list_debug.c: add object information in case of invalid object
As of now during link list corruption it prints about cluprit address and
its wrong value, but sometime it is not enough to catch the actual issue
point.

If it prints allocation and free path of that corrupted node, it will be a
lot easier to find and fix the issues.

Adding the same information when data mismatch is found in link list
debug data:

[   14.243055]  slab kmalloc-32 start ffff0000cda19320 data offset 32 pointer offset 8 size 32 allocated at add_to_list+0x28/0xb0
[   14.245259]     __kmalloc_cache_noprof+0x1c4/0x358
[   14.245572]     add_to_list+0x28/0xb0
...
[   14.248632]     do_el0_svc_compat+0x1c/0x34
[   14.249018]     el0_svc_compat+0x2c/0x80
[   14.249244]  Free path:
[   14.249410]     kfree+0x24c/0x2f0
[   14.249724]     do_force_corruption+0xbc/0x100
...
[   14.252266]     el0_svc_common.constprop.0+0x40/0xe0
[   14.252540]     do_el0_svc_compat+0x1c/0x34
[   14.252763]     el0_svc_compat+0x2c/0x80
[   14.253071] ------------[ cut here ]------------
[   14.253303] list_del corruption. next->prev should be ffff0000cda192a8, but was 6b6b6b6b6b6b6b6b. (next=ffff0000cda19348)
[   14.254255] WARNING: CPU: 3 PID: 84 at lib/list_debug.c:65 __list_del_entry_valid_or_report+0x158/0x164

Moved prototype of mem_dump_obj() to bug.h, as mm.h can not be included in
bug.h.

Link: https://lkml.kernel.org/r/20241230101043.53773-1-maninder1.s@samsung.com
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Acked-by: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Marco Elver <elver@google.com>
Cc: Rohit Thapliyal <r.thapliyal@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-25 20:22:23 -08:00
..
842
crypto This update includes the following changes: 2024-11-19 10:28:41 -08:00
dim dim: pass dim_sample to net_dim() by reference 2024-11-03 12:36:54 -08:00
fonts
kunit module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
lz4
lzo
math lib/math/test_div64: add some edge cases relevant to __div64_const32() 2024-10-28 21:44:28 +00:00
pldmfw
raid6
reed_solomon
test_fortify
tests selftests: kallsyms: fix and clarify current test boundaries 2024-11-28 11:17:30 -08:00
vdso
xz
zlib_deflate
zlib_dfltcc
zlib_inflate
zstd
.gitignore
Kconfig - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
Kconfig.debug selftests: kallsyms: fix and clarify current test boundaries 2024-11-28 11:17:30 -08:00
Kconfig.kasan kasan: delete CONFIG_KASAN_MODULE_TEST 2024-11-11 00:26:44 -08:00
Kconfig.kcsan
Kconfig.kfence
Kconfig.kgdb
Kconfig.kmsan
Kconfig.ubsan
Makefile Modules changes for v6.13-rc1 2024-11-27 10:20:50 -08:00
alloc_tag.c alloc_tag: fix module allocation tags populated area calculation 2024-12-18 19:04:46 -08:00
argv_split.c
ashldi3.c
ashrdi3.c
asn1_decoder.c
asn1_encoder.c
assoc_array.c
atomic64.c
atomic64_test.c
audit.c
base64.c
bcd.c
bch.c
bitfield_kunit.c
bitmap-str.c
bitmap.c
bitrev.c
bootconfig-data.S
bootconfig.c
bsearch.c
btree.c
bucket_locks.c
bug.c
build_OID_registry
buildid.c lib/buildid: Handle memfd_secret() files in build_id_parse() 2024-10-17 21:30:32 +02:00
bust_spinlocks.c
check_signature.c
checksum.c net: checksum: Move from32to16() to generic header 2024-10-30 15:29:59 +01:00
checksum_kunit.c
closure.c
clz_ctz.c
clz_tab.c
cmdline.c
cmdline_kunit.c
cmpdi2.c
cmpxchg-emu.c
codetag.c alloc_tag: support for page allocation tag compression 2024-11-07 14:25:16 -08:00
compat_audit.c
cpu_rmap.c
cpumask.c
cpumask_kunit.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc4.c
crc7.c
crc8.c
crc16.c
crc16_kunit.c lib/crc16_kunit.c: add KUnit tests for crc16 2024-11-05 17:12:31 -08:00
crc32.c crypto: crc32c - Provide crc32c-arch driver for accelerated library code 2024-10-28 18:33:10 +08:00
crc32defs.h
crc32test.c
crc64-rocksoft.c
crc64.c
ctype.c
debug_info.c
debug_locks.c
debugobjects.c debugobjects: Track object usage to avoid premature freeing of objects 2024-10-15 17:30:33 +02:00
dec_and_lock.c
decompress.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlz4.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c
decompress_unzstd.c
devmem_is_allowed.c
devres.c lib: devres: Simplify API devm_ioport_unmap() implementation 2024-10-14 08:21:09 +02:00
dhry.h
dhry_1.c
dhry_2.c
dhry_run.c
digsig.c
dump_stack.c
dynamic_debug.c
dynamic_queue_limits.c dql: annotate data-races around dql->last_obj_cnt 2024-10-31 19:19:36 -07:00
earlycpio.c
errname.c
error-inject.c
errseq.c
extable.c
fault-inject-usercopy.c
fault-inject.c
fdt.c
fdt_addresses.c
fdt_empty_tree.c
fdt_ro.c
fdt_rw.c
fdt_strerror.c
fdt_sw.c
fdt_wip.c
find_bit.c
find_bit_benchmark.c
flex_proportions.c
fortify_kunit.c
fw_table.c
gen_crc32table.c
gen_crc64table.c
genalloc.c
generic-radix-tree.c
glob.c
globtest.c
group_cpus.c
hashtable_test.c
hexdump.c
hweight.c
idr.c
inflate.c
interval_tree.c
interval_tree_test.c
iomap.c
iomap_copy.c
iomem_copy.c lib/iomem_copy: fix kerneldoc format style 2024-10-29 07:14:29 +00:00
iommu-helper.c
iov_iter.c for-6.13/block-20241118 2024-11-18 16:50:08 -08:00
irq_poll.c
irq_regs.c
is_signed_type_kunit.c
is_single_threaded.c
kasprintf.c
kfifo.c
klist.c
kobject.c
kobject_uevent.c
kstrtox.c
kstrtox.h
kunit_iov_iter.c
libcrc32c.c
linear_ranges.c
list-test.c list: test: check the size of every lists for list_cut_position*() 2024-11-05 17:12:30 -08:00
list_debug.c lib/list_debug.c: add object information in case of invalid object 2025-01-25 20:22:23 -08:00
list_sort.c lib/list_sort: remove unnecessary header includes 2024-11-05 17:12:33 -08:00
llist.c
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-rtmutex.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c locking/ww_mutex: Fix ww_mutex dummy lockdep map selftest warnings 2024-12-02 12:16:57 +01:00
lockref.c
logic_iomem.c
logic_pio.c logic_pio: Constify fwnode_handle 2024-10-14 16:33:24 -05:00
lru_cache.c
lshrdi3.c
lwq.c
maple_tree.c maple_tree: only root node could be deficient 2025-01-13 22:40:41 -08:00
memcat_p.c
memcpy_kunit.c
memory-notifier-error-inject.c
memregion.c
memweight.c
min_heap.c lib/min_heap: introduce non-inline versions of min heap API functions 2024-11-05 17:12:34 -08:00
muldi3.c
net_utils.c
netdev-notifier-error-inject.c
nlattr.c
nmi_backtrace.c
notifier-error-inject.c
notifier-error-inject.h
objagg.c
objpool.c objpool: fix to make percpu slot allocation more robust 2024-11-07 14:14:58 -08:00
of-reconfig-notifier-error-inject.c
oid_registry.c
once.c
overflow_kunit.c Compiler Attributes: disable __counted_by for clang < 19.1.3 2024-11-19 08:48:27 -08:00
packing.c lib: packing: use GENMASK() for box_mask 2024-10-03 15:32:04 -07:00
packing_test.c lib: packing: catch kunit_kzalloc() failure in the pack() test 2024-10-07 16:36:25 -07:00
parman.c
parser.c
percpu-refcount.c
percpu_counter.c
percpu_test.c percpu: add a test case for the specific 64-bit value addition 2024-11-06 20:11:14 -08:00
plist.c
pm-notifier-error-inject.c
polynomial.c
radix-tree.c
radix-tree.h
random32.c Random number generator updates for Linux 6.13-rc1. 2024-11-19 10:43:44 -08:00
ratelimit.c
rbtree.c
rbtree_test.c
rcuref.c
ref_tracker.c
refcount.c
rhashtable.c
sbitmap.c
scatterlist.c lib/scatterlist: use sg_phys() helper 2024-11-05 17:12:40 -08:00
seq_buf.c
sg_pool.c
sg_split.c
siphash.c
siphash_kunit.c
slub_kunit.c mm/slub, kunit: Add testcase for krealloc redzone and zeroing 2024-11-16 21:19:39 +01:00
smp_processor_id.c
sort.c
stackdepot.c stackdepot: fix stack_depot_save_flags() in NMI context 2024-12-05 19:54:45 -08:00
stackinit_kunit.c lib: stackinit: hide never-taken branch from compiler 2024-12-05 19:54:47 -08:00
stmp_device.c
string.c strscpy: write destination buffer only once 2024-12-01 12:17:16 -08:00
string_helpers.c lib: string_helpers: silence snprintf() output truncation warning 2024-11-02 13:08:55 -07:00
string_helpers_kunit.c
string_kunit.c
strncpy_from_user.c kasan: move checks to do_strncpy_from_user 2024-11-11 00:26:43 -08:00
strnlen_user.c
syscall.c
test-kstrtox.c
test_bitmap.c
test_bitops.c
test_bits.c
test_blackhole_dev.c
test_bpf.c
test_debug_virtual.c
test_dynamic_debug.c
test_firmware.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
test_fprobe.c
test_fpu.h
test_fpu_glue.c
test_fpu_impl.c
test_free_pages.c
test_hash.c
test_hexdump.c
test_hmm.c
test_hmm_uapi.h
test_ida.c
test_kmod.c
test_kprobes.c
test_linear_ranges.c
test_list_sort.c
test_lockup.c
test_maple_tree.c test_maple_tree: test exhausted upper limit of mtree_alloc_cyclic() 2025-01-25 20:22:19 -08:00
test_memcat_p.c
test_meminit.c
test_min_heap.c lib/test_min_heap: update min_heap_callbacks to use default builtin swap 2024-11-05 17:12:35 -08:00
test_module.c
test_objagg.c
test_objpool.c
test_parman.c
test_printf.c printf: Add print format (%pra) for struct range 2024-10-28 14:32:43 -07:00
test_ref_tracker.c
test_rhashtable.c
test_scanf.c
test_sort.c
test_static_key_base.c
test_static_keys.c
test_sysctl.c
test_ubsan.c
test_uuid.c
test_vmalloc.c
test_xarray.c
textsearch.c
timerqueue.c
trace_readwrite.c
ts_bm.c
ts_fsm.c
ts_kmp.c
ubsan.c
ubsan.h
ucmpdi2.c
ucs2_string.c
union_find.c
usercopy.c
usercopy_kunit.c
util_macros_kunit.c lib: util_macros_kunit: add kunit test for util_macros.h 2024-11-11 17:17:05 -08:00
uuid.c
vsprintf.c printf: Remove unused 'bprintf' 2024-11-30 22:41:35 -05:00
win_minmax.c
xarray.c
xxhash.c