This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Jeff Law <law at redhat dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, Rich Felker <dalias at aerifal dot cx>, libc-alpha at sourceware dot org
- Date: Wed, 23 Oct 2013 10:56:38 +0200
- Subject: Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Authentication-results: sourceware.org; auth=none
- References: <524DCA52 dot 2030609 at redhat dot com> <20131007141928 dot GV20515 at brightrain dot aerifal dot cx> <52542C63 dot 10305 at redhat dot com> <20131008162738 dot GG20515 at brightrain dot aerifal dot cx> <52545389 dot 6000901 at redhat dot com> <52545730 dot 6090306 at redhat dot com> <52559822 dot 2010802 at redhat dot com> <525598F6 dot 3000907 at redhat dot com> <52559A2E dot 6080504 at redhat dot com> <5255AB69 dot 6030107 at redhat dot com>
On Wed, Oct 09, 2013 at 01:15:53PM -0600, Jeff Law wrote:
> On 10/09/13 12:02, Carlos O'Donell wrote:
> >On 10/09/2013 01:57 PM, Jeff Law wrote:
> >>On 10/09/13 11:53, Carlos O'Donell wrote:
> >>>Right, you could wrap everything up and check all inputs against
> >>>non-NULL where the headers say __attribute__ ((__nonnull__
> >>>params)) or __nonnull(params) (short-hand in glibc).
> >>But using the attributes are compile-time checks only. Using an
> >>LD_PRELOAD provides runtime checking
> >
> >I agree, what I want to say was that to automatically generate the
> >wrappers and check against null parameters you can parse the public
> >headers and look for glibc's __nonnull markups?
> Oh, yea, I guess that could be done. Never thought of that.
>
> jeff
I realized that for this case should be handled at gcc part. A
preloading could find all nonnull violations for glibc functions but
if gcc automatically adds null check when compiled with FORTIFY_SOURCE
(or -fcheck-nonnull) then we could check violations everywhere.
Second benefit is that gcc will optimize checks that are not needed.
Is there PR for it or should I file one?
- References:
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)
- Re: [PATCH][BZ #13724] Do not segfault in pthread_setname_np (x, NULL)