diff options
author | Sergey Matveev <earthdok@google.com> | 2014-02-12 19:29:49 +0000 |
---|---|---|
committer | Sergey Matveev <earthdok@google.com> | 2014-02-12 19:29:49 +0000 |
commit | d47031b9f0439a6adffbb8b1c81ce5898fda4469 (patch) | |
tree | b05a6fce9695f11bf4f3006ba7feaf29c8efd664 /lib/sanitizer_common/sanitizer_common_syscalls.inc | |
parent | 225daaab05fdd2b45ea89e5c39cc172388016365 (diff) |
[sanitizer] Intercept capget()/capset().
Also, fix incorrect syscall hooks for the corresponding syscalls.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_syscalls.inc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common_syscalls.inc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc index d8f348dab..4bae308e0 100644 --- a/lib/sanitizer_common/sanitizer_common_syscalls.inc +++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc @@ -388,24 +388,21 @@ PRE_SYSCALL(acct)(const void *name) { POST_SYSCALL(acct)(long res, const void *name) {} -PRE_SYSCALL(capget)(void *header, void *dataptr) {} +PRE_SYSCALL(capget)(void *header, void *dataptr) { + if (header) PRE_READ(header, __user_cap_header_struct_sz); +} POST_SYSCALL(capget)(long res, void *header, void *dataptr) { - if (res >= 0) { - if (header) POST_WRITE(header, __user_cap_header_struct_sz); + if (res >= 0) if (dataptr) POST_WRITE(dataptr, __user_cap_data_struct_sz); - } } PRE_SYSCALL(capset)(void *header, const void *data) { + if (header) PRE_READ(header, __user_cap_header_struct_sz); if (data) PRE_READ(data, __user_cap_data_struct_sz); } -POST_SYSCALL(capset)(long res, void *header, const void *data) { - if (res >= 0) { - if (header) POST_WRITE(header, __user_cap_header_struct_sz); - } -} +POST_SYSCALL(capset)(long res, void *header, const void *data) {} PRE_SYSCALL(personality)(long personality) {} |