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:   Tue, 24 Jul 2018 00:31:06 -0700
From:   Michael Chan <michael.chan@...adcom.com>
To:     YueHaibing <yuehaibing@...wei.com>,
        Vasundhara Volam <vasundhara-v.volam@...adcom.com>
Cc:     David Miller <davem@...emloft.net>,
        open list <linux-kernel@...r.kernel.org>,
        Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] bnxt_en: Fix logic of forward the VF MAC address
 to PF in bnxt_vf_validate_set_mac

On Mon, Jul 23, 2018 at 10:24 PM, YueHaibing <yuehaibing@...wei.com> wrote:
> Based on the comments,req->l2addr must match the VF MAC address
> if firmware spec >= 1.2.2, mac_ok can be true.
>
> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> index a649108..7925964 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> @@ -954,12 +954,9 @@ static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
>                 if (ether_addr_equal((const u8 *)req->l2_addr, vf->mac_addr))
>                         mac_ok = true;
>         } else if (is_valid_ether_addr(vf->vf_mac_addr)) {
> -               if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr))
> +               if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr) &&
> +                   bp->hwrm_spec_code >= 0x10202)
>                         mac_ok = true;

I'm not sure if this is correct.  If firmware spec < 0x10202, the VF
MAC address is not forwarded to the PF and so it doesn't have to match
and mac_ok should still be true.  I think we are missing that
condition with this patch.

I need to let my colleague Vasundhara comment on this.  She is more
familiar with this logic.

> -       } else if (bp->hwrm_spec_code < 0x10202) {
> -               mac_ok = true;
> -       } else {
> -               mac_ok = true;
>         }
>         if (mac_ok)
>                 return bnxt_hwrm_exec_fwd_resp(bp, vf, msg_size);
> --
> 2.7.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ