Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-15 10:12:58 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-15 10:12:58 +0100
commitc99a06a64a4b22b9e36a50f4f0dda53f63785109 (patch)
tree309cdc763d7b4db83ccf794c059b8bd7309403a6
parentcc8092a472f1813f6a14b28627b67c60443b433f (diff)
Revert "exec: load_script: don't blindly truncate shebang
string" (shebang regression).
-rw-r--r--patches.suse/Revert-exec-load_script-don-t-blindly-truncate-sheba.patch36
-rw-r--r--series.conf1
2 files changed, 37 insertions, 0 deletions
diff --git a/patches.suse/Revert-exec-load_script-don-t-blindly-truncate-sheba.patch b/patches.suse/Revert-exec-load_script-don-t-blindly-truncate-sheba.patch
new file mode 100644
index 0000000000..d45dcb4957
--- /dev/null
+++ b/patches.suse/Revert-exec-load_script-don-t-blindly-truncate-sheba.patch
@@ -0,0 +1,36 @@
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Fri, 15 Feb 2019 08:05:58 +0100
+Subject: Revert "exec: load_script: don't blindly truncate shebang string"
+Patch-mainline: not yet, under discussion
+References: shebang regression
+
+This reverts commit c3b081f9e2e3377af8c28336e23efab606268eb3, upstream
+commit 8099b047ecc431518b9bb6bdbba3549bbecdc343. It changes the
+behaviour in userspace with respect to shebang handling. Revert until
+fixed.
+
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/binfmt_script.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+--- a/fs/binfmt_script.c
++++ b/fs/binfmt_script.c
+@@ -42,14 +42,10 @@ static int load_script(struct linux_binp
+ fput(bprm->file);
+ bprm->file = NULL;
+
+- for (cp = bprm->buf+2;; cp++) {
+- if (cp >= bprm->buf + BINPRM_BUF_SIZE)
+- return -ENOEXEC;
+- if (!*cp || (*cp == '\n'))
+- break;
+- }
++ bprm->buf[BINPRM_BUF_SIZE - 1] = '\0';
++ if ((cp = strchr(bprm->buf, '\n')) == NULL)
++ cp = bprm->buf+BINPRM_BUF_SIZE-1;
+ *cp = '\0';
+-
+ while (cp > bprm->buf) {
+ cp--;
+ if ((*cp == ' ') || (*cp == '\t'))
diff --git a/series.conf b/series.conf
index 235c106f50..35e2e0ce8b 100644
--- a/series.conf
+++ b/series.conf
@@ -1134,6 +1134,7 @@
########################################################
# Scheduler / Core
########################################################
+ patches.suse/Revert-exec-load_script-don-t-blindly-truncate-sheba.patch
patches.suse/setuid-dumpable-wrongdir
patches.suse/0001-x86-speculation-Add-basic-IBRS-support-infrastructur.patch