public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: Michal Schmidt <mschmidt@redhat•com>, netdev@vger•kernel.org
Cc: Nicolas Dichtel <nicolas.dichtel@6wind•com>,
	David Miller <davem@davemloft•net>
Subject: Re: [PATCH] netlink: rate-limit leftover bytes warning and print process name
Date: Fri, 30 May 2014 18:26:45 +0400	[thread overview]
Message-ID: <53889525.3080506@cogentembedded.com> (raw)
In-Reply-To: <1401454647-28228-1-git-send-email-mschmidt@redhat.com>

Hello.

On 05/30/2014 04:57 PM, Michal Schmidt wrote:

> Any process is able to send netlink messages with leftover bytes.
> Make the warning rate-limited to prevent too much log spam.

> The warning is supposed to help find userspace bugs, so print the
> triggering command name to implicate the buggy program.

> Signed-off-by: Michal Schmidt <mschmidt@redhat•com>
> ---
>   lib/nlattr.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

> diff --git a/lib/nlattr.c b/lib/nlattr.c
> index fc67547..31047c4 100644
> --- a/lib/nlattr.c
> +++ b/lib/nlattr.c
> @@ -201,8 +201,9 @@ int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
>   	}
>
>   	if (unlikely(rem > 0))
> -		printk(KERN_WARNING "netlink: %d bytes leftover after parsing "
> -		       "attributes.\n", rem);
> +		printk_ratelimited(KERN_WARNING

    Better pr_warn_ratelimited().

> +				   "netlink: %d bytes leftover after parsing attributes in process `%s'.\n",
> +				   rem, current->comm);

WBR, Sergei

  reply	other threads:[~2014-05-30 14:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27 13:16 [PATCH] netlink: downgrade warning about leftover bytes to debug level Michal Schmidt
2014-05-28  7:42 ` Nicolas Dichtel
2014-05-28  9:18   ` Michal Schmidt
2014-05-28 12:47     ` Nicolas Dichtel
2014-05-30 12:57       ` [PATCH] netlink: rate-limit leftover bytes warning and print process name Michal Schmidt
2014-05-30 14:26         ` Sergei Shtylyov [this message]
2014-06-02 16:25           ` [PATCH v2] " Michal Schmidt
2014-06-02 18:16             ` David Miller
2014-05-31  0:16         ` [PATCH] " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53889525.3080506@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=mschmidt@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nicolas.dichtel@6wind$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox