mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf v2 0/2] Reject writable map iterators on read-only maps
@ 2026-11-12 15:54 Adethya Srinivasan
  2026-11-12 15:54 ` [PATCH bpf v2 1/2] bpf: " Adethya Srinivasan
  2026-11-12 15:54 ` [PATCH bpf v2 2/2] selftests/bpf: Check writable iterator attach to a read-only array Adethya Srinivasan
  0 siblings, 2 replies; 3+ messages in thread
From: Adethya Srinivasan @ 2026-11-12 15:54 UTC (permalink / raw)
  To: bpf
  Cc: Adethya Srinivasan, yonghong.song, ast, daniel, andrii, eddyz87,
	memxor, martin.lau, song, jolsa, emil, ihor.solodrai, shuah,
	linux-kernel, linux-kselftest

Reject writable map iterators on BPF_F_RDONLY_PROG maps and add an
attach-rejection selftest using the existing array-map iterator.

Testing on x86_64 under QEMU:
- Kernel and test_progs builds passed.
- Six selected bpf_iter subtests passed, including bpf_array_map_rdonly.

Changes in v2:
- Check BPF_F_RDONLY_PROG only; drop the frozen-map check.
- Shorten the commit message and correct the Fixes tags.
- Add a selftest expecting -EACCES when attaching dump_bpf_array_map()
  to a BPF_F_RDONLY_PROG array.

Adethya Srinivasan (2):
  bpf: Reject writable map iterators on read-only maps
  selftests/bpf: Check writable iterator attach to a read-only array

 kernel/bpf/map_iter.c                         | 12 +++++--
 .../selftests/bpf/prog_tests/bpf_iter.c       | 35 +++++++++++++++++++
 2 files changed, 44 insertions(+), 3 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-12 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 15:54 [PATCH bpf v2 0/2] Reject writable map iterators on read-only maps Adethya Srinivasan
2026-11-12 15:54 ` [PATCH bpf v2 1/2] bpf: " Adethya Srinivasan
2026-11-12 15:54 ` [PATCH bpf v2 2/2] selftests/bpf: Check writable iterator attach to a read-only array Adethya Srinivasan

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®