From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbbLMXES (ORCPT ); Sun, 13 Dec 2015 18:04:18 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:54440 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbbLMXEL (ORCPT ); Sun, 13 Dec 2015 18:04:11 -0500 Message-ID: <1450047823.3944.8.camel@decadent.org.uk> Subject: Re: [PATCH 3.16.y-ckt 009/126] sit: fix sit0 percpu double allocations From: Ben Hutchings To: Eric Dumazet Cc: Luis Henriques , Eric Dumazet , Steffen Klassert , "David S. Miller" , linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Date: Sun, 13 Dec 2015 23:03:43 +0000 In-Reply-To: <1450046747.9768.48.camel@edumazet-glaptop2.roam.corp.google.com> References: <1449653896-5236-1-git-send-email-luis.henriques@canonical.com> <1449653896-5236-10-git-send-email-luis.henriques@canonical.com> <1449893906.3836.5.camel@decadent.org.uk> <20151213185429.GA31826@charon> <1450038035.3944.2.camel@decadent.org.uk> <1450039390.9768.30.camel@edumazet-glaptop2.roam.corp.google.com> <1450041762.3944.4.camel@decadent.org.uk> <1450043078.9768.37.camel@edumazet-glaptop2.roam.corp.google.com> <1450043388.3944.6.camel@decadent.org.uk> <1450046747.9768.48.camel@edumazet-glaptop2.roam.corp.google.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-aFFoXEuEz0TDJkzMctVd" X-Mailer: Evolution 3.18.2-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.4.247 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-aFFoXEuEz0TDJkzMctVd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2015-12-13 at 14:45 -0800, Eric Dumazet wrote: > On Sun, 2015-12-13 at 21:49 +0000, Ben Hutchings wrote: > > On Sun, 2015-12-13 at 13:44 -0800, Eric Dumazet wrote: > > > On Sun, 2015-12-13 at 21:22 +0000, Ben Hutchings wrote: > > > > On Sun, 2015-12-13 at 12:43 -0800, Eric Dumazet wrote: > > >=20 > > > > > 1) Sorry Ben, I do not understand the problem you mention. > > > > > =C2=A0=C2=A0=C2=A0What is a partially initialized device exactly = ? > > > >=20 > > > > A tunnel device which is registered but hasn't had its private > > > > structure fully initialised yet. > > >=20 > > > And you see this happening after my patch ? I am blind. > > >=20 > > > I am referring to current linux kernel, not to a backport to pre 3.18 > > > kernels, that was not considered when I wrote this patch. > > >=20 > > > By the time ipip6_fb_tunnel_init() is called, dev->tstats had been > > > already allocated in ipip6_tunnel_init(), so what is missing ? > >=20 > > You moved this initialisation below the registration: > >=20 > > > ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn); > > > ipip6_fb_tunnel_init(sitn->fb_tunnel_dev); >=20 > Okay, so what is the exact problem you are seeing Ben ? >=20 > ipip6_tunnel_clone_6rd() looks to not contain a fatal race or mem leak. >=20 > Note that ipip6_tunnel_clone_6rd() can be called later from ioctl() > path. That holds the rtnl_lock, though. > ipip6_fb_tunnel_init() must be done once device is ready, as it > publishes state for packet processing. OK. > rcu_assign_pointer(sitn->tunnels_wc[0], tunnel); >=20 > Looks like a rather correct way to register a device : init all fields, > then publish the RCU protected pointer for packets to catch it. >=20 > Really, I do not see a problem, please elaborate. Maybe there isn't one in this case. Ben. --=20 Ben Hutchings Life would be so much easier if we could look at the source code. --=-aFFoXEuEz0TDJkzMctVd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIVAwUAVm35T+e/yOyVhhEJAQq8Ew/+J2rfEyG26XMwXac4ODxbPxpSSCmmO+SC qvvn2u2l/XFtfjB3JRVFkO3HBnsqnLhNRSteXYi1l+HirgrFQW953oMWz4yZyw61 gP7Wp+uwL0nYZ1i+y5Dk4Yj8Ydl19cULCmFrKBYIDRVlmrBDDuzs//fhsQESn8cH u/xdUUe05QtescZ3FutJDgnSrJnBSzTSTyEge2JDYTzk0vEqAbABXFFAFooSJOEP rSekF2u9E7HGKbcgA1stDONZOvEgH399cTwzwAljy6Pz9uE3RUbCsovCJ3BQh0Zc vNoFpSP02b7K6My8Wg4MefAQgOaSFnxEDFTp8GyyzDkSaCZLiOPxeVZOSQRqnbGj ZWiS0vuYtAY1ZFqeVITloEIWuzxkhPerr6evj/fcmytp402lvFawU+hrvltJKupZ 3gHE0KrDliDlGtahK6zqKCJ6LUwcXso2YBpO7tf0ECUQmIwGOM0uXeNg0eblWSDQ hqD4RmsGQ0AOY3f2TQpEk5qzn+0G0IF/C3cPSZvuXWPn7wqZuXgUR4Nw91BjPOTu 7nRfOBBtA4A0dpT1eVRorsRVn23WKy2muY8gC1U6xEm32q3hrIBBRgP87YF8MtFc uEWCSN1/RAcHWXsU1mj13FqNTRiXR/VUv2A8wyi6hD8KKFYWooO7Z3tWFhiLTg1J Xb2LfjQB94M= =bJ6H -----END PGP SIGNATURE----- --=-aFFoXEuEz0TDJkzMctVd--