From: Jakub Kicinski <kuba@kernel.org>
To: Lijun Pan <ljp@linux.ibm.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net v3] ibmvnic: fix ibmvnic_set_mac
Date: Thu, 29 Oct 2020 11:34:26 -0700 [thread overview]
Message-ID: <20201029113426.09ff67ec@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20201027220456.71450-1-ljp@linux.ibm.com>
On Tue, 27 Oct 2020 17:04:56 -0500 Lijun Pan wrote:
> Jakub Kicinski brought up a concern in ibmvnic_set_mac().
> ibmvnic_set_mac() does this:
>
> ether_addr_copy(adapter->mac_addr, addr->sa_data);
> if (adapter->state != VNIC_PROBED)
> rc = __ibmvnic_set_mac(netdev, addr->sa_data);
>
> So if state == VNIC_PROBED, the user can assign an invalid address to
> adapter->mac_addr, and ibmvnic_set_mac() will still return 0.
>
> The fix is to validate ethernet address at the beginning of
> ibmvnic_set_mac(), and move the ether_addr_copy to
> the case of "adapter->state != VNIC_PROBED".
>
> Fixes: 62740e97881c ("net/ibmvnic: Update MAC address settings after adapter reset")
> Cc: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
Applied, thanks.
prev parent reply other threads:[~2020-10-29 18:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 22:04 [PATCH net v3] ibmvnic: fix ibmvnic_set_mac Lijun Pan
2020-10-29 18:34 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201029113426.09ff67ec@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=ljp@linux.ibm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).