Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-05-01 Thread Rob Landley
On 5/1/20 1:00 AM, Greg Ungerer wrote: >> This sounds correct. My understanding of FLAT shared library support >> is that it's really bad and based on having preassigned slot indices >> for each library on the system, and a global array per-process to give >> to data base address for each library.

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-05-01 Thread Eric W. Biederman
Greg Ungerer writes: > On 1/5/20 5:07 am, Eric W. Biederman wrote: >> Linus Torvalds writes: >> >>> On Thu, Apr 30, 2020 at 7:10 AM Greg Ungerer wrote: >> > Most of that file goes back to pre-git days. And most of the commits > since are not so much about binfmt_flat, as they are about

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-05-01 Thread Greg Ungerer
On 1/5/20 2:54 am, Linus Torvalds wrote: On Thu, Apr 30, 2020 at 7:10 AM Greg Ungerer wrote: in load_flat_file() - which is also used to loading _libraries_. Where it makes no sense at all. I haven't looked at the shared lib support in there for a long time, but I thought that "id" is

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-05-01 Thread Greg Ungerer
On 1/5/20 12:51 am, Rich Felker wrote: On Fri, May 01, 2020 at 12:10:05AM +1000, Greg Ungerer wrote: On 30/4/20 9:03 am, Linus Torvalds wrote: On Wed, Apr 29, 2020 at 2:57 PM Russell King - ARM Linux admin wrote: I've never had any reason to use FDPIC, and I don't have any binaries that

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-30 Thread Greg Ungerer
On 1/5/20 5:07 am, Eric W. Biederman wrote: Linus Torvalds writes: On Thu, Apr 30, 2020 at 7:10 AM Greg Ungerer wrote: Most of that file goes back to pre-git days. And most of the commits since are not so much about binfmt_flat, as they are about cleanups or changes elsewhere where

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-30 Thread Rob Landley
On 4/30/20 9:51 AM, Rich Felker wrote: > This sounds correct. My understanding of FLAT shared library support > is that it's really bad and based on having preassigned slot indices > for each library on the system, and a global array per-process to give > to data base address for each library.

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-30 Thread Eric W. Biederman
Linus Torvalds writes: > On Thu, Apr 30, 2020 at 7:10 AM Greg Ungerer wrote: >> > Most of that file goes back to pre-git days. And most of the commits >> > since are not so much about binfmt_flat, as they are about cleanups or >> > changes elsewhere where binfmt_flat was just a victim. >> >>

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-30 Thread Linus Torvalds
On Thu, Apr 30, 2020 at 7:10 AM Greg Ungerer wrote: > > > in load_flat_file() - which is also used to loading _libraries_. Where > > it makes no sense at all. > > I haven't looked at the shared lib support in there for a long time, > but I thought that "id" is only 0 for the actual final program.

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-30 Thread Rich Felker
On Fri, May 01, 2020 at 12:10:05AM +1000, Greg Ungerer wrote: > > > On 30/4/20 9:03 am, Linus Torvalds wrote: > >On Wed, Apr 29, 2020 at 2:57 PM Russell King - ARM Linux admin > > wrote: > >> > >>I've never had any reason to use FDPIC, and I don't have any binaries > >>that would use it.

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-30 Thread Greg Ungerer
On 30/4/20 9:03 am, Linus Torvalds wrote: On Wed, Apr 29, 2020 at 2:57 PM Russell King - ARM Linux admin wrote: I've never had any reason to use FDPIC, and I don't have any binaries that would use it. Nicolas Pitre added ARM support, so I guess he would be the one to talk to about it.

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-29 Thread Nicolas Pitre
On Wed, 29 Apr 2020, Russell King - ARM Linux admin wrote: > On Wed, Apr 29, 2020 at 11:49:49PM +0200, Jann Horn wrote: > > At the moment, we have that rather ugly mmget_still_valid() helper to > > work around : ELF core dumping > > doesn't take the mmap_sem

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-29 Thread Nicolas Pitre
On Wed, 29 Apr 2020, Linus Torvalds wrote: > While we're at it, is there anybody who knows binfmt_flat? I'd say Greg Ungerer. > It might be Nicolas too. I only contributed the necessary changes to make it work on targets with a MMU. Once fdpic started to worked I used that instead. FWIW I

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-29 Thread Linus Torvalds
On Wed, Apr 29, 2020 at 2:57 PM Russell King - ARM Linux admin wrote: > > I've never had any reason to use FDPIC, and I don't have any binaries > that would use it. Nicolas Pitre added ARM support, so I guess he > would be the one to talk to about it. (Added Nicolas.) While we're at it, is

Re: [PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-29 Thread Russell King - ARM Linux admin
On Wed, Apr 29, 2020 at 11:49:49PM +0200, Jann Horn wrote: > At the moment, we have that rather ugly mmget_still_valid() helper to > work around : ELF core dumping > doesn't take the mmap_sem while traversing the task's VMAs, and if > anything (like

[PATCH v2 0/5] Fix ELF / FDPIC ELF core dumping, and use mmap_sem properly in there

2020-04-29 Thread Jann Horn
At the moment, we have that rather ugly mmget_still_valid() helper to work around : ELF core dumping doesn't take the mmap_sem while traversing the task's VMAs, and if anything (like userfaultfd) then remotely messes with the VMA tree, fireworks ensue. So at