This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid deadlock in malloc on backtrace


On 02/24/2015 12:51 PM, Siddhesh Poyarekar wrote:
> Agreed, but that would be beyond the scope of glibc.  The other 
> alternative would be to remove the option completely, but I don't
> know if that would be a popular choice.  the backtrace and map dump
> is informative, but I don't know how many developers actually
> understand it.  Even if we keep it as a non-default option, we'll
> have to fix the deadlock and the stack overflow.

I think we should really consider removal.  Most distributions will
have core dump catchers once they start using a glibc version derived
from master.

Another issue in one of the glibc crash handlers is the user of
getenv, which will not work if a stack overflow has overwritten the
environment.

>> Maybe from a functionality point of view, this is the right thing
>> to do.
>> 
>> The test case is invalid for multiple reasons: the compiler can
>> detect that the pointer arithmetic before the allocated buffer is
>> invalid. There is a use-after-free.  Maybe it's possible to fix
>> this with -ffreestanding; I don't know if the glibc headers obey
>> that, though.
> 
> This is intentional to induce a memory corruption that results in
> the deadlock.

I get that, I was suggesting a way to future-proof the test case
against compiler changes.

-- 
Florian Weimer / Red Hat Product Security


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]