lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: WARNING: ODEBUG bug in get_signal
On 08/27, syzbot wrote:
>
> __debug_check_no_obj_freed lib/debugobjects.c:967 [inline]
> debug_check_no_obj_freed+0x301/0x41c lib/debugobjects.c:998
> kmem_cache_free.part.0+0x16d/0x1f0 mm/slab.c:3692
> task_work_run+0xdd/0x190 kernel/task_work.c:141

I don't understand this trace, work->func(work) can call kmem_cache_free()
but task_work_run() doesn't do this.

In theory the patch below makes sense anyway, but I have no idea if it can
explain the problem.

Oleg.

--- x/kernel/task_work.c
+++ x/kernel/task_work.c
@@ -137,7 +137,7 @@ void task_work_run(void)
raw_spin_unlock_irq(&task->pi_lock);

do {
- next = work->next;
+ next = READ_ONCE(work->next);
work->func(work);
work = next;
cond_resched();
\
 
 \ /
  Last update: 2020-08-27 17:20    [W:0.044 / U:1.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site