[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1701192139490.5358@nanos>
Date: Thu, 19 Jan 2017 21:50:36 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: "Frank Ch. Eigler" <fche@...hat.com>
cc: David Smith <dsmith@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Lutomirski <luto@...capital.net>,
Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] x86: Verify access_ok() context
On Thu, 19 Jan 2017, Frank Ch. Eigler wrote:
> Hi, Thomas -
>
> On Thu, Jan 19, 2017 at 07:12:48PM +0100, Thomas Gleixner wrote:
> > [...]
> > It does matter very much, because the fact that the warning triggers tells
> > me that it's placed in code which is NOT executed in task context.
> > [...]
> > We are not papering over problems.
>
> Understood. We were interpreting the comments around access_ok to
> mean that the underlying hazard condition was different (stricter)
> than in_task(). If the warning could be made to match that hazard
> condition more precisely, then safe but non-in_task() callers can use
> access_ok() without the warning.
Well, if you are not in thread context then the check is pointless:
__range_not_ok(addr, size, user_addr_max())
and:
#define user_addr_max() (current->thread.addr_limit.seg)
So what guarantees when you are not in context of current, i.e. in thread
context, that the addr/size which is checked against the limits of current
actually belongs to current?
I assume this is about systemtap modules. Can you please explain what you
are trying to achieve? I guess you know that you actually access current,
but then we need a seperate special function and not relaxing of the
checks.
Thanks,
tglx
Powered by blists - more mailing lists