From: Greg Kroah-Hartman Date: Mon, 19 Dec 2022 15:22:59 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v5.10.161~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=821621d3418c8d19c9148762c472d520e80bca63;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: igb-initialize-mailbox-message-for-vf-reset.patch usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch --- diff --git a/queue-5.4/igb-initialize-mailbox-message-for-vf-reset.patch b/queue-5.4/igb-initialize-mailbox-message-for-vf-reset.patch new file mode 100644 index 00000000000..5e2651025d0 --- /dev/null +++ b/queue-5.4/igb-initialize-mailbox-message-for-vf-reset.patch @@ -0,0 +1,38 @@ +From de5dc44370fbd6b46bd7f1a1e00369be54a041c8 Mon Sep 17 00:00:00 2001 +From: Tony Nguyen +Date: Mon, 12 Dec 2022 11:00:31 -0800 +Subject: igb: Initialize mailbox message for VF reset + +From: Tony Nguyen + +commit de5dc44370fbd6b46bd7f1a1e00369be54a041c8 upstream. + +When a MAC address is not assigned to the VF, that portion of the message +sent to the VF is not set. The memory, however, is allocated from the +stack meaning that information may be leaked to the VM. Initialize the +message buffer to 0 so that no information is passed to the VM in this +case. + +Fixes: 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address") +Reported-by: Akihiko Odaki +Signed-off-by: Tony Nguyen +Reviewed-by: Akihiko Odaki +Reviewed-by: Leon Romanovsky +Link: https://lore.kernel.org/r/20221212190031.3983342-1-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igb/igb_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/igb/igb_main.c ++++ b/drivers/net/ethernet/intel/igb/igb_main.c +@@ -7133,7 +7133,7 @@ static void igb_vf_reset_msg(struct igb_ + { + struct e1000_hw *hw = &adapter->hw; + unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses; +- u32 reg, msgbuf[3]; ++ u32 reg, msgbuf[3] = {}; + u8 *addr = (u8 *)(&msgbuf[1]); + + /* process all the same items cleared in a function level reset */ diff --git a/queue-5.4/series b/queue-5.4/series index 93d211da094..bac565575b6 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -8,3 +8,5 @@ usb-serial-option-add-quectel-em05-g-modem.patch usb-serial-cp210x-add-kamstrup-rf-sniffer-pids.patch usb-serial-f81232-fix-division-by-zero-on-line-speed-change.patch usb-serial-f81534-fix-division-by-zero-on-line-speed-change.patch +igb-initialize-mailbox-message-for-vf-reset.patch +usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch diff --git a/queue-5.4/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch b/queue-5.4/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch new file mode 100644 index 00000000000..8e85b8e3f06 --- /dev/null +++ b/queue-5.4/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch @@ -0,0 +1,43 @@ +From 8a7b31d545d3a15f0e6f5984ae16f0ca4fd76aac Mon Sep 17 00:00:00 2001 +From: Ferry Toth +Date: Mon, 5 Dec 2022 21:15:26 +0100 +Subject: usb: ulpi: defer ulpi_register on ulpi_read_id timeout + +From: Ferry Toth + +commit 8a7b31d545d3a15f0e6f5984ae16f0ca4fd76aac upstream. + +Since commit 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral +if extcon is present") Dual Role support on Intel Merrifield platform +broke due to rearranging the call to dwc3_get_extcon(). + +It appears to be caused by ulpi_read_id() on the first test write failing +with -ETIMEDOUT. Currently ulpi_read_id() expects to discover the phy via +DT when the test write fails and returns 0 in that case, even if DT does not +provide the phy. As a result usb probe completes without phy. + +Make ulpi_read_id() return -ETIMEDOUT to its user if the first test write +fails. The user should then handle it appropriately. A follow up patch +will make dwc3_core_init() set -EPROBE_DEFER in this case and bail out. + +Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") +Cc: stable@vger.kernel.org +Acked-by: Heikki Krogerus +Signed-off-by: Ferry Toth +Link: https://lore.kernel.org/r/20221205201527.13525-2-ftoth@exalondelft.nl +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/common/ulpi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/common/ulpi.c ++++ b/drivers/usb/common/ulpi.c +@@ -207,7 +207,7 @@ static int ulpi_read_id(struct ulpi *ulp + /* Test the interface */ + ret = ulpi_write(ulpi, ULPI_SCRATCH, 0xaa); + if (ret < 0) +- goto err; ++ return ret; + + ret = ulpi_read(ulpi, ULPI_SCRATCH); + if (ret < 0)