From: Jiri Olsa <olsajiri@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
bpf@vger.kernel.org, linux-mm@kvack.org,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Lorenzo Stoakes <ljs@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Federico Di Pierro <nierro92@gmail.com>
Subject: Re: [PATCHv2 bpf-next 2/8] bpf: Add user memory kfuncs
Date: Tue, 3 Nov 2026 22:36:12 +0100 [thread overview]
Message-ID: <aupTzCetiTqmbOab@krava> (raw)
In-Reply-To: <DMLRWY2OAGS9.3KD9RKTC5MYPX@gmail.com>
On Tue, Nov 03, 2026 at 06:05:46PM +0000, Alexei Starovoitov wrote:
> On Mon, Nov 02, 2026 at 11:59 PM Jiri Olsa <jolsa@kernel.org> wrote:
> > +#ifdef CONFIG_IA32_EMULATION
> > +static unsigned long bpf_user_vm_mmap(unsigned long len, unsigned long prot)
> > +{
> > + struct thread_info *ti = current_thread_info();
> > + bool compat = test_thread_flag(TIF_ADDR32);
> > + unsigned long addr;
> > +
> > + /*
> > + * We are not in a syscall, but x86 get_unmapped_area() paths
> > + * ignore TIF_ADDR32 and rely on in_32bit_syscall().
> > + */
> > + if (compat)
> > + ti->status |= TS_COMPAT;
> > + addr = vm_mmap(NULL, 0, len, prot, MAP_PRIVATE | MAP_ANONYMOUS, 0);
> > + if (compat)
> > + ti->status &= ~TS_COMPAT;
>
> Do you have users with ia32 tasks ?
nope
> Without this code bpf_user_anon_mmap() returns -ENOMEM in an ia32 task.
> Nothing breaks.
>
> arch_uprobe_get_xol_area() calls it a HACK, and that one is in arch/x86.
> kernel/bpf/helpers.c has no arch #ifdef today. Let's keep it this way.
>
> Drop it and say in the comment that ia32 tasks are not supported.
> Pls don't add code just because a bot said so.
ok, will drop it
jirka
next prev parent reply other threads:[~2026-11-03 21:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 7:59 [PATCHv2 bpf-next 0/8] bpf: Add user memory kfuncs Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 1/8] bpf: Honor const on generic kfunc memory arguments Jiri Olsa
2026-11-03 8:52 ` bot+bpf-ci
2026-11-03 18:03 ` Alexei Starovoitov
2026-11-03 21:36 ` Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 2/8] bpf: Add user memory kfuncs Jiri Olsa
2026-11-03 8:19 ` sashiko-bot
2026-11-03 8:52 ` bot+bpf-ci
2026-11-03 18:05 ` Alexei Starovoitov
2026-11-03 21:36 ` Jiri Olsa [this message]
2026-11-03 7:59 ` [PATCHv2 bpf-next 3/8] selftests/bpf: Add get_procmap_info helper Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 4/8] selftests/bpf: Test const kfunc memory arguments Jiri Olsa
2026-11-03 8:10 ` sashiko-bot
2026-11-04 21:12 ` Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 5/8] selftests/bpf: Test user memory mmap kfuncs Jiri Olsa
2026-11-03 8:05 ` sashiko-bot
2026-11-04 21:09 ` Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 6/8] selftests/bpf: Test user memory page exec Jiri Olsa
2026-11-03 8:39 ` bot+bpf-ci
2026-11-04 21:12 ` Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 7/8] selftests/bpf: Test bpf_copy_to_user kfunc Jiri Olsa
2026-11-03 7:59 ` [PATCHv2 bpf-next 8/8] selftests/bpf: Test user memory kfunc errors Jiri Olsa
2026-11-03 8:39 ` bot+bpf-ci
2026-11-04 21:38 ` Jiri Olsa
2026-11-03 18:08 ` [PATCHv2 bpf-next 0/8] bpf: Add user memory kfuncs Alexei Starovoitov
2026-11-03 21:36 ` Jiri Olsa
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=aupTzCetiTqmbOab@krava \
--to=olsajiri@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=memxor@gmail.com \
--cc=nierro92@gmail.com \
/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