This is the mail archive of the 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: Potential issue with strstr on x86 with sse4.2 in glibc-2.18

On Tue, Aug 20, 2013 at 09:11:10AM +0200, Andreas Schwab wrote:
> Rich Felker <> writes:
> > What may be viable is globally using -mpreferred-stack-boundary=2
> Please take a look at sysdeps/i386/Makefile.

Hmm, if the list of files which callback to non-libc code is complete,
and by complete I mean not just functions which directly make
callbacks, but also ones which indirectly do so, then I believe this
approach works as long as the compiler does not generate any code
which depends on the stack being aligned. It certainly avoids any
prologue bloat. However, if GCC happens to use SSE in any of the
functions to which -mpreferred-stack-boundary=4 gets applied, and the
application was compiled without 16-byte stack alignment, then crashes
can occur. These could be avoided by adding
-mincoming-stack-boundary=2 to all files, but of course that would
bring in the prologue.

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?)


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