From: Sasha Levin Date: Sun, 20 Mar 2022 00:56:17 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v4.9.308~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a2d06e116c6da7cdb9a77bc593cbcd0be13e46f;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/arm64-fix-clang-warning-about-tramp_valias.patch b/queue-5.4/arm64-fix-clang-warning-about-tramp_valias.patch new file mode 100644 index 00000000000..af8e6ce95d0 --- /dev/null +++ b/queue-5.4/arm64-fix-clang-warning-about-tramp_valias.patch @@ -0,0 +1,51 @@ +From 126da011e989b60e7899cb2b1584cb815357b19f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Mar 2022 19:38:18 +0100 +Subject: arm64: fix clang warning about TRAMP_VALIAS + +From: Arnd Bergmann + +[ Upstream commit 7f34b43e07cb512b28543fdcb9f35d1fbfda9ebc ] + +The newly introduced TRAMP_VALIAS definition causes a build warning +with clang-14: + +arch/arm64/include/asm/vectors.h:66:31: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] + return (char *)TRAMP_VALIAS + SZ_2K * slot; + +Change the addition to something clang does not complain about. + +Fixes: bd09128d16fa ("arm64: Add percpu vectors for EL1") +Signed-off-by: Arnd Bergmann +Acked-by: James Morse +Link: https://lore.kernel.org/r/20220316183833.1563139-1-arnd@kernel.org +Signed-off-by: Catalin Marinas +Signed-off-by: Sasha Levin +--- + arch/arm64/include/asm/vectors.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/include/asm/vectors.h b/arch/arm64/include/asm/vectors.h +index f64613a96d53..bc9a2145f419 100644 +--- a/arch/arm64/include/asm/vectors.h ++++ b/arch/arm64/include/asm/vectors.h +@@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors { + DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector); + + #ifndef CONFIG_UNMAP_KERNEL_AT_EL0 +-#define TRAMP_VALIAS 0 ++#define TRAMP_VALIAS 0ul + #endif + + static inline const char * + arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot) + { + if (arm64_kernel_unmapped_at_el0()) +- return (char *)TRAMP_VALIAS + SZ_2K * slot; ++ return (char *)(TRAMP_VALIAS + SZ_2K * slot); + + WARN_ON_ONCE(slot == EL1_VECTOR_KPTI); + +-- +2.34.1 + diff --git a/queue-5.4/atm-eni-add-check-for-dma_map_single.patch b/queue-5.4/atm-eni-add-check-for-dma_map_single.patch new file mode 100644 index 00000000000..2eb0be8e52a --- /dev/null +++ b/queue-5.4/atm-eni-add-check-for-dma_map_single.patch @@ -0,0 +1,37 @@ +From 72309f0737a285c58baddc5eb7a05f7fab682ee5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Mar 2022 09:34:48 +0800 +Subject: atm: eni: Add check for dma_map_single + +From: Jiasheng Jiang + +[ Upstream commit 0f74b29a4f53627376cf5a5fb7b0b3fa748a0b2b ] + +As the potential failure of the dma_map_single(), +it should be better to check it and return error +if fails. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Jiasheng Jiang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/atm/eni.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c +index de52428b8833..4816db0553ef 100644 +--- a/drivers/atm/eni.c ++++ b/drivers/atm/eni.c +@@ -1116,6 +1116,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags); + } + paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len, + DMA_TO_DEVICE); ++ if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr)) ++ return enq_next; + ENI_PRV_PADDR(skb) = paddr; + /* prepare DMA queue entries */ + j = 0; +-- +2.34.1 + diff --git a/queue-5.4/drm-panel-simple-fix-innolux-g070y2-l01-bpp-settings.patch b/queue-5.4/drm-panel-simple-fix-innolux-g070y2-l01-bpp-settings.patch new file mode 100644 index 00000000000..b2c898ba033 --- /dev/null +++ b/queue-5.4/drm-panel-simple-fix-innolux-g070y2-l01-bpp-settings.patch @@ -0,0 +1,49 @@ +From dca5d9b7412cb3ecfcf5978de181e809b4529c50 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 20 Feb 2022 05:07:18 +0100 +Subject: drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings + +From: Marek Vasut + +[ Upstream commit fc1b6ef7bfb3d1d4df868b1c3e0480cacda6cd81 ] + +The Innolux G070Y2-L01 supports two modes of operation: +1) FRC=Low/NC ... MEDIA_BUS_FMT_RGB666_1X7X3_SPWG ... BPP=6 +2) FRC=High ..... MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ... BPP=8 + +Currently the panel description mixes both, BPP from 1) and bus +format from 2), which triggers a warning at panel-simple.c:615. + +Pick the later, set bpp=8, fix the warning. + +Fixes: a5d2ade627dca ("drm/panel: simple: Add support for Innolux G070Y2-L01") +Signed-off-by: Marek Vasut +Cc: Christoph Fritz +Cc: Laurent Pinchart +Cc: Maxime Ripard +Cc: Sam Ravnborg +Cc: Thomas Zimmermann +Reviewed-by: Laurent Pinchart +Link: https://patchwork.freedesktop.org/patch/msgid/20220220040718.532866-1-marex@denx.de +Signed-off-by: Maarten Lankhorst +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/panel/panel-simple.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c +index f0ea782df836..312a3c4e2331 100644 +--- a/drivers/gpu/drm/panel/panel-simple.c ++++ b/drivers/gpu/drm/panel/panel-simple.c +@@ -1619,7 +1619,7 @@ static const struct display_timing innolux_g070y2_l01_timing = { + static const struct panel_desc innolux_g070y2_l01 = { + .timings = &innolux_g070y2_l01_timing, + .num_timings = 1, +- .bpc = 6, ++ .bpc = 8, + .size = { + .width = 152, + .height = 91, +-- +2.34.1 + diff --git a/queue-5.4/efi-fix-return-value-of-__setup-handlers.patch b/queue-5.4/efi-fix-return-value-of-__setup-handlers.patch new file mode 100644 index 00000000000..041041ae399 --- /dev/null +++ b/queue-5.4/efi-fix-return-value-of-__setup-handlers.patch @@ -0,0 +1,82 @@ +From 559b8c757cefcc2d22f956fe146b5c7e4e75fe18 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 28 Feb 2022 20:18:51 -0800 +Subject: efi: fix return value of __setup handlers + +From: Randy Dunlap + +[ Upstream commit 9feaf8b387ee0ece9c1d7add308776b502a35d0c ] + +When "dump_apple_properties" is used on the kernel boot command line, +it causes an Unknown parameter message and the string is added to init's +argument strings: + + Unknown kernel command line parameters "dump_apple_properties + BOOT_IMAGE=/boot/bzImage-517rc6 efivar_ssdt=newcpu_ssdt", will be + passed to user space. + + Run /sbin/init as init process + with arguments: + /sbin/init + dump_apple_properties + with environment: + HOME=/ + TERM=linux + BOOT_IMAGE=/boot/bzImage-517rc6 + efivar_ssdt=newcpu_ssdt + +Similarly when "efivar_ssdt=somestring" is used, it is added to the +Unknown parameter message and to init's environment strings, polluting +them (see examples above). + +Change the return value of the __setup functions to 1 to indicate +that the __setup options have been handled. + +Fixes: 58c5475aba67 ("x86/efi: Retrieve and assign Apple device properties") +Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables") +Signed-off-by: Randy Dunlap +Reported-by: Igor Zhbanov +Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru +Cc: Ard Biesheuvel +Cc: linux-efi@vger.kernel.org +Cc: Lukas Wunner +Cc: Octavian Purdila +Cc: "Rafael J. Wysocki" +Cc: Matt Fleming +Link: https://lore.kernel.org/r/20220301041851.12459-1-rdunlap@infradead.org +Signed-off-by: Ard Biesheuvel +Signed-off-by: Sasha Levin +--- + drivers/firmware/efi/apple-properties.c | 2 +- + drivers/firmware/efi/efi.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c +index 0e206c9e0d7a..7ad2d85d7270 100644 +--- a/drivers/firmware/efi/apple-properties.c ++++ b/drivers/firmware/efi/apple-properties.c +@@ -23,7 +23,7 @@ static bool dump_properties __initdata; + static int __init dump_properties_enable(char *arg) + { + dump_properties = true; +- return 0; ++ return 1; + } + + __setup("dump_apple_properties", dump_properties_enable); +diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c +index 415d7b3a59f8..8fd74a7501d4 100644 +--- a/drivers/firmware/efi/efi.c ++++ b/drivers/firmware/efi/efi.c +@@ -231,7 +231,7 @@ static int __init efivar_ssdt_setup(char *str) + memcpy(efivar_ssdt, str, strlen(str)); + else + pr_warn("efivar_ssdt: name too long: %s\n", str); +- return 0; ++ return 1; + } + __setup("efivar_ssdt=", efivar_ssdt_setup); + +-- +2.34.1 + diff --git a/queue-5.4/hv_netvsc-add-check-for-kvmalloc_array.patch b/queue-5.4/hv_netvsc-add-check-for-kvmalloc_array.patch new file mode 100644 index 00000000000..77ae916e26a --- /dev/null +++ b/queue-5.4/hv_netvsc-add-check-for-kvmalloc_array.patch @@ -0,0 +1,40 @@ +From 505e41c6a14b3587b66429999c7546c3257ed7b0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Mar 2022 10:01:25 +0800 +Subject: hv_netvsc: Add check for kvmalloc_array + +From: Jiasheng Jiang + +[ Upstream commit 886e44c9298a6b428ae046e2fa092ca52e822e6a ] + +As the potential failure of the kvmalloc_array(), +it should be better to check and restore the 'data' +if fails in order to avoid the dereference of the +NULL pointer. + +Fixes: 6ae746711263 ("hv_netvsc: Add per-cpu ethtool stats for netvsc") +Signed-off-by: Jiasheng Jiang +Link: https://lore.kernel.org/r/20220314020125.2365084-1-jiasheng@iscas.ac.cn +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/hyperv/netvsc_drv.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c +index 362b7ca6f3b2..57e92c5bfcc9 100644 +--- a/drivers/net/hyperv/netvsc_drv.c ++++ b/drivers/net/hyperv/netvsc_drv.c +@@ -1445,6 +1445,9 @@ static void netvsc_get_ethtool_stats(struct net_device *dev, + pcpu_sum = kvmalloc_array(num_possible_cpus(), + sizeof(struct netvsc_ethtool_pcpu_stats), + GFP_KERNEL); ++ if (!pcpu_sum) ++ return; ++ + netvsc_get_pcpu_stats(dev, pcpu_sum); + for_each_present_cpu(cpu) { + struct netvsc_ethtool_pcpu_stats *this_sum = &pcpu_sum[cpu]; +-- +2.34.1 + diff --git a/queue-5.4/net-dsa-add-missing-of_node_put-in-dsa_port_parse_of.patch b/queue-5.4/net-dsa-add-missing-of_node_put-in-dsa_port_parse_of.patch new file mode 100644 index 00000000000..7cecd6cc9cc --- /dev/null +++ b/queue-5.4/net-dsa-add-missing-of_node_put-in-dsa_port_parse_of.patch @@ -0,0 +1,36 @@ +From f5dd5df9e291c77a46950dce0cc062a42bd7fb5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Mar 2022 08:26:02 +0000 +Subject: net: dsa: Add missing of_node_put() in dsa_port_parse_of + +From: Miaoqian Lin + +[ Upstream commit cb0b430b4e3acc88c85e0ad2e25f2a25a5765262 ] + +The device_node pointer is returned by of_parse_phandle() with refcount +incremented. We should use of_node_put() on it when done. + +Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time") +Signed-off-by: Miaoqian Lin +Link: https://lore.kernel.org/r/20220316082602.10785-1-linmq006@gmail.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + net/dsa/dsa2.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c +index 70e6fc2edd30..1f27641f9cc0 100644 +--- a/net/dsa/dsa2.c ++++ b/net/dsa/dsa2.c +@@ -669,6 +669,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn) + struct net_device *master; + + master = of_find_net_device_by_node(ethernet); ++ of_node_put(ethernet); + if (!master) + return -EPROBE_DEFER; + +-- +2.34.1 + diff --git a/queue-5.4/net-handle-arphrd_pimreg-in-dev_is_mac_header_xmit.patch b/queue-5.4/net-handle-arphrd_pimreg-in-dev_is_mac_header_xmit.patch new file mode 100644 index 00000000000..c4a7f4ce9d4 --- /dev/null +++ b/queue-5.4/net-handle-arphrd_pimreg-in-dev_is_mac_header_xmit.patch @@ -0,0 +1,36 @@ +From b63768cbe0acea7ce02393f250db8f6fcdf98c57 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Mar 2022 10:20:08 +0100 +Subject: net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() + +From: Nicolas Dichtel + +[ Upstream commit 4ee06de7729d795773145692e246a06448b1eb7a ] + +This kind of interface doesn't have a mac header. This patch fixes +bpf_redirect() to a PIM interface. + +Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper") +Signed-off-by: Nicolas Dichtel +Link: https://lore.kernel.org/r/20220315092008.31423-1-nicolas.dichtel@6wind.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + include/linux/if_arp.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h +index bf5c5f32c65e..e147ea679467 100644 +--- a/include/linux/if_arp.h ++++ b/include/linux/if_arp.h +@@ -51,6 +51,7 @@ static inline bool dev_is_mac_header_xmit(const struct net_device *dev) + case ARPHRD_VOID: + case ARPHRD_NONE: + case ARPHRD_RAWIP: ++ case ARPHRD_PIMREG: + return false; + default: + return true; +-- +2.34.1 + diff --git a/queue-5.4/net-packet-fix-slab-out-of-bounds-access-in-packet_r.patch b/queue-5.4/net-packet-fix-slab-out-of-bounds-access-in-packet_r.patch new file mode 100644 index 00000000000..5b597975c50 --- /dev/null +++ b/queue-5.4/net-packet-fix-slab-out-of-bounds-access-in-packet_r.patch @@ -0,0 +1,119 @@ +From 0ca910931ef94fa262c95426608a565433320dec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 12 Mar 2022 15:29:58 -0800 +Subject: net/packet: fix slab-out-of-bounds access in packet_recvmsg() + +From: Eric Dumazet + +[ Upstream commit c700525fcc06b05adfea78039de02628af79e07a ] + +syzbot found that when an AF_PACKET socket is using PACKET_COPY_THRESH +and mmap operations, tpacket_rcv() is queueing skbs with +garbage in skb->cb[], triggering a too big copy [1] + +Presumably, users of af_packet using mmap() already gets correct +metadata from the mapped buffer, we can simply make sure +to clear 12 bytes that might be copied to user space later. + +BUG: KASAN: stack-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline] +BUG: KASAN: stack-out-of-bounds in packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489 +Write of size 165 at addr ffffc9000385fb78 by task syz-executor233/3631 + +CPU: 0 PID: 3631 Comm: syz-executor233 Not tainted 5.17.0-rc7-syzkaller-02396-g0b3660695e80 #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + + __dump_stack lib/dump_stack.c:88 [inline] + dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 + print_address_description.constprop.0.cold+0xf/0x336 mm/kasan/report.c:255 + __kasan_report mm/kasan/report.c:442 [inline] + kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 + check_region_inline mm/kasan/generic.c:183 [inline] + kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 + memcpy+0x39/0x60 mm/kasan/shadow.c:66 + memcpy include/linux/fortify-string.h:225 [inline] + packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489 + sock_recvmsg_nosec net/socket.c:948 [inline] + sock_recvmsg net/socket.c:966 [inline] + sock_recvmsg net/socket.c:962 [inline] + ____sys_recvmsg+0x2c4/0x600 net/socket.c:2632 + ___sys_recvmsg+0x127/0x200 net/socket.c:2674 + __sys_recvmsg+0xe2/0x1a0 net/socket.c:2704 + do_syscall_x64 arch/x86/entry/common.c:50 [inline] + do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 + entry_SYSCALL_64_after_hwframe+0x44/0xae +RIP: 0033:0x7fdfd5954c29 +Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 +RSP: 002b:00007ffcf8e71e48 EFLAGS: 00000246 ORIG_RAX: 000000000000002f +RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fdfd5954c29 +RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000005 +RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d +R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcf8e71e60 +R13: 00000000000f4240 R14: 000000000000c1ff R15: 00007ffcf8e71e54 + + +addr ffffc9000385fb78 is located in stack of task syz-executor233/3631 at offset 32 in frame: + ____sys_recvmsg+0x0/0x600 include/linux/uio.h:246 + +this frame has 1 object: + [32, 160) 'addr' + +Memory state around the buggy address: + ffffc9000385fa80: 00 04 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 + ffffc9000385fb00: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 +>ffffc9000385fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 + ^ + ffffc9000385fc00: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1 + ffffc9000385fc80: f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 +================================================================== + +Fixes: 0fb375fb9b93 ("[AF_PACKET]: Allow for > 8 byte hardware addresses.") +Signed-off-by: Eric Dumazet +Reported-by: syzbot +Link: https://lore.kernel.org/r/20220312232958.3535620-1-eric.dumazet@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/packet/af_packet.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c +index ed11013d4b95..70c102359bfe 100644 +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -2257,8 +2257,11 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, + copy_skb = skb_get(skb); + skb_head = skb->data; + } +- if (copy_skb) ++ if (copy_skb) { ++ memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0, ++ sizeof(PACKET_SKB_CB(copy_skb)->sa.ll)); + skb_set_owner_r(copy_skb, sk); ++ } + } + snaplen = po->rx_ring.frame_size - macoff; + if ((int)snaplen < 0) { +@@ -3405,6 +3408,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, + sock_recv_ts_and_drops(msg, sk, skb); + + if (msg->msg_name) { ++ const size_t max_len = min(sizeof(skb->cb), ++ sizeof(struct sockaddr_storage)); + int copy_len; + + /* If the address length field is there to be filled +@@ -3427,6 +3432,10 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, + msg->msg_namelen = sizeof(struct sockaddr_ll); + } + } ++ if (WARN_ON_ONCE(copy_len > max_len)) { ++ copy_len = max_len; ++ msg->msg_namelen = copy_len; ++ } + memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len); + } + +-- +2.34.1 + diff --git a/queue-5.4/net-phy-marvell-fix-invalid-comparison-in-the-resume.patch b/queue-5.4/net-phy-marvell-fix-invalid-comparison-in-the-resume.patch new file mode 100644 index 00000000000..7f9b436d665 --- /dev/null +++ b/queue-5.4/net-phy-marvell-fix-invalid-comparison-in-the-resume.patch @@ -0,0 +1,54 @@ +From 622e15630370f5bd3bd549e0b18a884bce6ef38f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 12 Mar 2022 15:15:13 -0500 +Subject: net: phy: marvell: Fix invalid comparison in the resume and suspend + functions + +From: Kurt Cancemi + +[ Upstream commit 837d9e49402eaf030db55a49f96fc51d73b4b441 ] + +This bug resulted in only the current mode being resumed and suspended when +the PHY supported both fiber and copper modes and when the PHY only supported +copper mode the fiber mode would incorrectly be attempted to be resumed and +suspended. + +Fixes: 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.") +Signed-off-by: Kurt Cancemi +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/20220312201512.326047-1-kurt@x64architecture.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/phy/marvell.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c +index 53420c531266..49801c2eb627 100644 +--- a/drivers/net/phy/marvell.c ++++ b/drivers/net/phy/marvell.c +@@ -1408,8 +1408,8 @@ static int marvell_suspend(struct phy_device *phydev) + int err; + + /* Suspend the fiber mode first */ +- if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, +- phydev->supported)) { ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, ++ phydev->supported)) { + err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); + if (err < 0) + goto error; +@@ -1443,8 +1443,8 @@ static int marvell_resume(struct phy_device *phydev) + int err; + + /* Resume the fiber mode first */ +- if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, +- phydev->supported)) { ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, ++ phydev->supported)) { + err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); + if (err < 0) + goto error; +-- +2.34.1 + diff --git a/queue-5.4/series b/queue-5.4/series index 68c527ca09c..efe01276036 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -1,2 +1,11 @@ crypto-qcom-rng-ensure-buffer-for-generate-is-completely-filled.patch ocfs2-fix-crash-when-initialize-filecheck-kobj-fails.patch +efi-fix-return-value-of-__setup-handlers.patch +net-phy-marvell-fix-invalid-comparison-in-the-resume.patch +net-packet-fix-slab-out-of-bounds-access-in-packet_r.patch +atm-eni-add-check-for-dma_map_single.patch +hv_netvsc-add-check-for-kvmalloc_array.patch +drm-panel-simple-fix-innolux-g070y2-l01-bpp-settings.patch +net-handle-arphrd_pimreg-in-dev_is_mac_header_xmit.patch +net-dsa-add-missing-of_node_put-in-dsa_port_parse_of.patch +arm64-fix-clang-warning-about-tramp_valias.patch