Skip to content

exec: Remove the computation of bprm->cred

Eric W. Biederman linux-fsdevel linux-security-module lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2exec: Add a per bprm->file version of per_clearfs/exec.c include/linux/binfmts.h include/linux/lsm_hooks.h +1 more+12 -33 replies
2/2exec: Compute file based creds only oncefs/binfmt_misc.c fs/exec.c include/linux/binfmts.h +5 more+61 -793 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchKees Cook
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] exec: Remove the computation of bprm->cred

My last chunk of cleanups was clearly too a bit too big, with too many issues going on so let's try this again with just the most important cleanup.

Recomputing the uids, gids, capabilities, and related flags each time a new bprm->file is set is error prone, and as it turns out unnecessary.

Building upon my previous exec clean up work this set of changes splits per_clear temporarily into two separate flags which is the last step in causing the code to recompute everything each time a new bprm->file is considered. Then the code is refactored to run the credential from file calculation later so that recomputation is not necessary.

Doing this in two steps should allow anyone who has problems later to bisect and tell if it was the semantic change or the refactoring that caused them problems.

Eric W. Biederman (2):
exec: Add a per bprm->file version of per_clear
exec: Compute file based creds only once

 fs/binfmt_misc.c              |  2 +-
 fs/exec.c                     | 57 ++++++++++++++++++-------------------------
 include/linux/binfmts.h       |  9 ++-----
 include/linux/lsm_hook_defs.h |  2 +-
 include/linux/lsm_hooks.h     | 22 +++++++++--------
 include/linux/security.h      |  9 ++++---
 security/commoncap.c          | 22 +++++++++--------
 security/security.c           |  4 +--
 8 files changed, 59 insertions(+), 68 deletions(-)

---

This builds upon my previous exec cleanup work at:
git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git exec-next

Thank you,
Eric