lkml.org 
[lkml]   [2013]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] print_worker_info: Handle pointer with more care
Hello,

On Fri, Aug 16, 2013 at 06:38:58PM +0200, Richard Weinberger wrote:
> > cc'ing uml people. Hey, guys, workqueue uses proble_kernel_read() to
> > print out workqueue related information during oops because those
> > events are completely asynchronous and workqueue states may not be
> > consistently accessible. It seems like uml doesn't implement
> > probe_kernel_read() and tries direct derference of incorrect pointers
> > leading to its own oops. Maybe uml should check whether the memory is
> > mapped from probe_kernel_read()?
>
> You are already talking to UML people. ;)

Ooh... :)

> Anyway, I'll investigate into that.
> What I see so far is that pwq is NULL after probe_kernel_read().

Yeah, and that should be fine. &pwq->wq would be just an offset of wq
from NULL which is an invalid pointer but probe_kernel_read() should
be able to handle that and probably just return 0 or -1 (all bits
set). I *think* what's necessary is making probe_kernel_read() use
mincore() to fine out whether the requested address is mapped (it
should return -EFAULT if not) and try to dereference the address iff
it's mapped.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-08-16 19:01    [W:0.037 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site