From: Al Viro Date: Mon, 30 Nov 2009 21:52:36 +0000 (-0500) Subject: Kill ancient crap in s390 compat mmap X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=570dcf2c15463842e384eb597a87c1e39bead99b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Kill ancient crap in s390 compat mmap We've had TASK_SIZE set to 1<<31 for 31bit tasks since May 2004. Before that old32_mmap() had to deal with do_mmap_pgoff() giving it an address out of range. It had tried to do that by checking return value and doing do_munmap() (at wrong address, BTW). IOW, that code had been dead for 5.5 years (and bogus - for 8). Kill. Acked-by: Hugh Dickins Signed-off-by: Al Viro --- diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 25c31d681402..11556aa6bf17 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c @@ -642,11 +642,6 @@ static inline long do_mmap2( down_write(¤t->mm->mmap_sem); error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); - if (!IS_ERR((void *) error) && error + len >= 0x80000000ULL) { - /* Result is out of bounds. */ - do_munmap(current->mm, addr, len); - error = -ENOMEM; - } up_write(¤t->mm->mmap_sem); if (file)