Skip to content

exec: Avoid pathological argc, envc, and bprm->p values

Kees Cook linux-fsdevel linux-hardening linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 2 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2execve: Keep bprm->argmin behind CONFIG_MMUfs/exec.c fs/exec_test.c include/linux/binfmts.h+23 -70 replies
2/2exec: Avoid pathological argc, envc, and bprm->p valuesfs/exec.c fs/exec_test.c+36 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] exec: Avoid pathological argc, envc, and bprm->p values

Hi,

This pair of patches replaces the last patch in this[1] series.

Perform bprm argument overflow checking but only do argmin checks for MMU systems. To avoid tripping over this again, argmin is explicitly defined only for CONFIG_MMU. Thank you to Guenter Roeck for finding this issue (again)!

-Kees

[1] https://lore.kernel.org/all/[email protected]/

Kees Cook (2):
execve: Keep bprm->argmin behind CONFIG_MMU
exec: Avoid pathological argc, envc, and bprm->p values

 fs/exec.c               | 36 +++++++++++++++++++++++++++++-------
 fs/exec_test.c          | 30 +++++++++++++++++++++++++++++-
 include/linux/binfmts.h |  2 +-
 3 files changed, 59 insertions(+), 9 deletions(-)
Signature · 1 line
2.34.1