diff options
author | Mike Pagano <mpagano@gentoo.org> | 2022-05-27 08:40:43 -0400 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2022-05-27 08:40:43 -0400 |
commit | b461d2fb4478a277ea5b531efba262d22b60e15d (patch) | |
tree | 2ea55d338049c2e532fb2723d371bec74e7e753a | |
parent | Linux patch 4.9.316 (diff) | |
download | linux-patches-b461d2fb4478a277ea5b531efba262d22b60e15d.tar.gz linux-patches-b461d2fb4478a277ea5b531efba262d22b60e15d.tar.bz2 linux-patches-b461d2fb4478a277ea5b531efba262d22b60e15d.zip |
exec: increase BINPRM_BUF_SIZE to 256
https://bugs.gentoo.org/847655
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
-rw-r--r-- | 0000_README | 4 | ||||
-rw-r--r-- | 1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch | 51 |
2 files changed, 55 insertions, 0 deletions
diff --git a/0000_README b/0000_README index 3ad05b69..81ae8c32 100644 --- a/0000_README +++ b/0000_README @@ -1323,6 +1323,10 @@ Patch: 1701_ia64_fix_ptrace.patch From: https://patchwork.kernel.org/patch/10198159/ Desc: ia64: fix ptrace(PTRACE_GETREGS) (unbreaks strace, gdb). +Patch: 1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch +From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/exec.c?id=6eb3c3d0a52dca337e327ae8868ca1f44a712e02 +Desc: exec: increase BINPRM_BUF_SIZE to 256 + Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/raw Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758 diff --git a/1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch b/1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch new file mode 100644 index 00000000..2be01c77 --- /dev/null +++ b/1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch @@ -0,0 +1,51 @@ +From 6eb3c3d0a52dca337e327ae8868ca1f44a712e02 Mon Sep 17 00:00:00 2001 +From: Oleg Nesterov <oleg@redhat.com> +Date: Thu, 7 Mar 2019 16:29:26 -0800 +Subject: [PATCH] exec: increase BINPRM_BUF_SIZE to 256 + +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. + +[oleg@redhat.com: update comment, per Kees] +Link: http://lkml.kernel.org/r/20181112160956.GA28472@redhat.com +Signed-off-by: Oleg Nesterov <oleg@redhat.com> +Reported-by: Ben Woodard <woodard@redhat.com> +Reviewed-by: Andrew Morton <akpm@linux-foundation.org> +Acked-by: Michal Hocko <mhocko@suse.com> +Acked-by: Kees Cook <keescook@chromium.org> +Cc: "Eric W. Biederman" <ebiederm@xmission.com> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> +--- + fs/exec.c | 2 +- + include/uapi/linux/binfmts.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/exec.c b/fs/exec.c +index bf0ace3841ad6e..2e0033348d8e10 100644 +--- a/fs/exec.c ++++ b/fs/exec.c +@@ -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). + */ +diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h +index 4abad03a885305..689025d9c185b0 100644 +--- a/include/uapi/linux/binfmts.h ++++ b/include/uapi/linux/binfmts.h +@@ -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 */ |