diff options
| author | Anastasios Papagiannis <tasos.papagiannnis@gmail.com> | 2026-09-18 16:17:54 +0300 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-18 15:32:01 +0000 |
| commit | adc7fb9955e2718faf949cdc1efaf78179978445 (patch) | |
| tree | 027957ca80a65ef7947a12ef8695e3af664b1c05 /include/linux | |
| parent | 69d38c792c53a61ee79891e488d749d4da8ab674 (diff) | |
exec: Clear bprm->mm before dropping its reference
Once mmput() drops the final reference to bprm->mm, the pointer must no
longer remain accessible through struct linux_binprm.
The successful exec path and the bprm initialization error path already
clear bprm->mm when ownership is transferred or released. Do the same in
free_bprm() before calling mmput().
This is required for BPF kfuncs where bprm->mm is either NULL or points
to a live mm_struct to ensure safe access.
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>
Link: https://patch.msgid.link/20260918131757.42802-3-tasos.papagiannnis@gmail.com
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
