]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: Constify struct btf_kind_operations
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 15 Sep 2024 16:21:54 +0000 (18:21 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Oct 2024 00:47:35 +0000 (17:47 -0700)
commit7bae563c0dbe0039d80a103601f64dcdb48b1481
treeccb9643b435f76c1e75ab5f3154a8d249ed5db2e
parent58dbb36930183aea41024d9c0b0ed97629473e20
bpf: Constify struct btf_kind_operations

struct btf_kind_operations are not modified in BTF.

Constifying this structures moves some data to a read-only section,
so increase overall security, especially when the structure holds
some function pointers.

On a x86_64, with allmodconfig:

Before:
======
   text    data     bss     dec     hex filename
 184320    7091     548  191959   2edd7 kernel/bpf/btf.o

After:
=====
   text    data     bss     dec     hex filename
 184896    6515     548  191959   2edd7 kernel/bpf/btf.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/9192ab72b2e9c66aefd6520f359a20297186327f.1726417289.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/btf.c