diff mbox

xfrm: use printk instead of WARN for bad policy reporting

Message ID 1469003555-30599-1-git-send-email-vegard.nossum@oracle.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Vegard Nossum July 20, 2016, 8:32 a.m. UTC
AFAICT this message is just printed whenever input validation fails.
This is a normal failure and we shouldn't be dumping the stack over it.

Looks like it was originally a printk that was maybe incorrectly
upgraded to a WARN:

commit 62db5cfd70b1ef53aa21f144a806fe3b78c84fab
Author: stephen hemminger <shemminger@vyatta.com>
Date:   Wed May 12 06:37:06 2010 +0000

    xfrm: add severity to printk

Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
 net/xfrm/xfrm_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vegard Nossum July 20, 2016, 11:53 a.m. UTC | #1
On 07/20/2016 10:32 AM, Vegard Nossum wrote:
> AFAICT this message is just printed whenever input validation fails.
> This is a normal failure and we shouldn't be dumping the stack over it.
>
> Looks like it was originally a printk that was maybe incorrectly
> upgraded to a WARN:
>
> commit 62db5cfd70b1ef53aa21f144a806fe3b78c84fab
> Author: stephen hemminger <shemminger@vyatta.com>
> Date:   Wed May 12 06:37:06 2010 +0000
>
>      xfrm: add severity to printk

Just FYI I'm also running into the

// reset the timers here?
WARN(1, "Don't know what to do with soft policy expire\n");

in xfrm_add_pol_expire() from the same commit, but that looks
potentially somewhat more serious (or at least it looks like we might
want to do some sort of cleaning up), so I won't touch it for now.

Added some more XFRM people to Cc.


Vegard

 > Cc: Stephen Hemminger <stephen@networkplumber.org>
 > Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
 > ---
 >   net/xfrm/xfrm_user.c | 2 +-
 >   1 file changed, 1 insertion(+), 1 deletion(-)
 >
 > diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
 > index 4fb04ce..0b81bfc 100644
 > --- a/net/xfrm/xfrm_user.c
 > +++ b/net/xfrm/xfrm_user.c
 > @@ -2150,7 +2150,7 @@ static int xfrm_add_acquire(struct sk_buff 
*skb, struct nlmsghdr *nlh,
 >   	return 0;
 >
 >   bad_policy:
 > -	WARN(1, "BAD policy passed\n");
 > +	printk(KERN_WARNING "xfrm_user: bad policy passed\n");
 >   free_state:
 >   	kfree(x);
 >   nomem:
 >
Steffen Klassert July 20, 2016, 12:15 p.m. UTC | #2
On Wed, Jul 20, 2016 at 10:32:35AM +0200, Vegard Nossum wrote:
> AFAICT this message is just printed whenever input validation fails.
> This is a normal failure and we shouldn't be dumping the stack over it.
> 
> Looks like it was originally a printk that was maybe incorrectly
> upgraded to a WARN:
> 
> commit 62db5cfd70b1ef53aa21f144a806fe3b78c84fab
> Author: stephen hemminger <shemminger@vyatta.com>
> Date:   Wed May 12 06:37:06 2010 +0000
> 
>     xfrm: add severity to printk
> 
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
>  net/xfrm/xfrm_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
> index 4fb04ce..0b81bfc 100644
> --- a/net/xfrm/xfrm_user.c
> +++ b/net/xfrm/xfrm_user.c
> @@ -2150,7 +2150,7 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh,
>  	return 0;
>  
>  bad_policy:
> -	WARN(1, "BAD policy passed\n");
> +	printk(KERN_WARNING "xfrm_user: bad policy passed\n");

Why should we print here anything at all? If it is a normal
configuration error, we should remove the printing.
Herbert Xu July 27, 2016, 3:01 a.m. UTC | #3
On Wed, Jul 20, 2016 at 01:53:12PM +0200, Vegard Nossum wrote:
> On 07/20/2016 10:32 AM, Vegard Nossum wrote:
> >AFAICT this message is just printed whenever input validation fails.
> >This is a normal failure and we shouldn't be dumping the stack over it.
> >
> >Looks like it was originally a printk that was maybe incorrectly
> >upgraded to a WARN:
> >
> >commit 62db5cfd70b1ef53aa21f144a806fe3b78c84fab
> >Author: stephen hemminger <shemminger@vyatta.com>
> >Date:   Wed May 12 06:37:06 2010 +0000
> >
> >     xfrm: add severity to printk
> 
> Just FYI I'm also running into the
> 
> // reset the timers here?
> WARN(1, "Don't know what to do with soft policy expire\n");
> 
> in xfrm_add_pol_expire() from the same commit, but that looks
> potentially somewhat more serious (or at least it looks like we might
> want to do some sort of cleaning up), so I won't touch it for now.

It certainly shouldn't be a WARN, it probably shouldn't print
anything either.

Cheers,
diff mbox

Patch

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 4fb04ce..0b81bfc 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2150,7 +2150,7 @@  static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh,
 	return 0;
 
 bad_policy:
-	WARN(1, "BAD policy passed\n");
+	printk(KERN_WARNING "xfrm_user: bad policy passed\n");
 free_state:
 	kfree(x);
 nomem: