Home GnuPG

hwf-x86: fix use of wrong operand type

Description

hwf-x86: fix use of wrong operand type

* src/hwf-x86.c (get_cpuid): Use xchg for swapping %ebx back
and forth between operand register.

HW feature routine was giving wrong results with certain compiler &
compiler flag combinations on i386. Issue was that "=g" operand was
used which caused problem if compiler allocated %ebx register for
this operand. CPUID assembly block attempts to save %ebx as in older
GCC versions this register was fixed for GOT pointer use and could
not be modified otherwise (could not be used as operand or clobber).

(cherry picked from commit ec87511d9cd2dc31434e939b6351d74a38d4ceaa)

  • Reported-by: Iru Cai <vimacs@disroot.org>
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Apr 28 2021, 6:19 PM
wernerCommitted on Aug 22 2021, 2:05 PM
Parents
rCdd14da42caed: doc: Clarify gcry_md_setkey for keyed BLAKE hashes.
Branches
Unknown
Tags
Unknown