mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andy Lutomirski" <luto@kernel.org>
To: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
	"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
	bpf@vger.kernel.org
Cc: "Puranjay Mohan" <puranjay@kernel.org>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Emil Tsalapatis" <emil@etsalapatis.com>,
	"Ihor Solodrai" <ihor.solodrai@linux.dev>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	kkd@meta.com, kernel-team@meta.com,
	"the arch/x86 maintainers" <x86@kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next v1 1/3] x86/mm: Resolve BPF exception fixups for user address faults under SMAP
Date: Mon, 30 Nov 2026 17:49:06 -0800	[thread overview]
Message-ID: <1ba7d551-32e1-4020-b898-502cd9ab8fb7@app.fastmail.com> (raw)
In-Reply-To: <DN6GXEDDDMGG.16VXQP61BMM2P@gmail.com>



On Fri, Nov 27, 2026, at 5:55 PM, Alexei Starovoitov wrote:
> On Sat Nov 28, 2026 at 1:48 AM UTC, Kumar Kartikeya Dwivedi wrote:
>> On Fri Nov 27, 2026 at 1:18 AM CET, Alexei Starovoitov wrote:
>>> On Thu, Nov 26, 2026 at 09:30 AM Andy Lutomirski <luto@kernel.org> wrote:
>>>> Okay.  So maybe there should be a nice patch set to *fix* it.
>>>
>>> [[...]
>>>
>>> The main point that it's orgonal to this patchset.
>>>
>>
>> I was wondering whether one concrete improvement could be to emit BTF type tags
>> for __iomem annotations in the kernel, then reject accesses on BTF pointers
>> formed using such walks in the verifier, so such programs would fail to load.
>>
>> I think in practice, at least for BPF users, this will close the issue.
>
> That's a great idea. Much better than Andy's 1-3 options.

Alexei, I've genuinely tried to engage with this patchset in good faith.

If you believe that the BPF verifier can statically verify that a BPF program doing a PROBE_MEM access is referencing a valid (or maybe only mildly stale) kernel address, then I encourage you and Kumar to drop all of the x86 patches you keep sending, remove all the code that BPF emits to avoid tripping over SMAP, and be completely confident that the kernel will never OOPS or otherwise malfunction as a result.

If you don't believe that, for example if you think a program might do x = a->b->c where the *a cannot be proven to still be alive and intact at the time that a->b is read, then I don't think that __iomem will save you, and maybe you should not believe anything in the previous paragraph, and maybe you should rethink this.

--Andy

  reply	other threads:[~2026-12-01  1:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  2:49 [PATCH bpf-next v1 0/3] bpf, x86: Drop the PROBE_MEM address range check " Kumar Kartikeya Dwivedi
2026-10-09  2:49 ` [PATCH bpf-next v1 1/3] x86/mm: Resolve BPF exception fixups for user address faults " Kumar Kartikeya Dwivedi
2026-10-09  4:13   ` Borislav Petkov
2026-10-09 15:23     ` Kumar Kartikeya Dwivedi
2026-11-22 20:08       ` Borislav Petkov
2026-11-22 21:59         ` Kumar Kartikeya Dwivedi
2026-11-23  0:30           ` Borislav Petkov
2026-11-23  0:59             ` Kumar Kartikeya Dwivedi
2026-11-23  2:55               ` Borislav Petkov
2026-11-23  3:56                 ` Kumar Kartikeya Dwivedi
2026-11-23  4:34                   ` Borislav Petkov
2026-11-23  6:58                   ` Alexei Starovoitov
2026-11-23 17:27                     ` Kumar Kartikeya Dwivedi
2026-11-23 18:51                     ` Borislav Petkov
2026-11-24  6:25                       ` Alexei Starovoitov
2026-11-25  2:17                         ` Borislav Petkov
2026-11-25  3:27                           ` Alexei Starovoitov
2026-11-23 15:36       ` Dave Hansen
2026-11-23 17:23         ` Kumar Kartikeya Dwivedi
2026-11-24 15:25           ` Dave Hansen
2026-11-24 20:17             ` Alexei Starovoitov
2026-11-25  4:22   ` Andy Lutomirski
2026-11-25  6:45     ` Alexei Starovoitov
2026-11-26  5:38       ` Andy Lutomirski
2026-11-26  6:18         ` Alexei Starovoitov
2026-11-26 17:30           ` Andy Lutomirski
2026-11-27  0:18             ` Alexei Starovoitov
2026-11-27 17:51               ` Andy Lutomirski
2026-11-28  1:48               ` Kumar Kartikeya Dwivedi
2026-11-28  1:55                 ` Alexei Starovoitov
2026-12-01  1:49                   ` Andy Lutomirski [this message]
2026-12-01  2:06                     ` Kumar Kartikeya Dwivedi
2026-10-09  2:49 ` [PATCH bpf-next v1 2/3] bpf, x86: Skip the PROBE_MEM address range check " Kumar Kartikeya Dwivedi
2026-10-09  3:42   ` bot+bpf-ci
2026-10-09  2:49 ` [PATCH bpf-next v1 3/3] selftests/bpf: Test PROBE_MEM loads from invalid addresses Kumar Kartikeya Dwivedi

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=1ba7d551-32e1-4020-b898-502cd9ab8fb7@app.fastmail.com \
    --to=luto@kernel.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=puranjay@kernel.org \
    --cc=tglx@kernel.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®