Re: [PATCH 2.6.11.2][RFC] printk with anti-cluttering-feature

From: Bodo Eggert
Date: Sun Mar 20 2005 - 08:47:44 EST


On Sun, 20 Mar 2005, Michael Tokarev wrote:
> Bodo Eggert wrote:

> > (please CC me on reply)
> >
> > Issue:
> >
> > On some conditions, the dmesg is spammed with repeated warnings about the
> > same issue which is neither critical nor going to be fixed. This may
> > result in losing the boot messages or missing other important messages.
>
> There's printk_ratelimit() already, used in quite several places in kernel
> (or net_ratelimit() for net/* stuff). See also Documentation/sysctl/kernel.txt,
> search for printk_ratelimit. JFYI.

ACK, but that's designed to work against a DoS, not against cluttering the
log. The messages I want to suppress are low-frequent.

I now realize that some of these warnings may be triggered by userspace,
and since userspace-triggered warnings are a possible DoS, these parts of
code should be rate-limited, too. I think it's best to include a
rate-limit check in my printk_nospam to make it work against slow log
spamming _and_ DoS.

--
"Don't ever be the first, don't ever be the last, and don't ever
volunteer to do anything."
-U. S Navy Swabbie
Friß, Spammer: vital@xxxxxxxxxxxxxx nlhl@xxxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/