Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) From: tlyu@mit.edu Subject: git commit RT-Send-CC: X-RT-Original-Encoding: iso-8859-1 Content-Length: 963 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) https://github.com/krb5/krb5/commit/100e4aa16ea03faac8346382ee0ba07c84c3df45 Author: Greg Hudson Committer: Tom Yu Commit: 100e4aa16ea03faac8346382ee0ba07c84c3df45 Branch: krb5-1.15 src/aclocal.m4 | 2 ++ src/include/k5-int.h | 43 +++++++++++++++++++++++-------------------- src/util/support/zap.c | 5 ++++- 3 files changed, 29 insertions(+), 21 deletions(-)