Commit ab6434a1 authored by Paul Moore's avatar Paul Moore

audit: move audit_signal_info() into kernel/auditsc.c

Commit 5b52330b ("audit: fix auditd/kernel connection state
tracking") made inlining audit_signal_info() a bit pointless as
it was always calling into auditd_test_task() so let's remove the
inline function in kernel/audit.h and convert __audit_signal_info()
in kernel/auditsc.c into audit_signal_info().
Reviewed-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 5b52330b
...@@ -333,13 +333,7 @@ extern u32 audit_sig_sid; ...@@ -333,13 +333,7 @@ extern u32 audit_sig_sid;
extern int audit_filter(int msgtype, unsigned int listtype); extern int audit_filter(int msgtype, unsigned int listtype);
#ifdef CONFIG_AUDITSYSCALL #ifdef CONFIG_AUDITSYSCALL
extern int __audit_signal_info(int sig, struct task_struct *t); extern int audit_signal_info(int sig, struct task_struct *t);
static inline int audit_signal_info(int sig, struct task_struct *t)
{
if (auditd_test_task(t) || (audit_signals && !audit_dummy_context()))
return __audit_signal_info(sig, t);
return 0;
}
extern void audit_filter_inodes(struct task_struct *, struct audit_context *); extern void audit_filter_inodes(struct task_struct *, struct audit_context *);
extern struct list_head *audit_killed_trees(void); extern struct list_head *audit_killed_trees(void);
#else #else
......
...@@ -2249,26 +2249,27 @@ void __audit_ptrace(struct task_struct *t) ...@@ -2249,26 +2249,27 @@ void __audit_ptrace(struct task_struct *t)
* If the audit subsystem is being terminated, record the task (pid) * If the audit subsystem is being terminated, record the task (pid)
* and uid that is doing that. * and uid that is doing that.
*/ */
int __audit_signal_info(int sig, struct task_struct *t) int audit_signal_info(int sig, struct task_struct *t)
{ {
struct audit_aux_data_pids *axp; struct audit_aux_data_pids *axp;
struct task_struct *tsk = current; struct task_struct *tsk = current;
struct audit_context *ctx = tsk->audit_context; struct audit_context *ctx = tsk->audit_context;
kuid_t uid = current_uid(), t_uid = task_uid(t); kuid_t uid = current_uid(), t_uid = task_uid(t);
if (auditd_test_task(t)) { if (auditd_test_task(t) &&
if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) { (sig == SIGTERM || sig == SIGHUP ||
audit_sig_pid = task_tgid_nr(tsk); sig == SIGUSR1 || sig == SIGUSR2)) {
if (uid_valid(tsk->loginuid)) audit_sig_pid = task_tgid_nr(tsk);
audit_sig_uid = tsk->loginuid; if (uid_valid(tsk->loginuid))
else audit_sig_uid = tsk->loginuid;
audit_sig_uid = uid; else
security_task_getsecid(tsk, &audit_sig_sid); audit_sig_uid = uid;
} security_task_getsecid(tsk, &audit_sig_sid);
if (!audit_signals || audit_dummy_context())
return 0;
} }
if (!audit_signals || audit_dummy_context())
return 0;
/* optimize the common case by putting first signal recipient directly /* optimize the common case by putting first signal recipient directly
* in audit_context */ * in audit_context */
if (!ctx->target_pid) { if (!ctx->target_pid) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment