summaryrefslogtreecommitdiff
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 15:08:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 15:08:26 +0300
commitcd4846c5a68da77705164924f47001af3b499dec (patch)
tree226295e35148ee7a9d303c6a218790b7a8107976 /fs/binfmt_elf.c
parent9ee84466b7130360d07241baf4c95a553fc0a997 (diff)
parent6da6c0db5316275015e8cc2959f12a17584aeb64 (diff)
downloadlinux-cd4846c5a68da77705164924f47001af3b499dec.tar.xz
Merge 4.17-rc3 into driver-core-next
We want the fixes in here as well for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 41e04183e4ce..4ad6f669fe34 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -377,10 +377,10 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
} else
map_addr = vm_mmap(filep, addr, size, prot, type, off);
- if ((type & MAP_FIXED_NOREPLACE) && BAD_ADDR(map_addr))
- pr_info("%d (%s): Uhuuh, elf segment at %p requested but the memory is mapped already\n",
- task_pid_nr(current), current->comm,
- (void *)addr);
+ if ((type & MAP_FIXED_NOREPLACE) &&
+ PTR_ERR((void *)map_addr) == -EEXIST)
+ pr_info("%d (%s): Uhuuh, elf segment at %px requested but the memory is mapped already\n",
+ task_pid_nr(current), current->comm, (void *)addr);
return(map_addr);
}