[PATCH] D54473: [sanitizers] Initial implementation for -fsanitize=init-locals

Alexander Potapenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 13 07:16:31 PST 2018


glider created this revision.
glider added reviewers: kcc, rjmccall, rsmith.
Herald added a subscriber: cfe-commits.

This patch adds a new feature, -fsanitize=init-locals, which generates zero initializers for uninitialized local variables.

There's been discussions in the security community about the impact of zero-initializing all locals to prevent information leaks. The new feature shall help evaluating the pros and cons of such an approach.

Credits for the code go to Daniel Micay (original patch is at https://github.com/AndroidHardeningArchive/platform_external_clang/commit/776a0955ef6686d23a82d2e6a3cbd4a6a882c31c)


Repository:
  rC Clang

https://reviews.llvm.org/D54473

Files:
  include/clang/Basic/Sanitizers.def
  lib/CodeGen/CGDecl.cpp
  lib/Driver/ToolChain.cpp
  test/CodeGen/sanitize-init-locals.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54473.173841.patch
Type: text/x-patch
Size: 5005 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181113/b09575e7/attachment.bin>


More information about the cfe-commits mailing list