[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f5983c42-82a5-1cd8-c717-67bfd72377dc@intel.com>
Date: Tue, 2 May 2023 17:53:33 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill@...temov.name>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, kirill.shutemov@...ux.intel.com,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [GIT PULL] x86/mm for 6.4
On 5/2/23 13:14, Linus Torvalds wrote:
> No, the problem is that probably *because* "access_ok()" has that
> warning, not all users use "access_ok()" at all. We have places that
> use "__access_ok()" instead. Like copy_from_nmi().
>
> So now copy_from_nmi() doesn't do the untagging, so if you were to use
> tagged pointers for the stack, you'd not get stack traces.
>
> End result: I think that
>
> (a) that WARN_ON_IN_IRQ() is actively detrimental and causes problems
>
> (b) the current "use untagged_addr() in access_ok()" model is also broken
Ugh, yes.
The fallout seems limited to (probably) perf and tracing poking at user
stack frames. But, yes, it definitely looks broken there.
While I bet we could shoehorn the existing tlbstate checks into the
__access_ok() sites, I also vastly prefer the high bit checks in
access_ok() instead. The less state we have to consult, the better.
Once the WARN_ON_IN_IRQ() is gone, it seems like it's just a matter of
collapsing __access_ok() into access_ok() and converting the (~3) callers.
Powered by blists - more mailing lists