Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62fedca5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'stable-4.11' of git://git.infradead.org/users/pcmoore/audit

Pull audit cleanup from Paul Moore:
 "A week later than I had hoped, but as promised, here is the audit
  uninline-fix we talked about during the last audit pull request.

  The patch is slightly different than what we originally discussed as
  it made more sense to keep the audit_signal_info() function in
  auditsc.c rather than move it and bunch of other related
  variables/definitions into audit.c/audit.h.

  At some point in the future I need to look at how the audit code is
  organized across kernel/audit*, I suspect we could do things a bit
  better, but it doesn't seem like a -rc release is a good place for
  that ;)

  Regardless, this patch passes our tests without problem and looks good
  for v4.11"

* 'stable-4.11' of git://git.infradead.org/users/pcmoore/audit:
  audit: move audit_signal_info() into kernel/auditsc.c
parents 56c29979 ab6434a1
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -333,13 +333,7 @@ extern u32 audit_sig_sid;
extern int audit_filter(int msgtype, unsigned int listtype);

#ifdef CONFIG_AUDITSYSCALL
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 int audit_signal_info(int sig, struct task_struct *t);
extern void audit_filter_inodes(struct task_struct *, struct audit_context *);
extern struct list_head *audit_killed_trees(void);
#else
+13 −12
Original line number Diff line number Diff line
@@ -2249,15 +2249,16 @@ void __audit_ptrace(struct task_struct *t)
 * If the audit subsystem is being terminated, record the task (pid)
 * 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 task_struct *tsk = current;
	struct audit_context *ctx = tsk->audit_context;
	kuid_t uid = current_uid(), t_uid = task_uid(t);

	if (auditd_test_task(t)) {
		if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) {
	if (auditd_test_task(t) &&
	    (sig == SIGTERM || sig == SIGHUP ||
	     sig == SIGUSR1 || sig == SIGUSR2)) {
		audit_sig_pid = task_tgid_nr(tsk);
		if (uid_valid(tsk->loginuid))
			audit_sig_uid = tsk->loginuid;
@@ -2265,9 +2266,9 @@ int __audit_signal_info(int sig, struct task_struct *t)
			audit_sig_uid = uid;
		security_task_getsecid(tsk, &audit_sig_sid);
	}

	if (!audit_signals || audit_dummy_context())
		return 0;
	}

	/* optimize the common case by putting first signal recipient directly
	 * in audit_context */