[PATCH gnupg v4] Disable CPU speculation-related misfeatures

Werner Koch wk at gnupg.org
Mon Jul 7 18:36:19 CEST 2025


Hi!

On Sun,  6 Jul 2025 21:50, Guido Trentalancia said:

> common: Disable CPU speculation-related misfeatures

I would prefer to keep the subject clear of an opinion.

> +#if defined(__linux__)
> +# include <sys/prctl.h>
> +#endif

Good.  You now provide configure tests.  Please also add a general one
which checks for this header.

> +#if defined(__linux__)

And use that here ;-)

>  AC_CHECK_HEADERS([unistd.h langinfo.h termio.h locale.h \
>                    pwd.h inttypes.h signal.h sys/select.h sys/time.h \
>                    stdint.h signal.h termios.h \
> -                  ucred.h sys/ucred.h sys/sysmacros.h sys/mkdev.h])
> +                  ucred.h sys/ucred.h sys/sysmacros.h sys/mkdev.h \
> +                  sys/prctl.h])

Hey, you already got that macro.  Thus you can replace the above with

  #if defined(HAVE_SYS_PRCTL_H) && defined(__linux__)

and we are good.  The ifdef __linux__ here is so that we cater for OSes
which have such a header for different purposes.  Using the standard
configure test along with a ifdef in the code is a good compromise
between readibility and regualar autoconf style.


Shalom-Salam,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20250707/b87eda55/attachment.sig>


More information about the Gnupg-devel mailing list