diff options
| author | Puranjay Mohan <puranjay@kernel.org> | 2026-09-22 13:00:51 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-22 23:44:24 +0000 |
| commit | 908a60853b8dfe3bc9ad33598330bdcd03489b7c (patch) | |
| tree | e96f9d511ebdd1ee2900052faed5f399da327e1c /kernel | |
| parent | 1832696b22078f57069a676266caaeb4b0562ad7 (diff) | |
| download | linux-next-908a60853b8dfe3bc9ad33598330bdcd03489b7c.tar.gz linux-next-908a60853b8dfe3bc9ad33598330bdcd03489b7c.zip | |
selftests/bpf: Add tests for bpf_call_rcu()
Cover the callback running after a grace period with the right map, key
and value, -EBUSY on a second arm, reuse of the head once disarmed, a
callback arming itself again, and teardown with a callback queued.
struct bpf_rcu_head is not the first member of the map value, so the
callback's recovery of the value from the head is exercised. arm()
wraps both arms in an RCU read section, otherwise a grace period may
elapse between them and the second one legitimately succeeds.
Negative tests: a hash map created with the same BTF, the map used as an
inner map, and an iterator attach, all checked for -EOPNOTSUPP; plus
verifier rejection of a mismatched map, a map with no bpf_rcu_head, a
head at the wrong offset, a head on the stack, and a sleepable callback.
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260922200208.3203834-3-puranjay@kernel.org
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
