Re: [PATCH v3] binfmt_elf: Dump smaller VMAs first in ELF cores

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 6, 2024, at 11:33 AM, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> Hmm. Realistically we only dump core in ELF, and the order of the
> segments shouldn't matter.
> 
> But I wonder if we should do this in the ->core_dump() function
> itself, in case it would have mattered for other dump formats?
> 
> IOW, instead of being at the bottom of dump_vma_snapshot(), maybe the
> sorting should be at the top of elf_core_dump()?
> 
> And yes, in practice I doubt we'll ever have other dump formats, and
> no, a.out isn't doing some miraculous comeback either.
> 
> But I bet you didn't test elf_fdpic_core_dump() even if I bet it (a)
> works and (b) nobody cares.
> 
> So moving it to the ELF side might be conceptually the right thing to do?
> 
> (Or is there some reason it needs to be done at snapshot time that I
> just didn't fully appreciate?)

The main reason it was done at snapshot time was to make it so that it
works with other dump formats like ELF FDPIC (that being said, yes I
didn't explicitly test it). If another format is introduced and isn't
compatible with this type of reordering, then I think the introduction
of that format should be reconsidered for lack of flexibility, or if it
really must be introduced, then this logic can be changed at that time.

That being said, my opinion on this isn't too strong, so if you feel it
is better to have it in elf_core_dump, we can do that too. Since Eric
originally brought up placing it here, maybe he has his own opinions on
this as well.

Best,
Brian Mak




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux