Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-31 Thread Mike Kravetz
On 05/31/2018 02:24 AM, Michal Hocko wrote: > I am not an expert on the load linkers myself so I cannot really answer > this question. Please note that ppc had something similar. See > ad55eac74f20 ("elf: enforce MAP_FIXED on overlaying elf segments"). > Maybe we need to sprinkle more of those at

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-31 Thread Mike Kravetz
On 05/31/2018 02:24 AM, Michal Hocko wrote: > I am not an expert on the load linkers myself so I cannot really answer > this question. Please note that ppc had something similar. See > ad55eac74f20 ("elf: enforce MAP_FIXED on overlaying elf segments"). > Maybe we need to sprinkle more of those at

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-31 Thread Michal Hocko
On Wed 30-05-18 17:51:15, Mike Kravetz wrote: [...] > [ 38.931497] load_elf_binary: skipping index 0 p_vaddr = 8048034 > [ 38.932321] load_elf_binary: skipping index 1 p_vaddr = 8048154 > [ 38.933165] load_elf_binary: calling elf_map() index 2 bias 0 vaddr 8048000 > [ 38.934087]

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-31 Thread Michal Hocko
On Wed 30-05-18 17:51:15, Mike Kravetz wrote: [...] > [ 38.931497] load_elf_binary: skipping index 0 p_vaddr = 8048034 > [ 38.932321] load_elf_binary: skipping index 1 p_vaddr = 8048154 > [ 38.933165] load_elf_binary: calling elf_map() index 2 bias 0 vaddr 8048000 > [ 38.934087]

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Mike Kravetz
On 05/30/2018 09:25 AM, Michal Hocko wrote: > Could you add a debugging data to dump the VMA which overlaps the > requested adress and who requested that? E.g. hook into do_mmap and dump > all requests from the linker. Here you go. I added a bunch of stuff as I clearly do not understand how elf

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Mike Kravetz
On 05/30/2018 09:25 AM, Michal Hocko wrote: > Could you add a debugging data to dump the VMA which overlaps the > requested adress and who requested that? E.g. hook into do_mmap and dump > all requests from the linker. Here you go. I added a bunch of stuff as I clearly do not understand how elf

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Michal Hocko
On Wed 30-05-18 08:00:29, Mike Kravetz wrote: > On 05/30/2018 01:02 AM, Michal Hocko wrote: > > On Tue 29-05-18 15:21:14, Mike Kravetz wrote: > >> Just a quick heads up. I noticed a change in libhugetlbfs testing starting > >> with v4.17-rc1. > >> > >> V4.16 libhugetlbfs test results > >>

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Michal Hocko
On Wed 30-05-18 08:00:29, Mike Kravetz wrote: > On 05/30/2018 01:02 AM, Michal Hocko wrote: > > On Tue 29-05-18 15:21:14, Mike Kravetz wrote: > >> Just a quick heads up. I noticed a change in libhugetlbfs testing starting > >> with v4.17-rc1. > >> > >> V4.16 libhugetlbfs test results > >>

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Mike Kravetz
On 05/30/2018 01:02 AM, Michal Hocko wrote: > On Tue 29-05-18 15:21:14, Mike Kravetz wrote: >> Just a quick heads up. I noticed a change in libhugetlbfs testing starting >> with v4.17-rc1. >> >> V4.16 libhugetlbfs test results >> ** TEST SUMMARY >> * 2M >>

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Mike Kravetz
On 05/30/2018 01:02 AM, Michal Hocko wrote: > On Tue 29-05-18 15:21:14, Mike Kravetz wrote: >> Just a quick heads up. I noticed a change in libhugetlbfs testing starting >> with v4.17-rc1. >> >> V4.16 libhugetlbfs test results >> ** TEST SUMMARY >> * 2M >>

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Michal Hocko
On Tue 29-05-18 15:21:14, Mike Kravetz wrote: > Just a quick heads up. I noticed a change in libhugetlbfs testing starting > with v4.17-rc1. > > V4.16 libhugetlbfs test results > ** TEST SUMMARY > * 2M > * 32-bit 64-bit > * Total

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-30 Thread Michal Hocko
On Tue 29-05-18 15:21:14, Mike Kravetz wrote: > Just a quick heads up. I noticed a change in libhugetlbfs testing starting > with v4.17-rc1. > > V4.16 libhugetlbfs test results > ** TEST SUMMARY > * 2M > * 32-bit 64-bit > * Total

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-29 Thread Mike Kravetz
Just a quick heads up. I noticed a change in libhugetlbfs testing starting with v4.17-rc1. V4.16 libhugetlbfs test results ** TEST SUMMARY * 2M * 32-bit 64-bit * Total testcases: 110113 * Skipped: 0

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-05-29 Thread Mike Kravetz
Just a quick heads up. I noticed a change in libhugetlbfs testing starting with v4.17-rc1. V4.16 libhugetlbfs test results ** TEST SUMMARY * 2M * 32-bit 64-bit * Total testcases: 110113 * Skipped: 0

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Michal Hocko
On Wed 18-04-18 20:43:11, Tetsuo Handa wrote: > Michal Hocko wrote: > > > Don't complain if IS_ERR_VALUE(), > > > > this is simply wrong. We do want to warn on the failure because this is > > when the actual clash happens. We should just warn on EEXIST. > > >From

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Michal Hocko
On Wed 18-04-18 20:43:11, Tetsuo Handa wrote: > Michal Hocko wrote: > > > Don't complain if IS_ERR_VALUE(), > > > > this is simply wrong. We do want to warn on the failure because this is > > when the actual clash happens. We should just warn on EEXIST. > > >From

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Tetsuo Handa
Michal Hocko wrote: > > Don't complain if IS_ERR_VALUE(), > > this is simply wrong. We do want to warn on the failure because this is > when the actual clash happens. We should just warn on EEXIST. >From 25442cdd31aa5cc8522923a0153a77dfd2ebc832 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Tetsuo Handa
Michal Hocko wrote: > > Don't complain if IS_ERR_VALUE(), > > this is simply wrong. We do want to warn on the failure because this is > when the actual clash happens. We should just warn on EEXIST. >From 25442cdd31aa5cc8522923a0153a77dfd2ebc832 Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date:

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Michal Hocko
On Wed 18-04-18 19:51:05, Tetsuo Handa wrote: > >From 0ba20dcbbc40b703413c9a6907a77968b087811b Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Wed, 18 Apr 2018 15:31:48 +0900 > Subject: [PATCH] fs, elf: don't complain MAP_FIXED_NOREPLACE if mapping >

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Michal Hocko
On Wed 18-04-18 19:51:05, Tetsuo Handa wrote: > >From 0ba20dcbbc40b703413c9a6907a77968b087811b Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Wed, 18 Apr 2018 15:31:48 +0900 > Subject: [PATCH] fs, elf: don't complain MAP_FIXED_NOREPLACE if mapping > failed. > > Commit 4ed28639519c7bad

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Tetsuo Handa
>From 0ba20dcbbc40b703413c9a6907a77968b087811b Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Wed, 18 Apr 2018 15:31:48 +0900 Subject: [PATCH] fs, elf: don't complain MAP_FIXED_NOREPLACE if mapping failed. Commit 4ed28639519c7bad ("fs, elf: drop MAP_FIXED

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2018-04-18 Thread Tetsuo Handa
>From 0ba20dcbbc40b703413c9a6907a77968b087811b Mon Sep 17 00:00:00 2001 From: Tetsuo Handa Date: Wed, 18 Apr 2018 15:31:48 +0900 Subject: [PATCH] fs, elf: don't complain MAP_FIXED_NOREPLACE if mapping failed. Commit 4ed28639519c7bad ("fs, elf: drop MAP_FIXED usage from elf_map") is printing

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2017-11-29 Thread Khalid Aziz
On 11/29/2017 07:42 AM, Michal Hocko wrote: From: Michal Hocko Both load_elf_interp and load_elf_binary rely on elf_map to map segments on a controlled address and they use MAP_FIXED to enforce that. This is however dangerous thing prone to silent data corruption which can be

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2017-11-29 Thread Khalid Aziz
On 11/29/2017 07:42 AM, Michal Hocko wrote: From: Michal Hocko Both load_elf_interp and load_elf_binary rely on elf_map to map segments on a controlled address and they use MAP_FIXED to enforce that. This is however dangerous thing prone to silent data corruption which can be even exploitable.

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2017-11-16 Thread Kees Cook
On Thu, Nov 16, 2017 at 2:19 AM, Michal Hocko wrote: > From: Michal Hocko > > Both load_elf_interp and load_elf_binary rely on elf_map to map segments > on a controlled address and they use MAP_FIXED to enforce that. This is > however dangerous thing prone to

Re: [PATCH 2/2] fs, elf: drop MAP_FIXED usage from elf_map

2017-11-16 Thread Kees Cook
On Thu, Nov 16, 2017 at 2:19 AM, Michal Hocko wrote: > From: Michal Hocko > > Both load_elf_interp and load_elf_binary rely on elf_map to map segments > on a controlled address and they use MAP_FIXED to enforce that. This is > however dangerous thing prone to silent data corruption which can be