summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2026-09-15 17:07:36 +0200
committerAlexei Starovoitov <ast@kernel.org>2026-09-19 19:03:14 +0000
commit3479e396eef4db6514ab59d2ec889ae237869486 (patch)
tree74080cda9dca2cf17baccc114b60a8a5ca50c062 /kernel
parentff0d1c0915d1fce9b4b8613a8b52b0da51463d87 (diff)
downloadlinux-next-3479e396eef4db6514ab59d2ec889ae237869486.tar.gz
linux-next-3479e396eef4db6514ab59d2ec889ae237869486.zip
bpf, lsm: Mark the BPF LSM hook overrides noinline
The stubs that bpf_lsm_proto.c overrides are generated as: #define LSM_HOOK(RET, DEFAULT, NAME, ...) \ __weak noinline RET bpf_lsm_##NAME(__VA_ARGS__) \ { \ return DEFAULT; \ } Mark the overrides noinline as well so they hold up the same contract as the stubs they replace. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20260915150739.284189-6-daniel@iogearbox.net
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/bpf_lsm_proto.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/bpf/bpf_lsm_proto.c b/kernel/bpf/bpf_lsm_proto.c
index 4a776df76cbb..b81179ae2e08 100644
--- a/kernel/bpf/bpf_lsm_proto.c
+++ b/kernel/bpf/bpf_lsm_proto.c
@@ -13,8 +13,8 @@
* explicitly enforces that BPF LSM programs check for NULL before attempting to
* dereference it.
*/
-int bpf_lsm_mmap_file(struct file *file__nullable, unsigned long reqprot,
- unsigned long prot, unsigned long flags)
+noinline int bpf_lsm_mmap_file(struct file *file__nullable, unsigned long reqprot,
+ unsigned long prot, unsigned long flags)
{
return 0;
}
@@ -25,10 +25,10 @@ int bpf_lsm_mmap_file(struct file *file__nullable, unsigned long reqprot,
* suffix marks it as PTR_MAYBE_NULL. BPF LSM programs have to check before
* dereferencing them or handing them to bpf_inode_init_xattr().
*/
-int bpf_lsm_inode_init_security(struct inode *inode, struct inode *dir,
- const struct qstr *qstr__nullable,
- struct xattr *xattrs__nullable,
- int *xattr_count)
+noinline int bpf_lsm_inode_init_security(struct inode *inode, struct inode *dir,
+ const struct qstr *qstr__nullable,
+ struct xattr *xattrs__nullable,
+ int *xattr_count)
{
return -EOPNOTSUPP;
}