Bug 13583 - AVX check not done correctly for strcasecmp
Summary: AVX check not done correctly for strcasecmp
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
Depends on:
Reported: 2012-01-11 14:13 UTC by Pierre Bourdon
Modified: 2014-06-27 11:13 UTC (History)
1 user (show)

See Also:
Last reconfirmed:
fweimer: security-


Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Bourdon 2012-01-11 14:13:04 UTC
According to Intel manuals, checking for AVX has to be done by checking AVX and OS XSAVE support in CPUID + XFEATURE_ENABLED_MASK via xgetbv. However, for strcasecmp, AVX is checked by testing the AVX bit in the cpuid.

This makes systems using glibc-2.15 unbootable under current versions of Xen when the CPU supports AVX because Xen does not have XSAVE support. On these systems, strcasecmp fails with a SIGILL when executing vmovdqa.

Bad check is here:

Example of a good check:
Comment 1 Ulrich Drepper 2012-01-26 12:46:20 UTC
I checked in a patch.
Comment 2 Ulrich Drepper 2012-01-26 14:48:35 UTC
Actually, strcmp cannot have problems since the code only uses the AVX instruction encoding, not the YMM registers.  Therefore any problem in that area must have a completely different reason.  There is code which potentially uses the YMM registers and I added protection there.
Comment 3 Jackie Rosen 2014-02-16 17:51:09 UTC Comment hidden (spam)