Skip to content

Instantly share code, notes, and snippets.

@srikanth007m
srikanth007m / double free in release_user_cpus_ptr
Created October 27, 2022 11:01
32bit tasks which is being freed p->user_cpus_ptr which has been freed.
Dmesg log Call stack: object(user_mask) has been freed which in slab’s page->freelist. Sourcecode: user_mask has been freed.And user_mask is got from p->user_cpus_ptr
[71053.256528][ T535] ------------[ cut here ]------------
[71053.256537][ T535] kernel BUG at mm/slub.c:363!
[71053.261534][ T535] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[71053.268068][ T535] Skip md ftrace buffer dump for: 0xa00f50
[71053.834135][ T535] CPU: 5 PID: 535 Comm: default_npth_th Tainted: G S W OE 5.15.41 #1
[71053.843167][ T535] Hardware name: Qualcomm Technologies, Inc. 8550 socrates (DT)
[71053.850855][ T535] pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
@srikanth007m
srikanth007m / Compilation_2
Created January 27, 2023 05:24
Memleak eBPF compilation issue
python3 memleak.py
/virtual/main.c:217:1: warning: declaration of 'struct tracepoint__kmem__kmalloc' will not be visible outside of this function [-Wvisibility]
TRACEPOINT_PROBE(kmem, kmalloc) {
^
/virtual/include/bcc/helpers.h:874:46: note: expanded from macro 'TRACEPOINT_PROBE'
int tracepoint__##category##__##event(struct tracepoint__##category##__##event *args)
^
<scratch space>:63:1: note: expanded from here
tracepoint__kmem__kmalloc
^