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:	Wed, 6 Jul 2016 21:17:52 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Borislav Petkov <bp@...en8.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Franck Bui <fbui@...e.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
Subject: Re: [PATCH -v3.2 1/2] ratelimit: Extend to print suppressed
 messages on release

On Wed, 6 Jul 2016 16:59:29 +0200
Borislav Petkov <bp@...en8.de> wrote:

> +static inline void ratelimit_state_exit(struct ratelimit_state *rs)
> +{
> +	if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE))
> +		return;
> +
> +	if (rs->missed)
> +		printk(KERN_WARNING "%s: %d output lines suppressed due to ratelimiting\n",
> +		       current->comm, rs->missed);

Hmm, should this clear the missed flag? Especially since it isn't
cleared below.

-- Steve

> +}
> +
> +static inline void
> +ratelimit_set_flags(struct ratelimit_state *rs, unsigned long flags)
> +{
> +	rs->flags = flags;
>  }
>  
>  extern struct ratelimit_state printk_ratelimit_state;
> diff --git a/lib/ratelimit.c b/lib/ratelimit.c
> index 2c5de86460c5..08f8043cac61 100644
> --- a/lib/ratelimit.c
> +++ b/lib/ratelimit.c
> @@ -46,12 +46,14 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
>  		rs->begin = jiffies;
>  
>  	if (time_is_before_jiffies(rs->begin + rs->interval)) {
> -		if (rs->missed)
> -			printk(KERN_WARNING "%s: %d callbacks suppressed\n",
> -				func, rs->missed);
> +		if (rs->missed) {
> +			if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) {
> +				pr_warn("%s: %d callbacks suppressed\n", func, rs->missed);
> +				rs->missed = 0;
> +			}
> +		}
>  		rs->begin   = jiffies;
>  		rs->printed = 0;
> -		rs->missed  = 0;
>  	}
>  	if (rs->burst && rs->burst > rs->printed) {
>  		rs->printed++;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ