Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: tests/test_patching_input.S

Issue 8596009: Add test for patching a system call instruction (Closed) Base URL: https://seccompsandbox.googlecode.com/svn/trunk
Patch Set: Add comment Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/test_patching_input.S
diff --git a/tests/test_patching_input.S b/tests/test_patching_input.S
new file mode 100644
index 0000000000000000000000000000000000000000..3e7126d331b1611c792c1496728f0263c223b17b
--- /dev/null
+++ b/tests/test_patching_input.S
@@ -0,0 +1,26 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <asm/unistd.h>
+
+
+ // This performs a system call directly so that we can test
+ // patching this instruction sequence.
+
+ .global my_getpid
+ .global my_getpid_end
+my_getpid:
+ mov $__NR_getpid, %eax
+#if defined(__x86_64__)
+ syscall
+#elif defined(__i386__)
+ int $0x80
+#else
+# error Unsupported target platform
+#endif
+ ret
+my_getpid_end:
+
+ // Tell Linux not to disable no-execute protection for the process.
+ .section .note.GNU-stack,"",@progbits
« tests/test_patching.cc ('K') | « tests/test_patching.cc ('k') | tests/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698