diff options
| author | Anastasios Papagiannis <tasos.papagiannnis@gmail.com> | 2026-09-18 16:17:56 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-18 15:32:01 +0000 |
| commit | cca46f91737ca9e41c0f86b326e5eaf695069e40 (patch) | |
| tree | 53c40a475126429e2ca40a7c5924f396f3d1d69d /include/linux/debugobjects.h | |
| parent | 3f9d98dfed79ffc969d15cf214388ebf861f03af (diff) | |
bpf: Mark linux_binprm->mm as trusted-or-null
Mark linux_binprm->mm as a trusted-or-null nested pointer so BPF programs
can pass it to kfuncs after a NULL check.
The field is either NULL or points to a live mm_struct whenever BPF can
access a linux_binprm. On successful exec, exec_mmap() installs the new
address space before begin_new_exec() clears bprm->mm. The bprm_mm_init()
error path clears the field before mmdrop(), and free_bprm() clears it
before mmput(), as ensured by an earlier patch in this series.
Update the existing LSM selftest to check bprm->mm for NULL before
dereferencing it, as required for trusted-or-null pointers.
Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Sun Jian <sun.jian.kdev@gmail.com>
Reviewed-by: Matt Bobrowski <matt@bobrowski.net>
Link: https://patch.msgid.link/20260918131757.42802-5-tasos.papagiannnis@gmail.com
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
