lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 1 Dec 2009 19:22:02 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	Christoph Hellwig <hch@...radead.org>,
	Nick Piggin <npiggin@...e.de>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	James Morris <jmorris@...ei.org>
Subject: Re: [PATCH] audit: Call tty_audit_push_task() outside preempt
	disabled region

On 12/01, Thomas Gleixner wrote:
>
> -void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid)
> +int tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid)
>  {
> -	struct tty_audit_buf *buf;
> +	struct tty_audit_buf *buf = NULL;
> +	unsigned long flags;
>
> -	spin_lock_irq(&tsk->sighand->siglock);
> -	buf = tsk->signal->tty_audit_buf;
> -	if (buf)
> +	if (!lock_task_sighand(tsk, &flags))
> +		return -ESRCH;
> +
> +	if (tsk->signal->audit_tty && tsk->signal->tty_audit_buf) {
> +		buf = tsk->signal->tty_audit_buf;
>  		atomic_inc(&buf->count);
> -	spin_unlock_irq(&tsk->sighand->siglock);
> +	}
> +	unlock_task_sighand(tsk, &flags);
> +
>  	if (!buf)
> -		return;
> +		return -EPERM;

I think the patch is correct, but it changes the behaviour of
audit_prepare_user_tty() a bit.

Suppose that signal->audit_tty != NULL but signal->tty_audit_buf
is not allocated yet. In this audit_prepare_user_tty() returns 0
before the patch and -EPERM after.

I do not know if this matters, just to be sure this is OK.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ