From: | ghudson@mit.edu |
Subject: | git commit |
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.
https://github.com/krb5/krb5/commit/c163275f899b201dc2807b3ff2949d5e2ee7d838
Author: Greg Hudson <ghudson@mit.edu>
Commit: c163275f899b201dc2807b3ff2949d5e2ee7d838
Branch: master
src/aclocal.m4 | 2 ++
src/include/k5-int.h | 43 +++++++++++++++++++++++--------------------
src/util/support/zap.c | 5 ++++-
3 files changed, 29 insertions(+), 21 deletions(-)