exec: Add do_close_execat() helper
authorKees Cook <keescook@chromium.org>
Sat, 17 Sep 2022 00:11:18 +0000 (17:11 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 22 Jan 2024 19:45:39 +0000 (11:45 -0800)
commitbdd8f62431ebcf15902a5fce3336388e436405c6
treeefbc4718f1dfcf8341d5f4b895fdd264d284fca3
parent8788a17c2319f020ccdc3f2907179a5ae81b7ad6
exec: Add do_close_execat() helper

Consolidate the calls to allow_write_access()/fput() into a single
place, since we repeat this code pattern. Add comments around the
callers for the details on it.

Link: https://lore.kernel.org/r/202209161637.9EDAF6B18@keescook
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/exec.c