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]
Date:   Fri, 9 Oct 2020 13:46:39 -0400
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Tony Nguyen <anthony.l.nguyen@...el.com>
Cc:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Aleksandr Loktionov <aleksandr.loktionov@...el.com>,
        Network Development <netdev@...r.kernel.org>,
        nhorman@...hat.com, sassmann@...hat.com,
        Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
        Andrew Bowers <andrewx.bowers@...el.com>
Subject: Re: [net-next 2/3] i40e: Fix MAC address setting for a VF via Host/VM

On Wed, Oct 7, 2020 at 7:11 PM Tony Nguyen <anthony.l.nguyen@...el.com> wrote:
>
> From: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
>
> Fix MAC setting flow for the PF driver.
>
> Without this change the MAC address setting was interpreted
> incorrectly in the following use cases:
> 1) Print incorrect VF MAC or zero MAC
> ip link show dev $pf
> 2) Don't preserve MAC between driver reload
> rmmod iavf; modprobe iavf
> 3) Update VF MAC when macvlan was set
> ip link add link $vf address $mac $vf.1 type macvlan
> 4) Failed to update mac address when VF was trusted
> ip link set dev $vf address $mac
>
> This includes all other configurations including above commands.
>
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
> Tested-by: Andrew Bowers <andrewx.bowers@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>

If this is a fix, should it target net and/or is there a commit for a Fixes tag?

> @@ -2740,6 +2744,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
>  {
>         struct virtchnl_ether_addr_list *al =
>             (struct virtchnl_ether_addr_list *)msg;
> +       bool was_unimac_deleted = false;
>         struct i40e_pf *pf = vf->pf;
>         struct i40e_vsi *vsi = NULL;
>         i40e_status ret = 0;
> @@ -2759,6 +2764,8 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
>                         ret = I40E_ERR_INVALID_MAC_ADDR;
>                         goto error_param;
>                 }
> +               if (ether_addr_equal(al->list[i].addr, vf->default_lan_addr.addr))
> +                       was_unimac_deleted = true;
>         }
>         vsi = pf->vsi[vf->lan_vsi_idx];
>
> @@ -2779,10 +2786,25 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
>                 dev_err(&pf->pdev->dev, "Unable to program VF %d MAC filters, error %d\n",
>                         vf->vf_id, ret);
>
> +       if (vf->trusted && was_unimac_deleted) {
> +               struct i40e_mac_filter *f;
> +               struct hlist_node *h;
> +               u8 *macaddr = NULL;
> +               int bkt;
> +
> +               /* set last unicast mac address as default */
> +               spin_lock_bh(&vsi->mac_filter_hash_lock);
> +               hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {
> +                       if (is_valid_ether_addr(f->macaddr))
> +                               macaddr = f->macaddr;

nit: could break here

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ