netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa()
@ 2014-02-05  7:38 Geert Uytterhoeven
  2014-02-05 17:30 ` Cong Wang
  2014-02-07  4:03 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-02-05  7:38 UTC (permalink / raw)
  To: David S. Miller, Jiri Pirko, Cong Wang
  Cc: netdev, linux-kernel, Geert Uytterhoeven

On m68k/ARAnyM:

WARNING: CPU: 0 PID: 407 at net/ipv4/devinet.c:1599 0x316a99()
Modules linked in:
CPU: 0 PID: 407 Comm: ifconfig Not tainted
3.13.0-atari-09263-g0c71d68014d1 #1378
Stack from 10c4fdf0:
        10c4fdf0 002ffabb 000243e8 00000000 008ced6c 00024416 00316a99 0000063f
        00316a99 00000009 00000000 002501b4 00316a99 0000063f c0a86117 00000080
        c0a86117 00ad0c90 00250a5a 00000014 00ad0c90 00000000 00000000 00000001
        00b02dd0 00356594 00000000 00356594 c0a86117 eff6c9e4 008ced6c 00000002
        008ced60 0024f9b4 00250b52 00ad0c90 00000000 00000000 00252390 00ad0c90
        eff6c9e4 0000004f 00000000 00000000 eff6c9e4 8000e25c eff6c9e4 80001020
Call Trace: [<000243e8>] warn_slowpath_common+0x52/0x6c
 [<00024416>] warn_slowpath_null+0x14/0x1a
 [<002501b4>] rtmsg_ifa+0xdc/0xf0
 [<00250a5a>] __inet_insert_ifa+0xd6/0x1c2
 [<0024f9b4>] inet_abc_len+0x0/0x42
 [<00250b52>] inet_insert_ifa+0xc/0x12
 [<00252390>] devinet_ioctl+0x2ae/0x5d6

Adding some debugging code reveals that net_fill_ifaddr() fails in

    put_cacheinfo(skb, ifa->ifa_cstamp, ifa->ifa_tstamp,
                              preferred, valid))

nla_put complains:

    lib/nlattr.c:454: skb_tailroom(skb) = 12, nla_total_size(attrlen) = 20

Apparently commit 5c766d642bcaffd0c2a5b354db2068515b3846cf ("ipv4:
introduce address lifetime") forgot to take into account the addition of
struct ifa_cacheinfo in inet_nlmsg_size(). Hence add it, like is already
done for ipv6.

Suggested-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 net/ipv4/devinet.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index ac2dff3c2c1c..bdbf68bb2e2d 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1443,7 +1443,8 @@ static size_t inet_nlmsg_size(void)
 	       + nla_total_size(4) /* IFA_LOCAL */
 	       + nla_total_size(4) /* IFA_BROADCAST */
 	       + nla_total_size(IFNAMSIZ) /* IFA_LABEL */
-	       + nla_total_size(4);  /* IFA_FLAGS */
+	       + nla_total_size(4)  /* IFA_FLAGS */
+	       + nla_total_size(sizeof(struct ifa_cacheinfo)); /* IFA_CACHEINFO */
 }
 
 static inline u32 cstamp_delta(unsigned long cstamp)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa()
  2014-02-05  7:38 [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa() Geert Uytterhoeven
@ 2014-02-05 17:30 ` Cong Wang
  2014-02-05 17:39   ` Geert Uytterhoeven
  2014-02-07  4:03 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Cong Wang @ 2014-02-05 17:30 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: David S. Miller, Jiri Pirko, netdev, linux-kernel

On Tue, Feb 4, 2014 at 11:38 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Apparently commit 5c766d642bcaffd0c2a5b354db2068515b3846cf ("ipv4:
> introduce address lifetime") forgot to take into account the addition of
> struct ifa_cacheinfo in inet_nlmsg_size(). Hence add it, like is already
> done for ipv6.
>
> Suggested-by: Cong Wang <cwang@twopensource.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Signed-off-by: Cong Wang <cwang@twopensource.com>

Seems a candidate for -stable.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa()
  2014-02-05 17:30 ` Cong Wang
@ 2014-02-05 17:39   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-02-05 17:39 UTC (permalink / raw)
  To: Cong Wang; +Cc: David S. Miller, Jiri Pirko, netdev, linux-kernel

On Wed, Feb 5, 2014 at 6:30 PM, Cong Wang <cwang@twopensource.com> wrote:
> On Tue, Feb 4, 2014 at 11:38 PM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> Apparently commit 5c766d642bcaffd0c2a5b354db2068515b3846cf ("ipv4:
>> introduce address lifetime") forgot to take into account the addition of
>> struct ifa_cacheinfo in inet_nlmsg_size(). Hence add it, like is already
>> done for ipv6.
>>
>> Suggested-by: Cong Wang <cwang@twopensource.com>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Signed-off-by: Cong Wang <cwang@twopensource.com>
>
> Seems a candidate for -stable.

Woops, yes. I thought this was a recent change, but I misread the year.
The bug has been present since v3.9-rc1.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa()
  2014-02-05  7:38 [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa() Geert Uytterhoeven
  2014-02-05 17:30 ` Cong Wang
@ 2014-02-07  4:03 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-02-07  4:03 UTC (permalink / raw)
  To: geert; +Cc: jiri, cwang, netdev, linux-kernel

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed,  5 Feb 2014 08:38:25 +0100

> On m68k/ARAnyM:
 ...
> Adding some debugging code reveals that net_fill_ifaddr() fails in
> 
>     put_cacheinfo(skb, ifa->ifa_cstamp, ifa->ifa_tstamp,
>                               preferred, valid))
> 
> nla_put complains:
> 
>     lib/nlattr.c:454: skb_tailroom(skb) = 12, nla_total_size(attrlen) = 20
> 
> Apparently commit 5c766d642bcaffd0c2a5b354db2068515b3846cf ("ipv4:
> introduce address lifetime") forgot to take into account the addition of
> struct ifa_cacheinfo in inet_nlmsg_size(). Hence add it, like is already
> done for ipv6.
> 
> Suggested-by: Cong Wang <cwang@twopensource.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied and queued up for -stable, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-07  4:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05  7:38 [PATCH] ipv4: Fix runtime WARNING in rtmsg_ifa() Geert Uytterhoeven
2014-02-05 17:30 ` Cong Wang
2014-02-05 17:39   ` Geert Uytterhoeven
2014-02-07  4:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).