SafeStack: Prevent OOB reads with mem intrinsics
authorVlad Tsyrklevich <vlad@tsyrklevich.net>
Thu, 30 Aug 2018 20:44:51 +0000 (20:44 +0000)
committerVlad Tsyrklevich <vlad@tsyrklevich.net>
Thu, 30 Aug 2018 20:44:51 +0000 (20:44 +0000)
commit2499aeead93a28cff56816c6ce7c093d227a0084
treecec8fefa533fbf9c87869b83e60fc59d6173aa0e
parente4c3c6c873bdb967ec6dc258939f7a6b908a269f
SafeStack: Prevent OOB reads with mem intrinsics

Summary:
Currently, the SafeStack analysis disallows out-of-bounds writes but not
out-of-bounds reads for mem intrinsics like llvm.memcpy. This could
cause leaks of pointers to the safe stack by leaking spilled registers/
frame pointers. Check for allocas used as source or destination pointers
to mem intrinsics.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: pcc, llvm-commits, kcc

Differential Revision: https://reviews.llvm.org/D51334

llvm-svn: 341116
llvm/lib/CodeGen/SafeStack.cpp
llvm/test/Transforms/SafeStack/X86/memintrinsic-oob-read.ll [new file with mode: 0644]