From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: <intel-wired-lan@lists.osuosl.org>,
Akihiko Odaki <akihiko.odaki@daynix.com>
Subject: Re: [Intel-wired-lan] [Patch net-queue] igb: Correct vf reset response size
Date: Mon, 5 Dec 2022 11:23:41 -0800 [thread overview]
Message-ID: <a565fa22-60e4-b3d3-0ebd-7cb4b91bf55b@intel.com> (raw)
In-Reply-To: <9af50fda-36b4-483a-4a0e-21bcc6d25ae9@intel.com>
Specifically adding Akihiko to response.
On 12/5/2022 11:11 AM, Tony Nguyen wrote:
> On 12/5/2022 9:37 AM, Tony Nguyen wrote:
>> From: Akihiko Odaki <akihiko.odaki@daynix.com>
>>
>> When an address is not assigned to a VF, sending E1000_VF_RESET message
>> from the VF to the PF causes the kernel to leak 64 bits on the stack to
>> its response, potentially crossing the security boundary relying on
>> virtualization.
>>
>> Correct vf reset response size so that it does not leak data.
>>
>> Fixes: 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac
>> address")
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>> ---
>> drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
>> b/drivers/net/ethernet/intel/igb/igb_main.c
>> index a5049e342f7d..74694a27e35d 100644
>> --- a/drivers/net/ethernet/intel/igb/igb_main.c
>> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
>> @@ -7577,10 +7577,11 @@ static void igb_vf_reset_msg(struct
>> igb_adapter *adapter, u32 vf)
>> if (!is_zero_ether_addr(vf_mac)) {
>> msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
>> memcpy(addr, vf_mac, ETH_ALEN);
>> + igb_write_mbx(hw, msgbuf, 3, vf);
>> } else {
>> msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_NACK;
>> + igb_write_mbx(hw, msgbuf, 1, vf);
>
> I just noticed this, but I believe the mailbox response needs to stay a
> consistent size as the VF is reading a set size of 3[1] for the op. We
> could probably zero init instead to prevent any leaking.
>
> Thanks,
> Tony
>
> [1]
> https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/intel/igbvf/vf.c#L132
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
prev parent reply other threads:[~2022-12-05 19:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 17:37 [Intel-wired-lan] [Patch net-queue] igb: Correct vf reset response size Tony Nguyen
2022-12-05 19:11 ` Tony Nguyen
2022-12-05 19:23 ` Tony Nguyen [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=a565fa22-60e4-b3d3-0ebd-7cb4b91bf55b@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=akihiko.odaki@daynix.com \
--cc=intel-wired-lan@lists.osuosl.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