Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1290714

Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double allocations

From Luis Henriques <luis.henriques@canonical.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double allocations
Date 2015-12-13 22:40 +0100
Message-ID <qFmx4-5j8-13@gated-at.bofh.it> (permalink)
References (1 earlier) <qDJo5-6xK-5@gated-at.bofh.it> <qEJP4-5G5-9@gated-at.bofh.it> <qFk2f-3De-27@gated-at.bofh.it> <qFlrk-4EA-7@gated-at.bofh.it> <qFlKG-4Mv-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Dec 13, 2015 at 12:43:10PM -0800, Eric Dumazet wrote:
> On Sun, 2015-12-13 at 20:20 +0000, Ben Hutchings wrote:
> > On Sun, 2015-12-13 at 18:54 +0000, Luis Henriques wrote:
> > > On Sat, Dec 12, 2015 at 04:18:26AM +0000, Ben Hutchings wrote:
> > > > On Wed, 2015-12-09 at 09:36 +0000, Luis Henriques wrote:
> > > > > 3.16.7-ckt21 -stable review patch.  If anyone has any objections,
> > > > > please let me know.
> > > > > 
> > > > > ------------------
> > > > > 
> > > > > From: Eric Dumazet <edumazet@google.com>
> > > > > 
> > > > > commit 4ece9009774596ee3df0acba65a324b7ea79387c upstream.
> > > > > 
> > > > > sit0 device allocates its percpu storage twice :
> > > > > - One time in ipip6_tunnel_init()
> > > > > - One time in ipip6_fb_tunnel_init()
> > > > > 
> > > > > Thus we leak 48 bytes per possible cpu per network namespace
> > > > > dismantle.
> > > > > 
> > > > > ipip6_fb_tunnel_init() can be much simpler and does not
> > > > > return an error, and should be called after register_netdev()
> > > > [...]
> > > > 
> > > > Doesn't this introduce a race condition when sit is a module?  There
> > > > seems to be nothing to prevent access to the partially initialised
> > > > device after calling register_netdev(), if sit_init_net() is called
> > > > during module loading rather than during namespace creation.
> > > > 
> > > 
> > > This seems to be an upstream issue, not specific to the 3.16.y-ckt
> > > stable kernel.  If that is the case, I guess I'll just keep this patch
> > > and later apply the fix.  Or do you think this race is really likely
> > > to be a worst problem than then issue the patch is trying to fix?
> > 
> > It seems worse than the problem being fixed.
> 
> 1) Sorry Ben, I do not understand the problem you mention.
>    What is a partially initialized device exactly ?
> 
> 2) I have no idea why this patch is even backported to 3.16,
>  since it is fixing a problem added in 3.18 :
> 
> # git describe --contains ebe084aafb7e
> v3.18-rc5~22^2~42^2~1
>

Right, but this commit has been included in several stable git trees
(I can see it at least in 3.14, 3.13 and 3.10, but it's probably in
some more).

Cheers,
--
Luís


> If your 3.16 kernel survives this loop without consuming memory like
> crazy, then the backport is not needed.
> 
> modprobe sit
> while :
> do
>  ip netns add ns1
>  ip netns delete ns1
> done
> 
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Ben Hutchings <ben@decadent.org.uk> - 2015-12-12 05:20 +0100
  Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Luis Henriques <luis.henriques@canonical.com> - 2015-12-13 20:00 +0100
    Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Ben Hutchings <ben@decadent.org.uk> - 2015-12-13 21:30 +0100
      Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Eric Dumazet <eric.dumazet@gmail.com> - 2015-12-13 21:50 +0100
        Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Ben Hutchings <ben@decadent.org.uk> - 2015-12-13 22:30 +0100
          Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Eric Dumazet <eric.dumazet@gmail.com> - 2015-12-13 22:50 +0100
            Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Ben Hutchings <ben@decadent.org.uk> - 2015-12-13 23:00 +0100
              Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Eric Dumazet <eric.dumazet@gmail.com> - 2015-12-13 23:50 +0100
                Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Ben Hutchings <ben@decadent.org.uk> - 2015-12-14 00:10 +0100
        Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Luis Henriques <luis.henriques@canonical.com> - 2015-12-13 22:40 +0100
        Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations David Miller <davem@davemloft.net> - 2015-12-13 23:20 +0100
          Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double  allocations Luis Henriques <luis.henriques@canonical.com> - 2015-12-13 23:30 +0100

csiph-web