lkml.org 
[lkml]   [2019]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [uaccess] 780464aed0: WARNING:at_arch/x86/include/asm/uaccess.h:#strnlen_user/0x
On Tue, Mar 05, 2019 at 10:58:01PM +0900, Masami Hiramatsu wrote:

> Could you tell me why WARN_ON_ONCE(!in_task()) is needed in access_ok()?

That came from here:

lkml.kernel.org/r/20190225145240.GB32534@hirez.programming.kicks-ass.net

Because in-irq usage is dodgy, since we don't actually know what mm or
ds it loaded.

> > I dislike that whole KERNEL_DS thing, but obviously that's not something
> > that's going away.
> >
> > Would something like:
> >
> > WARN_ON_ONCE(!(in_task || segment_eq(get_fs(), USER_DS)))
> >
> > Work? Then we allow KERNEL_DS in task context, but for interrupt and
> > others require USER_DS.
>
> But what would this mean? I can't understand why we limit using
> access_ok() so strictly and narrow the cases.

Because it's been a source of bugs. Any sanity checking we can put in
seems like a good thing at this point.

\
 
 \ /
  Last update: 2019-03-05 15:54    [W:0.084 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site