xref: /linux/kernel/bpf/bpf_lsm_proto.c (revision f17b474e36647c23801ef8fdaf2255ab66dd2973)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright 2025 Google LLC.
4  */
5 
6 #include <linux/fs.h>
7 #include <linux/bpf_lsm.h>
8 
9 /*
10  * Strong definition of the mmap_file() BPF LSM hook. The __nullable suffix on
11  * the struct file pointer parameter name marks it as PTR_MAYBE_NULL. This
12  * explicitly enforces that BPF LSM programs check for NULL before attempting to
13  * dereference it.
14  */
15 int bpf_lsm_mmap_file(struct file *file__nullable, unsigned long reqprot,
16 		      unsigned long prot, unsigned long flags)
17 {
18 	return 0;
19 }
20