mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 13:38:01 +00:00
cf: Undef _FORTIFY_SOURCE for use-after-free check
Commit f2003ed68c (gcc: Avoid false positive use-after-free in crypto) added a configure check to detect whether the compiler we're using exhibits the use-after-free warning bug. We add -O0 to CFLAGS for the test to make sure the bug triggers for gcc 12, but if the user has specified, for example, CFLAGS=-D_FORTIFY_SOURCE=1, this causes the compile check to always fail: /usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] # warning _FORTIFY_SOURCE requires compiling with optimization (-O) This causes _OPENAFS_UAF_COMPILE_IFELSE to always fail, and so we throw an AC_MSG_ERROR during configure. To allow the build to continue with _FORTIFY_SOURCE, make sure _FORTIFY_SOURCE is undefined for this specific test. The compile test can then succeed with -O0 (unless we trigger the use-after-free bug, of course). Reviewed-on: https://gerrit.openafs.org/15499 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> (cherry picked from commit 2e6b80e4bcdb476e95c8cff46ebaae69f092abec) Change-Id: Ibafe136c2d0364741f0ea2e3d823e181d7983f20 Reviewed-on: https://gerrit.openafs.org/15518 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
03bc379df9
commit
128772e328
@ -31,7 +31,7 @@ AC_DEFUN([OPENAFS_GCC_UAF_BUG_CHECK],[
|
|||||||
AS_IF([test "x$GCC" = "xyes"], [
|
AS_IF([test "x$GCC" = "xyes"], [
|
||||||
AC_MSG_CHECKING([gcc use-after-free warning bug])
|
AC_MSG_CHECKING([gcc use-after-free warning bug])
|
||||||
ac_save_CFLAGS="$CFLAGS"
|
ac_save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -Wall -Werror -O0"
|
CFLAGS="$CFLAGS -Wall -Werror -O0 -U_FORTIFY_SOURCE"
|
||||||
_OPENAFS_UAF_COMPILE_IFELSE(
|
_OPENAFS_UAF_COMPILE_IFELSE(
|
||||||
[AC_MSG_RESULT(no)],
|
[AC_MSG_RESULT(no)],
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user