Skip to content

Commit

Permalink
exec: increase BINPRM_BUF_SIZE to 256
Browse files Browse the repository at this point in the history
Large enterprise clients often run applications out of networked file
systems where the IT mandated layout of project volumes can end up
leading to paths that are longer than 128 characters.  Bumping this up
to the next order of two solves this problem in all but the most
egregious case while still fitting into a 512b slab.

[[email protected]: update comment, per Kees]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Oleg Nesterov <[email protected]>
Reported-by: Ben Woodard <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
oleg-nesterov authored and torvalds committed Mar 8, 2019
1 parent 26e1522 commit 6eb3c3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm)

/*
* Fill the binprm structure from the inode.
* Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
* Check permissions, then read the first BINPRM_BUF_SIZE bytes
*
* This may be called multiple times for binary chains (scripts for example).
*/
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/binfmts.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ struct pt_regs;
#define MAX_ARG_STRINGS 0x7FFFFFFF

/* sizeof(linux_binprm->buf) */
#define BINPRM_BUF_SIZE 128
#define BINPRM_BUF_SIZE 256

#endif /* _UAPI_LINUX_BINFMTS_H */

0 comments on commit 6eb3c3d

Please sign in to comment.