aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorTejun Heo <[email protected]>2011-06-17 14:50:35 +0000
committerOleg Nesterov <[email protected]>2011-06-22 17:26:28 +0000
commit643ad8388e189dfd14ef76972cf7dc394b3cbebd (patch)
tree82d4787ddc09cf5a6fc9fc1345839973ab7763f5 /security/selinux/hooks.c
parentptrace: kill task_ptrace() (diff)
downloadkernel-643ad8388e189dfd14ef76972cf7dc394b3cbebd.tar.gz
kernel-643ad8388e189dfd14ef76972cf7dc394b3cbebd.zip
ptrace: introduce ptrace_event_enabled() and simplify ptrace_event() and tracehook_prepare_clone()
This patch implements ptrace_event_enabled() which tests whether a given PTRACE_EVENT_* is enabled and use it to simplify ptrace_event() and tracehook_prepare_clone(). PT_EVENT_FLAG() macro is added which calculates PT_TRACE_* flag from PTRACE_EVENT_*. This is used to define PT_TRACE_* flags and by ptrace_event_enabled() to find the matching flag. This is used to make ptrace_event() and tracehook_prepare_clone() simpler. * ptrace_event() callers were responsible for providing mask to test whether the event was enabled. This patch implements ptrace_event_enabled() and make ptrace_event() drop @mask and determine whether the event is enabled from @event. Note that @event is constant and this conversion doesn't add runtime overhead. All conversions except tracehook_report_clone_complete() are trivial. tracehook_report_clone_complete() used to use 0 for @mask (always enabled) but now tests whether the specified event is enabled. This doesn't cause any behavior difference as it's guaranteed that the event specified by @trace is enabled. * tracehook_prepare_clone() now only determines which event is applicable and use ptrace_event_enabled() for enable test. This doesn't introduce any behavior change. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Oleg Nesterov <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions