Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/arch/arm/sunxi Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/102fa1b610ee
branches:  netbsd-8
changeset: 451257:102fa1b610ee
user:      martin <martin%NetBSD.org@localhost>
date:      Sun May 12 09:19:07 2019 +0000

description:
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

diffstat:

 sys/arch/arm/sunxi/sunxi_emac.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 5a1b93246154 -r 102fa1b610ee sys/arch/arm/sunxi/sunxi_emac.c
--- a/sys/arch/arm/sunxi/sunxi_emac.c   Tue May 07 18:52:49 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_emac.c   Sun May 12 09:19:07 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_emac.c,v 1.4.4.4 2018/01/02 10:20:32 snj Exp $ */
+/* $NetBSD: sunxi_emac.c,v 1.4.4.5 2019/05/12 09:19:07 martin Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.4.4.4 2018/01/02 10:20:32 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.4.4.5 2019/05/12 09:19:07 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -548,6 +548,7 @@
                hash[0] = hash[1] = ~0;
        } else {
                val |= HASH_MULTICAST;
+               ETHER_LOCK(&sc->ec);
                ETHER_FIRST_MULTI(step, &sc->ec, enm);
                while (enm != NULL) {
                        crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
@@ -558,6 +559,7 @@
                        hash[hashreg] |= (1 << hashbit);
                        ETHER_NEXT_MULTI(step, enm);
                }
+               ETHER_UNLOCK(&sc->ec);
        }
 
        /* Write our unicast address */



Home | Main Index | Thread Index | Old Index