This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Potential issue with strstr on x86 with sse4.2 in glibc-2.18
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Rich Felker <dalias at aerifal dot cx>
- Cc: Andreas Schwab <schwab at suse dot de>, Allan McRae <allan at archlinux dot org>, Alexander Monakov <amonakov at ispras dot ru>, <libc-alpha at sourceware dot org>
- Date: Tue, 20 Aug 2013 13:40:56 +0000
- Subject: Re: Potential issue with strstr on x86 with sse4.2 in glibc-2.18
- References: <520E181D dot 2040308 at archlinux dot org> <alpine dot LNX dot 2 dot 00 dot 1308191628370 dot 2626 at monopod dot intra dot ispras dot ru> <20130819144648 dot GF20515 at brightrain dot aerifal dot cx> <alpine dot LNX dot 2 dot 00 dot 1308191924490 dot 2626 at monopod dot intra dot ispras dot ru> <5212A278 dot 3090909 at archlinux dot org> <20130819230644 dot GM20515 at brightrain dot aerifal dot cx> <5212E278 dot 4030703 at archlinux dot org> <20130820033430 dot GN20515 at brightrain dot aerifal dot cx> <20130820043956 dot GO20515 at brightrain dot aerifal dot cx> <mvm1u5oon01 dot fsf at hawking dot suse dot de> <20130820074329 dot GP20515 at brightrain dot aerifal dot cx>
On Tue, 20 Aug 2013, Rich Felker wrote:
> Also, I question whether the set of files that use callbacks is
> complete. Due to fopencookie and register_printf_function, all of
> stdio could potentially call application code. I suspect there are a
> lot more places like this where, due to glibc extensions, functions
> which seemingly do not use callbacks actually might... (malloc?)
As I noted in <http://sourceware.org/ml/libc-alpha/2012-11/msg00147.html>,
printf should logically be using $(uses-callbacks) but is actually using
$(exceptions).
I've expanded the corresponding item on the wiki todo list to request
better consistency checks. But I suspect there will be lots of false
positives - libc functions can call snprintf internally using only
standard formats, for example, and it would be undefined behavior if a
user had overridden those standard formats at that time, so the fact that
a library function calls snprintf does not mean that function can use
callbacks even though snprintf can - unless it calls snprintf with a fully
user-controlled format, in which case of course it does need to allow for
user callbacks. Likewise, use of qsort with a callback function defined
within the library is always fine.
--
Joseph S. Myers
joseph@codesourcery.com