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]
Message-ID: <20160706094034.281e52c2@gandalf.local.home>
Date:	Wed, 6 Jul 2016 09:40:34 -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.1 1/2] ratelimit: Extend to print suppressed
 messages on release

On Wed, 6 Jul 2016 15:28:00 +0200
Borislav Petkov <bp@...en8.de> wrote:

>  extern struct ratelimit_state printk_ratelimit_state;
> diff --git a/lib/ratelimit.c b/lib/ratelimit.c
> index 2c5de86460c5..734cba5c8842 100644
> --- a/lib/ratelimit.c
> +++ b/lib/ratelimit.c
> @@ -46,12 +46,15 @@ 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);
> -		rs->begin   = jiffies;
> -		rs->printed = 0;
> -		rs->missed  = 0;
> +		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;
> +		}

Hmm, the above changes the previous logic. That seems wrong.

Before:

	if (rs->missed)
		[...]
	rs->begin = jiffies;
	rs->printed = 0;

after:

	if (rs->missed) {
		rs->begin = jiffies;
		rs->printed = 0;
	}

I think you wanted:

	if (rs->missed) {
		if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) {
			[..]
			rs->missed = 0;
		}
	}
	rs->begin = jiffies;
	rs->printed = 0;

-- Steve



>  	}
>  	if (rs->burst && rs->burst > rs->printed) {
>  		rs->printed++;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ