]> git.baikalelectronics.ru Git - kernel.git/commit
binfmt_flat: revert "binfmt_flat: don't offset the data start"
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 8 Aug 2020 18:37:13 +0000 (11:37 -0700)
committerGreg Ungerer <gerg@linux-m68k.org>
Sun, 23 Aug 2020 22:49:13 +0000 (08:49 +1000)
commit9d6a8c04931e7c172c2e3763b420efc319afd36a
tree2ce7590d312953c9e0190f5d38bd070f78f9ef3c
parent307d1b3e26310db573de01ed3dc4a02b4fb13ada
binfmt_flat: revert "binfmt_flat: don't offset the data start"

binfmt_flat loader uses the gap between text and data to store data
segment pointers for the libraries. Even in the absence of shared
libraries it stores at least one pointer to the executable's own data
segment. Text and data can go back to back in the flat binary image and
without offsetting data segment last few instructions in the text
segment may get corrupted by the data segment pointer.

Fix it by reverting commit 5f9f17d1a3bd ("binfmt_flat: don't offset the
data start").

Cc: stable@vger.kernel.org
Fixes: 5f9f17d1a3bd ("binfmt_flat: don't offset the data start")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
fs/binfmt_flat.c