Revert "exec: load_script: don't blindly truncate shebang string"
commit56f88d7584a376a935969e65c8a14181bd6e8c65
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 Feb 2019 23:02:18 +0000 (14 15:02 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Feb 2019 08:08:56 +0000 (15 09:08 +0100)
tree5861d8857ccb49cbc860610349532eba50e86736
parent557ac4e2077364ff58c69fc524a8fc79c83870bf
Revert "exec: load_script: don't blindly truncate shebang string"

commit cb5b020a8d38f77209d0472a0fea755299a8ec78 upstream.

This reverts commit 8099b047ecc431518b9bb6bdbba3549bbecdc343.

It turns out that people do actually depend on the shebang string being
truncated, and on the fact that an interpreter (like perl) will often
just re-interpret it entirely to get the full argument list.

Reported-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/binfmt_script.c