Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Fri, 27 May 2022 12:24:51
Message-Id: 1653654247.04ab94a3dd2453d23b2b6608b01f94451fe6f5c8.mpagano@gentoo
1 commit: 04ab94a3dd2453d23b2b6608b01f94451fe6f5c8
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 27 12:24:07 2022 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri May 27 12:24:07 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=04ab94a3
7
8 exec: increase BINPRM_BUF_SIZE to 256
9
10 Bug: https://bugs.gentoo.org/847655
11
12 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
13
14 0000_README | 4 +++
15 1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch | 51 +++++++++++++++++++++++++++
16 2 files changed, 55 insertions(+)
17
18 diff --git a/0000_README b/0000_README
19 index b7976b31..d527b79c 100644
20 --- a/0000_README
21 +++ b/0000_README
22 @@ -1027,6 +1027,10 @@ Patch: 1510_fs-enable-link-security-restrictions-by-default.patch
23 From: http://sources.debian.net/src/linux/3.16.7-ckt4-3/debian/patches/debian/fs-enable-link-security-restrictions-by-default.patch/
24 Desc: Enable link security restrictions by default.
25
26 +Patch: 1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch
27 +From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/exec.c?id=6eb3c3d0a52dca337e327ae8868ca1f44a712e02
28 +Desc: exec: increase BINPRM_BUF_SIZE to 256
29 +
30 Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
31 From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@××××××××.org/raw
32 Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758
33
34 diff --git a/1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch b/1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch
35 new file mode 100644
36 index 00000000..2be01c77
37 --- /dev/null
38 +++ b/1900_fs-increase-BINPRM-BUF-SIZE-to-256.patch
39 @@ -0,0 +1,51 @@
40 +From 6eb3c3d0a52dca337e327ae8868ca1f44a712e02 Mon Sep 17 00:00:00 2001
41 +From: Oleg Nesterov <oleg@××××××.com>
42 +Date: Thu, 7 Mar 2019 16:29:26 -0800
43 +Subject: [PATCH] exec: increase BINPRM_BUF_SIZE to 256
44 +
45 +Large enterprise clients often run applications out of networked file
46 +systems where the IT mandated layout of project volumes can end up
47 +leading to paths that are longer than 128 characters. Bumping this up
48 +to the next order of two solves this problem in all but the most
49 +egregious case while still fitting into a 512b slab.
50 +
51 +[oleg@××××××.com: update comment, per Kees]
52 +Link: http://lkml.kernel.org/r/20181112160956.GA28472@××××××.com
53 +Signed-off-by: Oleg Nesterov <oleg@××××××.com>
54 +Reported-by: Ben Woodard <woodard@××××××.com>
55 +Reviewed-by: Andrew Morton <akpm@××××××××××××××××.org>
56 +Acked-by: Michal Hocko <mhocko@××××.com>
57 +Acked-by: Kees Cook <keescook@××××××××.org>
58 +Cc: "Eric W. Biederman" <ebiederm@××××××××.com>
59 +Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
60 +Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
61 +---
62 + fs/exec.c | 2 +-
63 + include/uapi/linux/binfmts.h | 2 +-
64 + 2 files changed, 2 insertions(+), 2 deletions(-)
65 +
66 +diff --git a/fs/exec.c b/fs/exec.c
67 +index bf0ace3841ad6e..2e0033348d8e10 100644
68 +--- a/fs/exec.c
69 ++++ b/fs/exec.c
70 +@@ -1563,7 +1563,7 @@ static void bprm_fill_uid(struct linux_binprm *bprm)
71 +
72 + /*
73 + * Fill the binprm structure from the inode.
74 +- * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
75 ++ * Check permissions, then read the first BINPRM_BUF_SIZE bytes
76 + *
77 + * This may be called multiple times for binary chains (scripts for example).
78 + */
79 +diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
80 +index 4abad03a885305..689025d9c185b0 100644
81 +--- a/include/uapi/linux/binfmts.h
82 ++++ b/include/uapi/linux/binfmts.h
83 +@@ -16,6 +16,6 @@ struct pt_regs;
84 + #define MAX_ARG_STRINGS 0x7FFFFFFF
85 +
86 + /* sizeof(linux_binprm->buf) */
87 +-#define BINPRM_BUF_SIZE 128
88 ++#define BINPRM_BUF_SIZE 256
89 +
90 + #endif /* _UAPI_LINUX_BINFMTS_H */