]> git.ipfire.org Git - thirdparty/krb5.git/commit
Make zap() more reliable
authorGreg Hudson <ghudson@mit.edu>
Mon, 31 Oct 2016 15:48:54 +0000 (11:48 -0400)
committerTom Yu <tlyu@mit.edu>
Wed, 9 Nov 2016 18:53:54 +0000 (13:53 -0500)
commit100e4aa16ea03faac8346382ee0ba07c84c3df45
treea1ec3cb3976c6e8e6632c405f31136354e199c9d
parent71a11259a401aac2997193271c69bffce0260141
Make zap() more reliable

The gcc assembly version of zap() could still be optimized out under
gcc 5.1 or later, and the krb5int_zap() function could be optimized
out with link-time optimization.  Based on work by Zhaomo Yang and
Brian Johannesmeyer, use the C11 memset_s() when available, then fall
back to a memory barrier with gcc or clang, and finally fall back to
using krb5int_zap().  Modify krb5int_zap() to use a volatile pointer
in case link-time optimization is used.

(cherry picked from commit c163275f899b201dc2807b3ff2949d5e2ee7d838)

ticket: 8514
version_fixed: 1.15
src/aclocal.m4
src/include/k5-int.h
src/util/support/zap.c