diff mbox

flow_dissect: call init_default_flow_dissectors() earlier

Message ID 1480331675-3886-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques Nov. 28, 2016, 11:14 a.m. UTC
From: Eric Dumazet <edumazet@google.com>

BugLink: https://bugs.launchpad.net/bugs/1645278

Andre Noll reported panics after my recent fix (commit 34fad54c2537
"net: __skb_flow_dissect() must cap its return value")

After some more headaches, Alexander root caused the problem to
init_default_flow_dissectors() being called too late, in case
a network driver like IGB is not a module and receives DHCP message
very early.

Fix is to call init_default_flow_dissectors() much earlier,
as it is a core infrastructure and does not depend on another
kernel service.

Fixes: 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andre Noll <maan@tuebingen.mpg.de>
Diagnosed-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c9b8af1330198ae241cd545e1f040019010d44d9)
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/flow_dissector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin Ian King Nov. 28, 2016, 11:25 a.m. UTC | #1
On 28/11/16 11:14, Luis Henriques wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1645278
> 
> Andre Noll reported panics after my recent fix (commit 34fad54c2537
> "net: __skb_flow_dissect() must cap its return value")
> 
> After some more headaches, Alexander root caused the problem to
> init_default_flow_dissectors() being called too late, in case
> a network driver like IGB is not a module and receives DHCP message
> very early.
> 
> Fix is to call init_default_flow_dissectors() much earlier,
> as it is a core infrastructure and does not depend on another
> kernel service.
> 
> Fixes: 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Andre Noll <maan@tuebingen.mpg.de>
> Diagnosed-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit c9b8af1330198ae241cd545e1f040019010d44d9)
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  net/core/flow_dissector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 9aba9e93c0a2..ee9082792530 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -949,4 +949,4 @@ static int __init init_default_flow_dissectors(void)
>  	return 0;
>  }
>  
> -late_initcall_sync(init_default_flow_dissectors);
> +core_initcall(init_default_flow_dissectors);
> 
Clean upstream cherry pick, looks sane to me.

Acked-by: Colin Ian King <colin.king@canonical.com>
Stefan Bader Nov. 28, 2016, 11:57 a.m. UTC | #2
On 28.11.2016 12:14, Luis Henriques wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1645278
> 
> Andre Noll reported panics after my recent fix (commit 34fad54c2537
> "net: __skb_flow_dissect() must cap its return value")
> 
> After some more headaches, Alexander root caused the problem to
> init_default_flow_dissectors() being called too late, in case
> a network driver like IGB is not a module and receives DHCP message
> very early.
> 
> Fix is to call init_default_flow_dissectors() much earlier,
> as it is a core infrastructure and does not depend on another
> kernel service.
> 
> Fixes: 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Andre Noll <maan@tuebingen.mpg.de>
> Diagnosed-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit c9b8af1330198ae241cd545e1f040019010d44d9)
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

Mail does not mention what target. Bug report indicates Xenial. What about
Yakkety as this seems to be a 4.9 patch?

-Stefan
> ---
>  net/core/flow_dissector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 9aba9e93c0a2..ee9082792530 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -949,4 +949,4 @@ static int __init init_default_flow_dissectors(void)
>  	return 0;
>  }
>  
> -late_initcall_sync(init_default_flow_dissectors);
> +core_initcall(init_default_flow_dissectors);
>
Luis Henriques Nov. 28, 2016, 12:16 p.m. UTC | #3
On Mon, Nov 28, 2016 at 12:57:45PM +0100, Stefan Bader wrote:
> On 28.11.2016 12:14, Luis Henriques wrote:
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > BugLink: https://bugs.launchpad.net/bugs/1645278
> > 
> > Andre Noll reported panics after my recent fix (commit 34fad54c2537
> > "net: __skb_flow_dissect() must cap its return value")
> > 
> > After some more headaches, Alexander root caused the problem to
> > init_default_flow_dissectors() being called too late, in case
> > a network driver like IGB is not a module and receives DHCP message
> > very early.
> > 
> > Fix is to call init_default_flow_dissectors() much earlier,
> > as it is a core infrastructure and does not depend on another
> > kernel service.
> > 
> > Fixes: 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Reported-by: Andre Noll <maan@tuebingen.mpg.de>
> > Diagnosed-by: Alexander Duyck <alexander.h.duyck@intel.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > (cherry picked from commit c9b8af1330198ae241cd545e1f040019010d44d9)
> > Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> 
> Mail does not mention what target. Bug report indicates Xenial. What about
> Yakkety as this seems to be a 4.9 patch?
> 

Ah, good point!  I've updated the bug to include both xenial (4.4.34) and
yakkety (4.8.10).  So, this fix should be applied to both kernel.

Cheers,
--
Luís

> -Stefan
> > ---
> >  net/core/flow_dissector.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> > index 9aba9e93c0a2..ee9082792530 100644
> > --- a/net/core/flow_dissector.c
> > +++ b/net/core/flow_dissector.c
> > @@ -949,4 +949,4 @@ static int __init init_default_flow_dissectors(void)
> >  	return 0;
> >  }
> >  
> > -late_initcall_sync(init_default_flow_dissectors);
> > +core_initcall(init_default_flow_dissectors);
> > 
> 
> 



> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Tim Gardner Nov. 28, 2016, 2:31 p.m. UTC | #4
On 11/28/2016 04:14 AM, Luis Henriques wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1645278
> 
> Andre Noll reported panics after my recent fix (commit 34fad54c2537
> "net: __skb_flow_dissect() must cap its return value")
> 
> After some more headaches, Alexander root caused the problem to
> init_default_flow_dissectors() being called too late, in case
> a network driver like IGB is not a module and receives DHCP message
> very early.
> 
> Fix is to call init_default_flow_dissectors() much earlier,
> as it is a core infrastructure and does not depend on another
> kernel service.
> 
> Fixes: 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Andre Noll <maan@tuebingen.mpg.de>
> Diagnosed-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> (cherry picked from commit c9b8af1330198ae241cd545e1f040019010d44d9)
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  net/core/flow_dissector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 9aba9e93c0a2..ee9082792530 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -949,4 +949,4 @@ static int __init init_default_flow_dissectors(void)
>  	return 0;
>  }
>  
> -late_initcall_sync(init_default_flow_dissectors);
> +core_initcall(init_default_flow_dissectors);
>
Luis Henriques Nov. 29, 2016, 5:30 p.m. UTC | #5
Applied to xenial master-next branch.

Cheers,
--
Luís
Luis Henriques Nov. 29, 2016, 5:39 p.m. UTC | #6
On Tue, Nov 29, 2016 at 05:30:19PM +0000, Luis Henriques wrote:
> Applied to xenial master-next branch.

And also to yakkety master-next branch.

Cheers,
--
Luís
diff mbox

Patch

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 9aba9e93c0a2..ee9082792530 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -949,4 +949,4 @@  static int __init init_default_flow_dissectors(void)
 	return 0;
 }
 
-late_initcall_sync(init_default_flow_dissectors);
+core_initcall(init_default_flow_dissectors);