From: Jiri Olsa <olsajiri@gmail.com>
To: bot+bpf-ci@kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org,
linux-mm@kvack.org, andrii@kernel.org, eddyz87@gmail.com,
memxor@gmail.com, ljs@kernel.org, john.fastabend@gmail.com,
nierro92@gmail.com, martin.lau@kernel.org,
yonghong.song@linux.dev, mason@kernel.org,
ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next 2/8] bpf: Add user memory kfuncs
Date: Fri, 30 Oct 2026 14:07:35 +0100 [thread overview]
Message-ID: <auSWl0wLpYO8RjHz@krava> (raw)
In-Reply-To: <571f32a410a85199bc9bcecfe07a9a9b6ef425b2052643e64031dd246c13691e@mail.kernel.org>
On Thu, Oct 29, 2026 at 10:12:12PM +0000, bot+bpf-ci@kernel.org wrote:
SNIP
> arch_validate_prot() in arch/powerpc/include/asm/mman.h rejects:
>
> - any bit outside PROT_READ|PROT_WRITE|PROT_EXEC|PROT_SEM|PROT_SAO
> - PROT_SAO when !cpu_has_feature(CPU_FTR_SAO), for example on Power10
> - PROT_SAO in a guest without CONFIG_PPC_PROT_SAO_LPAR
>
> vm_mmap() -> vm_mmap_pgoff() -> do_mmap() never calls arch_validate_prot().
> Instead do_mmap() -> calc_vm_prot_bits() -> arch_calc_vm_prot_bits() sets
> VM_SAO for PROT_SAO without any check, and vm_get_page_prot() then adds
> _PAGE_SAO to the page table entries.
>
> So a program can create strong-access-ordering mappings that the architecture
> code deliberately refuses. The Kconfig help for PPC_PROT_SAO_LPAR warns that
> using them may cause issues when migrating a guest from a host that supports
> strong access ordering to one that does not.
>
> Would it make sense to validate prot with arch_validate_prot(), or to
> restrict it to PROT_READ|PROT_WRITE|PROT_EXEC?
arch_validate_prot seems ok to me
jirka
next prev parent reply other threads:[~2026-10-30 13:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 21:25 [PATCH bpf-next 0/8] bpf: Add user memory kfuncs Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 1/8] bpf: Add __srcptr kfunc argument suffix Jiri Olsa
2026-10-29 21:49 ` Andrii Nakryiko
2026-10-30 10:50 ` Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 2/8] bpf: Add user memory kfuncs Jiri Olsa
2026-10-29 22:00 ` Andrii Nakryiko
2026-10-30 11:08 ` Jiri Olsa
2026-10-29 22:12 ` bot+bpf-ci
2026-10-30 13:07 ` Jiri Olsa [this message]
2026-10-30 13:08 ` Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 3/8] selftests/bpf: Add get_procmap_info helper Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 4/8] selftests/bpf: Test __srcptr kfunc arguments Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 5/8] selftests/bpf: Test user memory mmap kfuncs Jiri Olsa
2026-10-29 21:59 ` bot+bpf-ci
2026-10-30 13:08 ` Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 6/8] selftests/bpf: Test user memory page exec Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 7/8] selftests/bpf: Test bpf_copy_to_user kfunc Jiri Olsa
2026-10-29 21:25 ` [PATCH bpf-next 8/8] selftests/bpf: Test user memory kfunc errors Jiri Olsa
2026-10-29 21:59 ` bot+bpf-ci
2026-10-30 13:08 ` 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=auSWl0wLpYO8RjHz@krava \
--to=olsajiri@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=martin.lau@kernel.org \
--cc=mason@kernel.org \
--cc=memxor@gmail.com \
--cc=nierro92@gmail.com \
--cc=yonghong.song@linux.dev \
/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