lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230331212514.7a9ee3d9@kernel.org>
Date:   Fri, 31 Mar 2023 21:25:14 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Felix Hüttner <felix.huettner@...l.schwarz>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "dev@...nvswitch.org" <dev@...nvswitch.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Luca Czesla <Luca.Czesla@...l.schwarz>
Subject: Re: [PATCH] net: openvswitch: fix race on port output

On Fri, 31 Mar 2023 06:25:13 +0000 Felix Hüttner wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 253584777101..6628323b7bea 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3199,6 +3199,7 @@ static u16 skb_tx_hash(const struct net_device *dev,
>         }
> 
>         if (skb_rx_queue_recorded(skb)) {
> +               BUG_ON(unlikely(qcount == 0));

DEBUG_NET_WARN_ON()

>                 hash = skb_get_rx_queue(skb);
>                 if (hash >= qoffset)
>                         hash -= qoffset;
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index ca3ebfdb3023..33b317e5f9a5 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -913,7 +913,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
>  {
>         struct vport *vport = ovs_vport_rcu(dp, out_port);
> 
> -       if (likely(vport)) {
> +       if (likely(vport && vport->dev->reg_state == NETREG_REGISTERED)) {

Without looking too closely netif_carrier_ok() seems like a more
appropriate check for liveness on the datapath?

>                 u16 mru = OVS_CB(skb)->mru;
>                 u32 cutlen = OVS_CB(skb)->cutlen;
> 
> --
> 2.40.0
> 
> Diese E Mail enthält möglicherweise vertrauliche Inhalte und ist nur für die Verwertung durch den vorgesehenen Empfänger bestimmt. Sollten Sie nicht der vorgesehene Empfänger sein, setzen Sie den Absender bitte unverzüglich in Kenntnis und löschen diese E Mail. Hinweise zum Datenschutz finden Sie hier<https://www.datenschutz.schwarz>.

You gotta get rid of this to work upstream.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ