NetBSD Problem Report #54153

From sc.dying@gmail.com  Fri May  3 02:56:51 2019
Return-Path: <sc.dying@gmail.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A2BAF7A170
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  3 May 2019 02:56:51 +0000 (UTC)
Message-Id: <CA+16TwKzowxvnT86TdSnuJo3Sb_1Xho3D1F0nNYg=dMewZfdmw@mail.gmail.com>
Date: Fri, 3 May 2019 02:56:33 +0000
From: sc dying <sc.dying@gmail.com>
Reply-To:
To: gnats-bugs@netbsd.org
Subject: emac multicast hash calculation needs ETHER_LOCK

>Number:         54153
>Category:       port-arm
>Synopsis:       emac multicast hash calculation needs ETHER_LOCK
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ozaki-r
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 03 03:00:00 +0000 2019
>Closed-Date:    Mon May 13 01:06:31 +0000 2019
>Last-Modified:  Mon Jun 10 05:30:01 +0000 2019
>Originator:     sc dying <sc.dying@gmail.com>
>Release:        NetBSD 8.99.37
>Organization:
>Environment:
System: NetBSD 8.99.37 evbarm
Architecture: earmv7hf
Machine: evbarm
Boardtype: NanoPi neo
>Description:
sunxi emac(4) multicast hash calculation needs wrapped with
ETHER_LOCK - ETHER_UNLOCK, especially if NET_MPSAFE is defined.

>How-To-Repeat:

>Fix:
Please add ETHER_LOCK before ETHER_FIRST_MULTI and add ETHER_UNLOCK
after following while loop.

Please pull-up to 8.0, too.

>Release-Note:

>Audit-Trail:
From: "Ryota Ozaki" <ozaki-r@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54153 CVS commit: src/sys/arch/arm/sunxi
Date: Wed, 8 May 2019 09:53:43 +0000

 Module Name:	src
 Committed By:	ozaki-r
 Date:		Wed May  8 09:53:43 UTC 2019

 Modified Files:
 	src/sys/arch/arm/sunxi: sun4i_emac.c

 Log Message:
 Protect ether_multi list

 PR 54153


 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sun4i_emac.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Ryota Ozaki" <ozaki-r@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54153 CVS commit: src/sys/arch/arm/sunxi
Date: Thu, 9 May 2019 01:46:37 +0000

 Module Name:	src
 Committed By:	ozaki-r
 Date:		Thu May  9 01:46:37 UTC 2019

 Modified Files:
 	src/sys/arch/arm/sunxi: sunxi_emac.c

 Log Message:
 Protect ether_multi list

 The list can be racy if NET_MPSAFE is enabled and the driver is executed without
 KERNEL_LOCK.

 Fix PR 54153


 To generate a diff of this commit:
 cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/sunxi/sunxi_emac.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: port-arm-maintainer->ozaki-r
Responsible-Changed-By: ozaki-r@NetBSD.org
Responsible-Changed-When: Thu, 09 May 2019 02:42:11 +0000
Responsible-Changed-Why:
handled


State-Changed-From-To: open->pending-pullups
State-Changed-By: ozaki-r@NetBSD.org
State-Changed-When: Thu, 09 May 2019 02:42:11 +0000
State-Changed-Why:
pullup-8 #1259


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54153 CVS commit: [netbsd-8] src/sys/arch/arm/sunxi
Date: Sun, 12 May 2019 09:19:07 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun May 12 09:19:07 UTC 2019

 Modified Files:
 	src/sys/arch/arm/sunxi [netbsd-8]: sunxi_emac.c

 Log Message:
 Pull up following revision(s) (requested by ozaki-r in ticket #1259):

 	sys/arch/arm/sunxi/sunxi_emac.c: revision 1.26

 Protect ether_multi list

 The list can be racy if NET_MPSAFE is enabled and the driver is executed without
 KERNEL_LOCK.

 Fix PR 54153


 To generate a diff of this commit:
 cvs rdiff -u -r1.4.4.4 -r1.4.4.5 src/sys/arch/arm/sunxi/sunxi_emac.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: ozaki-r@NetBSD.org
State-Changed-When: Mon, 13 May 2019 01:06:31 +0000
State-Changed-Why:
pulled up, thanks.


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-arm/54153: emac multicast hash calculation needs ETHER_LOCK
Date: Mon, 10 Jun 2019 05:26:14 +0000

 This chain wasn't sent to gnats (please be sure bug traffic is sent to
 gnats-bugs)

    ------

 From: Ryota Ozaki <ozaki-r@netbsd.org>
 To: sc dying <sc.dying@gmail.com>
 Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
 	netbsd-bugs@netbsd.org
 Subject: Re: port-arm/54153: emac multicast hash calculation needs ETHER_LOCK
 Date: Wed, 8 May 2019 19:09:16 +0900

 On Fri, May 3, 2019 at 12:00 PM sc dying <sc.dying@gmail.com> wrote:
 >
 > >Number:         54153
 > >Category:       port-arm
 > >Synopsis:       emac multicast hash calculation needs ETHER_LOCK
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       high
 > >Responsible:    port-arm-maintainer
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri May 03 03:00:00 +0000 2019
 > >Originator:     sc dying <sc.dying@gmail.com>
 > >Release:        NetBSD 8.99.37
 > >Organization:
 > >Environment:
 > System: NetBSD 8.99.37 evbarm
 > Architecture: earmv7hf
 > Machine: evbarm
 > Boardtype: NanoPi neo
 > >Description:
 > sunxi emac(4) multicast hash calculation needs wrapped with
 > ETHER_LOCK - ETHER_UNLOCK, especially if NET_MPSAFE is defined.
 >
 > >How-To-Repeat:
 >
 > >Fix:
 > Please add ETHER_LOCK before ETHER_FIRST_MULTI and add ETHER_UNLOCK
 > after following while loop.

 Fixed, thanks.

 >
 > Please pull-up to 8.0, too.

 Have you encountered any issues around the code?  Even if NET_MPSAFE is enabled
 emac(4) is protected with KERENL_LOCK AFAIK so the code is actually
 not problematic
 on netbsd-8.  (I fixed it on -current for further MP-ification in the future.)

   ozaki-r


 From: sc dying <sc.dying@gmail.com>
 To: Ryota Ozaki <ozaki-r@netbsd.org>
 Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
 	netbsd-bugs@netbsd.org
 Subject: Re: port-arm/54153: emac multicast hash calculation needs ETHER_LOCK
 Date: Wed, 8 May 2019 23:03:10 +0900

 On Wed, May 8, 2019 at 7:09 PM Ryota Ozaki <ozaki-r@netbsd.org> wrote:
 > > >Description:
 > > sunxi emac(4) multicast hash calculation needs wrapped with
 > > ETHER_LOCK - ETHER_UNLOCK, especially if NET_MPSAFE is defined.
 > >
 > > >How-To-Repeat:
 > >
 > > >Fix:
 > > Please add ETHER_LOCK before ETHER_FIRST_MULTI and add ETHER_UNLOCK
 > > after following while loop.
 >
 > Fixed, thanks.

 Thank you for fix, but I should tell which driver needs fixed.
 I did not notice arm/sunxi/ have two emac driver, {sun4i,sunxi}_emac.c.
 I thought my nanopi (sun8i-h3-nanopi-neo) uses sunxi_emac.c and
 looked into it.
 sunxi_emac.c has the same problem that sun4i_emac.c had.
 Could you fix sunxi_emac.c too?

 >
 > >
 > > Please pull-up to 8.0, too.
 >
 > Have you encountered any issues around the code?  Even if NET_MPSAFE is enabled
 > emac(4) is protected with KERENL_LOCK AFAIK so the code is actually
 > not problematic
 > on netbsd-8.  (I fixed it on -current for further MP-ification in the future.)

 I don't have any problem about this, but just notice by looking into
 another problem.


 From: Ryota Ozaki <ozaki-r@netbsd.org>
 To: sc dying <sc.dying@gmail.com>
 Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
 	netbsd-bugs@netbsd.org
 Subject: Re: port-arm/54153: emac multicast hash calculation needs ETHER_LOCK
 Date: Thu, 9 May 2019 11:08:15 +0900

 On Wed, May 8, 2019 at 11:02 PM sc dying <sc.dying@gmail.com> wrote:
 >
 > On Wed, May 8, 2019 at 7:09 PM Ryota Ozaki <ozaki-r@netbsd.org> wrote:
 > > > >Description:
 > > > sunxi emac(4) multicast hash calculation needs wrapped with
 > > > ETHER_LOCK - ETHER_UNLOCK, especially if NET_MPSAFE is defined.
 > > >
 > > > >How-To-Repeat:
 > > >
 > > > >Fix:
 > > > Please add ETHER_LOCK before ETHER_FIRST_MULTI and add ETHER_UNLOCK
 > > > after following while loop.
 > >
 > > Fixed, thanks.
 >
 > Thank you for fix, but I should tell which driver needs fixed.
 > I did not notice arm/sunxi/ have two emac driver, {sun4i,sunxi}_emac.c.
 > I thought my nanopi (sun8i-h3-nanopi-neo) uses sunxi_emac.c and
 > looked into it.
 > sunxi_emac.c has the same problem that sun4i_emac.c had.
 > Could you fix sunxi_emac.c too?

 Oh, I didn't notice the driver.  I fixed it now.

 >
 > >
 > > >
 > > > Please pull-up to 8.0, too.
 > >
 > > Have you encountered any issues around the code?  Even if NET_MPSAFE is enabled
 > > emac(4) is protected with KERENL_LOCK AFAIK so the code is actually
 > > not problematic
 > > on netbsd-8.  (I fixed it on -current for further MP-ification in the future.)
 >
 > I don't have any problem about this, but just notice by looking into
 > another problem.

 Actually sunxi_emac.c is racy with NET_MPSAFE, so I'll pull the fix up
 to netbsd-8.

 Thank you for the report!
   ozaki-r


 From: sc dying <sc.dying@gmail.com>
 To: Ryota Ozaki <ozaki-r@netbsd.org>
 Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org,
 	netbsd-bugs@netbsd.org
 Subject: Re: port-arm/54153: emac multicast hash calculation needs ETHER_LOCK
 Date: Thu, 9 May 2019 05:50:47 +0000

 On Thu, May 9, 2019 at 2:08 AM Ryota Ozaki <ozaki-r@netbsd.org> wrote:
 >
 > On Wed, May 8, 2019 at 11:02 PM sc dying <sc.dying@gmail.com> wrote:
 > >
 > > On Wed, May 8, 2019 at 7:09 PM Ryota Ozaki <ozaki-r@netbsd.org> wrote:
 > > > > >Description:
 > > > > sunxi emac(4) multicast hash calculation needs wrapped with
 > > > > ETHER_LOCK - ETHER_UNLOCK, especially if NET_MPSAFE is defined.
 > > > >
 > > > > >How-To-Repeat:
 > > > >
 > > > > >Fix:
 > > > > Please add ETHER_LOCK before ETHER_FIRST_MULTI and add ETHER_UNLOCK
 > > > > after following while loop.
 > > >
 > > > Fixed, thanks.
 > >
 > > Thank you for fix, but I should tell which driver needs fixed.
 > > I did not notice arm/sunxi/ have two emac driver, {sun4i,sunxi}_emac.c.
 > > I thought my nanopi (sun8i-h3-nanopi-neo) uses sunxi_emac.c and
 > > looked into it.
 > > sunxi_emac.c has the same problem that sun4i_emac.c had.
 > > Could you fix sunxi_emac.c too?
 >
 > Oh, I didn't notice the driver.  I fixed it now.

 Thanks a lot!

 >
 > >
 > > >
 > > > >
 > > > > Please pull-up to 8.0, too.
 > > >
 > > > Have you encountered any issues around the code?  Even if NET_MPSAFE is enabled
 > > > emac(4) is protected with KERENL_LOCK AFAIK so the code is actually
 > > > not problematic
 > > > on netbsd-8.  (I fixed it on -current for further MP-ification in the future.)
 > >
 > > I don't have any problem about this, but just notice by looking into
 > > another problem.
 >
 > Actually sunxi_emac.c is racy with NET_MPSAFE, so I'll pull the fix up
 > to netbsd-8.
 >
 > Thank you for the report!
 >   ozaki-r

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.