Skip to content

bpf: use const pointer for struct_ops cfi_stubs

Caleb Sander Mateos bpf linux-input linux-kselftest linux-rdma linux-s390 lkml netdev sched-ext 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5bpf: use const pointer for struct_ops cfi_stubsinclude/linux/bpf.h kernel/bpf/bpf_struct_ops.c+4 -40 replies
2/5HID: bpf: make __bpf_hid_bpf_ops constdrivers/hid/bpf/hid_bpf_struct_ops.c+1 -10 replies
3/5sched_ext: make __bpf_ops_sched_ext_ops constkernel/sched/ext.c+1 -10 replies
4/5net: make cfi_stubs globals constnet/bpf/bpf_dummy_struct_ops.c net/ipv4/bpf_tcp_ca.c net/sched/bpf_qdisc.c +1 more+4 -40 replies
5/5selftests/bpf: make cfi_stubs globals consttools/testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c tools/testing/selftests/bpf/test_kmods/bpf_testmod.c+6 -65 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] bpf: use const pointer for struct_ops cfi_stubs

struct bpf_struct_ops's cfi_stubs field is used as a readonly pointer but has type void *. Change its type to void const * to allow it to point to readonly global memory. Update the struct_ops implementations to declare their cfi_stubs global variables as const.

Caleb Sander Mateos (5):
bpf: use const pointer for struct_ops cfi_stubs
HID: bpf: make __bpf_hid_bpf_ops const
sched_ext: make __bpf_ops_sched_ext_ops const
net: make cfi_stubs globals const
selftests/bpf: make cfi_stubs globals const

 drivers/hid/bpf/hid_bpf_struct_ops.c                   |  2 +-
 include/linux/bpf.h                                    |  2 +-
 kernel/bpf/bpf_struct_ops.c                            |  6 +++---
 kernel/sched/ext.c                                     |  2 +-
 net/bpf/bpf_dummy_struct_ops.c                         |  2 +-
 net/ipv4/bpf_tcp_ca.c                                  |  2 +-
 net/sched/bpf_qdisc.c                                  |  2 +-
 net/smc/smc_hs_bpf.c                                   |  2 +-
 .../testing/selftests/bpf/test_kmods/bpf_test_no_cfi.c |  2 +-
 tools/testing/selftests/bpf/test_kmods/bpf_testmod.c   | 10 +++++-----
 10 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
2.45.2