[PATCH] Protection against stack-based memory corruption errors using SafeStack

Peter Collingbourne peter at pcc.me.uk
Fri Apr 10 18:52:46 PDT 2015


Just some random observations as I work on refreshing this patch against trunk.


================
Comment at: test/CodeGen/X86/safestack.ll:1
@@ +1,2 @@
+; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-I386 %s
+; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | FileCheck --check-prefix=LINUX-X64 %s
----------------
This will become a much more precise IR-level test.

================
Comment at: test/CodeGen/X86/safestack.ll:379
@@ +378,3 @@
+;          safestack attribute
+; Requires no protector.
+define void @test7b() nounwind uwtable readnone safestack {
----------------
What? This seems like it needs protection to me. The callee could store the integer somewhere, or use inttoptr, or something.

================
Comment at: test/CodeGen/X86/safestack.ll:1332
@@ +1331,3 @@
+; Requires no protector.
+define i32 @test25a() nounwind uwtable {
+entry:
----------------
We don't need 25 separate tests that the pass can check function attributes correctly. Just one is enough.

http://reviews.llvm.org/D6094

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list