aboutsummaryrefslogtreecommitdiff
path: root/block/blk-integrity.c
diff options
context:
space:
mode:
authorMartin KaFai Lau2024-02-22 11:19:40 -0800
committerMartin KaFai Lau2024-02-22 12:26:42 -0800
commit63c7049ef9d642ab60bb1eccf75b29dc40277664 (patch)
tree5c5951094ff327b9e52343e25707d5cc944f2fdb /block/blk-integrity.c
parent58fd62e0aa50fdd20bc41a01e787001f3af8a925 (diff)
parente9bbda13a7b876451285ab15fb600b809e5e2290 (diff)
Merge branch 'Check cfi_stubs before registering a struct_ops type.'
Kui-Feng Lee says: ==================== Recently, st_ops->cfi_stubs was introduced. However, the upcoming new struct_ops support (e.g. sched_ext) is not aware of this and does not provide its own cfi_stubs. The kernel ends up NULL dereferencing the st_ops->cfi_stubs. Considering struct_ops supports kernel module now, this NULL check is necessary. This patch set is to reject struct_ops registration that does not provide a cfi_stubs. Changes from v4: - Remove changes of check_member. - Remove checks of the pointers in cfi_stubs[]. Changes from v3: - Remove CFI stub function for get_info. - Allow passing NULL prog arg to check_member of struct bpf_struct_ops type. - Call check_member to determines if a CFI stub function should be defined for an operator. Changes from v2: - Add a stub function for get_info of struct tcp_congestion_ops. Changes from v1: - Check *(void **)(cfi_stubs + moff) to make sure stub functions are provided for every operator. - Add a test case to ensure that struct_ops rejects incomplete cfi_stub. v4: https://lore.kernel.org/all/20240221075213.2071454-1-thinker.li@gmail.com/ v3: https://lore.kernel.org/all/20240216193434.735874-1-thinker.li@gmail.com/ v2: https://lore.kernel.org/all/20240216020350.2061373-1-thinker.li@gmail.com/ v1: https://lore.kernel.org/all/20240215022401.1882010-1-thinker.li@gmail.com/ ==================== Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'block/blk-integrity.c')
0 files changed, 0 insertions, 0 deletions