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:	Thu, 6 Jun 2013 13:55:55 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Al Viro <viro@...iv.linux.org.uk>,
	Guy Streeter <streeter@...hat.com>,
	Eric Paris <eparis@...hat.com>,
	David Woodhouse <dwmw2@...radead.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -mm 1/1] audit: cleanup audit_log_start/wait_for_auditd
 mess

On Mon, 3 Jun 2013 22:46:20 +0200 Oleg Nesterov <oleg@...hat.com> wrote:

> audit_log_start() tries to obfusticate the code/logic and
> reimplements wait_event_timeout() in a very confusing way.
> 
> Just change wait_for_auditd() to use wait_event_timeout()
> and return bool.
> 
> Also remove the unnecessary "ab = NULL" initialization.

I would prefer that this be nicely tested - for a cosmetic thing I
don't think it's worth the risk as-is.

> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -1051,20 +1051,19 @@ static inline void audit_get_stamp(struct audit_context *ctx,
>  }
>  
>  /*
> - * Wait for auditd to drain the queue a little
> + * Wait for auditd to drain audit_skb_queue if it is full
>   */
> -static void wait_for_auditd(unsigned long sleep_time)
> +static bool wait_for_auditd(gfp_t gfp_mask)
>  {
> -	DECLARE_WAITQUEUE(wait, current);
> -	set_current_state(TASK_UNINTERRUPTIBLE);
> -	add_wait_queue(&audit_backlog_wait, &wait);
> -
> -	if (audit_backlog_limit &&
> -	    skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
> -		schedule_timeout(sleep_time);
> -
> -	__set_current_state(TASK_RUNNING);
> -	remove_wait_queue(&audit_backlog_wait, &wait);
> +	/* Atomic callers use can 5 more entries over the limit */

"can use"

> +	if (!(gfp_mask & __GFP_WAIT))
> +		return skb_queue_len(&audit_skb_queue) <=
> +					audit_backlog_limit + 5;
> +
> +	return wait_event_timeout(audit_backlog_wait,
> +		!audit_backlog_limit ||
> +			skb_queue_len(&audit_skb_queue) <= audit_backlog_limit,
> +		audit_backlog_wait_time);
>  }
>
> ...
>
--
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