mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	kirill.shutemov@linux.intel.com,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [GIT PULL] x86/mm for 6.4
Date: Tue, 2 May 2023 17:53:33 -0700	[thread overview]
Message-ID: <f5983c42-82a5-1cd8-c717-67bfd72377dc@intel.com> (raw)
In-Reply-To: <CAHk-=wgN=GY2A0htYQQRmPaLCorWnFatY_XO0X2w_m9xXQDcPA@mail.gmail.com>

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.



  reply	other threads:[~2023-05-03  0:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 22:56 Dave Hansen
2023-04-28 17:23 ` pr-tracker-bot
2023-04-28 20:07 ` Linus Torvalds
2023-04-28 20:15   ` Linus Torvalds
2023-04-29  0:38     ` Kirill A. Shutemov
2023-04-29  1:04       ` Linus Torvalds
2023-05-02 15:42       ` Dave Hansen
2023-05-02 16:00         ` Linus Torvalds
2023-05-02 20:14           ` Linus Torvalds
2023-05-03  0:53             ` Dave Hansen [this message]
2023-05-03  1:17               ` Linus Torvalds
2023-05-03 16:38                 ` Linus Torvalds
2023-05-03 16:44                   ` Dave Hansen
2023-05-03 16:51                     ` Linus Torvalds
2023-05-03 17:54                   ` Linus Torvalds
2023-05-03 19:01                     ` Peter Zijlstra
2023-05-03 19:19                       ` Linus Torvalds
2023-05-05 19:56                       ` Linus Torvalds
2023-05-05 20:59                         ` Kirill A. Shutemov
2023-05-04  6:28                   ` Kirill A. Shutemov
2023-05-04 15:25                     ` Dave Hansen
2023-05-04 17:10                       ` Kirill A. Shutemov
2023-05-04 17:10                     ` Linus Torvalds
2023-05-03  8:01             ` Peter Zijlstra
2023-05-03 16:38               ` Linus Torvalds
2023-06-16  8:47   ` Alexander Potapenko
2023-06-16 16:22     ` Linus Torvalds
2023-06-19 12:03       ` Alexander Potapenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5983c42-82a5-1cd8-c717-67bfd72377dc@intel.com \
    --to=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®