From: Greg Kroah-Hartman Date: Thu, 30 Nov 2023 14:37:07 +0000 (+0000) Subject: 5.4-stable patches X-Git-Tag: v5.15.141~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91713bddec4329d641b70802f3b1f8df16f722c2;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: acpi-resource-skip-irq-override-on-asus-expertbook-b1402cva.patch bcache-replace-a-mistaken-is_err-by-is_err_or_null-in-btree_gc_coalesce.patch hv_netvsc-fix-race-of-register_netdevice_notifier-and-vf-register.patch hv_netvsc-mark-vf-as-slave-before-exposing-it-to-user-mode.patch s390-dasd-protect-device-queue-against-concurrent-access.patch usb-serial-option-add-luat-air72-u-series-products.patch --- diff --git a/queue-5.4/acpi-resource-skip-irq-override-on-asus-expertbook-b1402cva.patch b/queue-5.4/acpi-resource-skip-irq-override-on-asus-expertbook-b1402cva.patch new file mode 100644 index 00000000000..16667f72cf3 --- /dev/null +++ b/queue-5.4/acpi-resource-skip-irq-override-on-asus-expertbook-b1402cva.patch @@ -0,0 +1,41 @@ +From bd911485294a6f0596e4592ed442438015cffc8a Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 15 Nov 2023 19:02:22 +0100 +Subject: ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA + +From: Hans de Goede + +commit bd911485294a6f0596e4592ed442438015cffc8a upstream. + +Like various other ASUS ExpertBook-s, the ASUS ExpertBook B1402CVA +has an ACPI DSDT table that describes IRQ 1 as ActiveLow while +the kernel overrides it to EdgeHigh. + +This prevents the keyboard from working. To fix this issue, add this laptop +to the skip_override_table so that the kernel does not override IRQ 1. + +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218114 +Cc: All applicable +Signed-off-by: Hans de Goede +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/resource.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/acpi/resource.c ++++ b/drivers/acpi/resource.c +@@ -449,6 +449,13 @@ static const struct dmi_system_id asus_l + }, + }, + { ++ /* Asus ExpertBook B1402CVA */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"), ++ }, ++ }, ++ { + /* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"), diff --git a/queue-5.4/bcache-replace-a-mistaken-is_err-by-is_err_or_null-in-btree_gc_coalesce.patch b/queue-5.4/bcache-replace-a-mistaken-is_err-by-is_err_or_null-in-btree_gc_coalesce.patch new file mode 100644 index 00000000000..a2394b43e7e --- /dev/null +++ b/queue-5.4/bcache-replace-a-mistaken-is_err-by-is_err_or_null-in-btree_gc_coalesce.patch @@ -0,0 +1,52 @@ +From f72f4312d4388376fc8a1f6cf37cb21a0d41758b Mon Sep 17 00:00:00 2001 +From: Coly Li +Date: Mon, 20 Nov 2023 13:25:01 +0800 +Subject: bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in btree_gc_coalesce() + +From: Coly Li + +commit f72f4312d4388376fc8a1f6cf37cb21a0d41758b upstream. + +Commit 028ddcac477b ("bcache: Remove unnecessary NULL point check in +node allocations") do the following change inside btree_gc_coalesce(), + +31 @@ -1340,7 +1340,7 @@ static int btree_gc_coalesce( +32 memset(new_nodes, 0, sizeof(new_nodes)); +33 closure_init_stack(&cl); +34 +35 - while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b)) +36 + while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b)) +37 keys += r[nodes++].keys; +38 +39 blocks = btree_default_blocks(b->c) * 2 / 3; + +At line 35 the original r[nodes].b is not always allocatored from +__bch_btree_node_alloc(), and possibly initialized as NULL pointer by +caller of btree_gc_coalesce(). Therefore the change at line 36 is not +correct. + +This patch replaces the mistaken IS_ERR() by IS_ERR_OR_NULL() to avoid +potential issue. + +Fixes: 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") +Cc: # 6.5+ +Cc: Zheng Wang +Signed-off-by: Coly Li +Link: https://lore.kernel.org/r/20231120052503.6122-9-colyli@suse.de +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/bcache/btree.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/md/bcache/btree.c ++++ b/drivers/md/bcache/btree.c +@@ -1391,7 +1391,7 @@ static int btree_gc_coalesce(struct btre + memset(new_nodes, 0, sizeof(new_nodes)); + closure_init_stack(&cl); + +- while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b)) ++ while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b)) + keys += r[nodes++].keys; + + blocks = btree_default_blocks(b->c) * 2 / 3; diff --git a/queue-5.4/hv_netvsc-fix-race-of-register_netdevice_notifier-and-vf-register.patch b/queue-5.4/hv_netvsc-fix-race-of-register_netdevice_notifier-and-vf-register.patch new file mode 100644 index 00000000000..e4090928a81 --- /dev/null +++ b/queue-5.4/hv_netvsc-fix-race-of-register_netdevice_notifier-and-vf-register.patch @@ -0,0 +1,49 @@ +From 85520856466ed6bc3b1ccb013cddac70ceb437db Mon Sep 17 00:00:00 2001 +From: Haiyang Zhang +Date: Sun, 19 Nov 2023 08:23:42 -0800 +Subject: hv_netvsc: Fix race of register_netdevice_notifier and VF register + +From: Haiyang Zhang + +commit 85520856466ed6bc3b1ccb013cddac70ceb437db upstream. + +If VF NIC is registered earlier, NETDEV_REGISTER event is replayed, +but NETDEV_POST_INIT is not. + +Move register_netdevice_notifier() earlier, so the call back +function is set before probing. + +Cc: stable@vger.kernel.org +Fixes: e04e7a7bbd4b ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()") +Reported-by: Dexuan Cui +Signed-off-by: Haiyang Zhang +Reviewed-by: Wojciech Drewek +Reviewed-by: Dexuan Cui +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/hyperv/netvsc_drv.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/net/hyperv/netvsc_drv.c ++++ b/drivers/net/hyperv/netvsc_drv.c +@@ -2528,12 +2528,17 @@ static int __init netvsc_drv_init(void) + } + netvsc_ring_bytes = ring_size * PAGE_SIZE; + ++ register_netdevice_notifier(&netvsc_netdev_notifier); ++ + ret = vmbus_driver_register(&netvsc_drv); + if (ret) +- return ret; ++ goto err_vmbus_reg; + +- register_netdevice_notifier(&netvsc_netdev_notifier); + return 0; ++ ++err_vmbus_reg: ++ unregister_netdevice_notifier(&netvsc_netdev_notifier); ++ return ret; + } + + MODULE_LICENSE("GPL"); diff --git a/queue-5.4/hv_netvsc-mark-vf-as-slave-before-exposing-it-to-user-mode.patch b/queue-5.4/hv_netvsc-mark-vf-as-slave-before-exposing-it-to-user-mode.patch new file mode 100644 index 00000000000..43b5ceb0bff --- /dev/null +++ b/queue-5.4/hv_netvsc-mark-vf-as-slave-before-exposing-it-to-user-mode.patch @@ -0,0 +1,95 @@ +From c807d6cd089d2f4951baa838081ec5ae3e2360f8 Mon Sep 17 00:00:00 2001 +From: Long Li +Date: Sun, 19 Nov 2023 08:23:43 -0800 +Subject: hv_netvsc: Mark VF as slave before exposing it to user-mode + +From: Long Li + +commit c807d6cd089d2f4951baa838081ec5ae3e2360f8 upstream. + +When a VF is being exposed form the kernel, it should be marked as "slave" +before exposing to the user-mode. The VF is not usable without netvsc +running as master. The user-mode should never see a VF without the "slave" +flag. + +This commit moves the code of setting the slave flag to the time before +VF is exposed to user-mode. + +Cc: stable@vger.kernel.org +Fixes: 0c195567a8f6 ("netvsc: transparent VF management") +Signed-off-by: Long Li +Signed-off-by: Haiyang Zhang +Acked-by: Stephen Hemminger +Acked-by: Dexuan Cui +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/hyperv/netvsc_drv.c | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +--- a/drivers/net/hyperv/netvsc_drv.c ++++ b/drivers/net/hyperv/netvsc_drv.c +@@ -2060,9 +2060,6 @@ static int netvsc_vf_join(struct net_dev + goto upper_link_failed; + } + +- /* set slave flag before open to prevent IPv6 addrconf */ +- vf_netdev->flags |= IFF_SLAVE; +- + schedule_delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT); + + call_netdevice_notifiers(NETDEV_JOIN, vf_netdev); +@@ -2160,16 +2157,18 @@ static struct net_device *get_netvsc_bys + return hv_get_drvdata(ndev_ctx->device_ctx); + } + +- /* Fallback path to check synthetic vf with +- * help of mac addr ++ /* Fallback path to check synthetic vf with help of mac addr. ++ * Because this function can be called before vf_netdev is ++ * initialized (NETDEV_POST_INIT) when its perm_addr has not been copied ++ * from dev_addr, also try to match to its dev_addr. ++ * Note: On Hyper-V and Azure, it's not possible to set a MAC address ++ * on a VF that matches to the MAC of a unrelated NETVSC device. + */ + list_for_each_entry(ndev_ctx, &netvsc_dev_list, list) { + ndev = hv_get_drvdata(ndev_ctx->device_ctx); +- if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr)) { +- netdev_notice(vf_netdev, +- "falling back to mac addr based matching\n"); ++ if (ether_addr_equal(vf_netdev->perm_addr, ndev->perm_addr) || ++ ether_addr_equal(vf_netdev->dev_addr, ndev->perm_addr)) + return ndev; +- } + } + + netdev_notice(vf_netdev, +@@ -2177,6 +2176,19 @@ static struct net_device *get_netvsc_bys + return NULL; + } + ++static int netvsc_prepare_bonding(struct net_device *vf_netdev) ++{ ++ struct net_device *ndev; ++ ++ ndev = get_netvsc_byslot(vf_netdev); ++ if (!ndev) ++ return NOTIFY_DONE; ++ ++ /* set slave flag before open to prevent IPv6 addrconf */ ++ vf_netdev->flags |= IFF_SLAVE; ++ return NOTIFY_DONE; ++} ++ + static int netvsc_register_vf(struct net_device *vf_netdev) + { + struct net_device_context *net_device_ctx; +@@ -2495,6 +2507,8 @@ static int netvsc_netdev_event(struct no + return NOTIFY_DONE; + + switch (event) { ++ case NETDEV_POST_INIT: ++ return netvsc_prepare_bonding(event_dev); + case NETDEV_REGISTER: + return netvsc_register_vf(event_dev); + case NETDEV_UNREGISTER: diff --git a/queue-5.4/s390-dasd-protect-device-queue-against-concurrent-access.patch b/queue-5.4/s390-dasd-protect-device-queue-against-concurrent-access.patch new file mode 100644 index 00000000000..9ea79c02e06 --- /dev/null +++ b/queue-5.4/s390-dasd-protect-device-queue-against-concurrent-access.patch @@ -0,0 +1,69 @@ +From db46cd1e0426f52999d50fa72cfa97fa39952885 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20H=C3=B6ppner?= +Date: Wed, 25 Oct 2023 15:24:37 +0200 +Subject: s390/dasd: protect device queue against concurrent access +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jan Höppner + +commit db46cd1e0426f52999d50fa72cfa97fa39952885 upstream. + +In dasd_profile_start() the amount of requests on the device queue are +counted. The access to the device queue is unprotected against +concurrent access. With a lot of parallel I/O, especially with alias +devices enabled, the device queue can change while dasd_profile_start() +is accessing the queue. In the worst case this leads to a kernel panic +due to incorrect pointer accesses. + +Fix this by taking the device lock before accessing the queue and +counting the requests. Additionally the check for a valid profile data +pointer can be done earlier to avoid unnecessary locking in a hot path. + +Cc: +Fixes: 4fa52aa7a82f ("[S390] dasd: add enhanced DASD statistics interface") +Reviewed-by: Stefan Haberland +Signed-off-by: Jan Höppner +Signed-off-by: Stefan Haberland +Link: https://lore.kernel.org/r/20231025132437.1223363-3-sth@linux.ibm.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/s390/block/dasd.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +--- a/drivers/s390/block/dasd.c ++++ b/drivers/s390/block/dasd.c +@@ -737,18 +737,20 @@ static void dasd_profile_start(struct da + * we count each request only once. + */ + device = cqr->startdev; +- if (device->profile.data) { +- counter = 1; /* request is not yet queued on the start device */ +- list_for_each(l, &device->ccw_queue) +- if (++counter >= 31) +- break; +- } ++ if (!device->profile.data) ++ return; ++ ++ spin_lock(get_ccwdev_lock(device->cdev)); ++ counter = 1; /* request is not yet queued on the start device */ ++ list_for_each(l, &device->ccw_queue) ++ if (++counter >= 31) ++ break; ++ spin_unlock(get_ccwdev_lock(device->cdev)); ++ + spin_lock(&device->profile.lock); +- if (device->profile.data) { +- device->profile.data->dasd_io_nr_req[counter]++; +- if (rq_data_dir(req) == READ) +- device->profile.data->dasd_read_nr_req[counter]++; +- } ++ device->profile.data->dasd_io_nr_req[counter]++; ++ if (rq_data_dir(req) == READ) ++ device->profile.data->dasd_read_nr_req[counter]++; + spin_unlock(&device->profile.lock); + } + diff --git a/queue-5.4/series b/queue-5.4/series index 30ca3d82d87..6603875c8f3 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -31,3 +31,9 @@ ext4-make-sure-allocate-pending-entry-not-fail.patch tracing-kprobes-return-eaddrnotavail-when-func-matches-several-symbols.patch arm64-cpufeature-extract-capped-perfmon-fields.patch kvm-arm64-limit-pmu-version-to-pmuv3-for-armv8.1.patch +acpi-resource-skip-irq-override-on-asus-expertbook-b1402cva.patch +bcache-replace-a-mistaken-is_err-by-is_err_or_null-in-btree_gc_coalesce.patch +s390-dasd-protect-device-queue-against-concurrent-access.patch +usb-serial-option-add-luat-air72-u-series-products.patch +hv_netvsc-fix-race-of-register_netdevice_notifier-and-vf-register.patch +hv_netvsc-mark-vf-as-slave-before-exposing-it-to-user-mode.patch diff --git a/queue-5.4/usb-serial-option-add-luat-air72-u-series-products.patch b/queue-5.4/usb-serial-option-add-luat-air72-u-series-products.patch new file mode 100644 index 00000000000..ca56d1ec0d9 --- /dev/null +++ b/queue-5.4/usb-serial-option-add-luat-air72-u-series-products.patch @@ -0,0 +1,68 @@ +From da90e45d5afc4da2de7cd3ea7943d0f1baa47cc2 Mon Sep 17 00:00:00 2001 +From: Asuna Yang +Date: Wed, 22 Nov 2023 22:18:03 +0800 +Subject: USB: serial: option: add Luat Air72*U series products + +From: Asuna Yang + +commit da90e45d5afc4da2de7cd3ea7943d0f1baa47cc2 upstream. + +Update the USB serial option driver support for Luat Air72*U series +products. + +ID 1782:4e00 Spreadtrum Communications Inc. UNISOC-8910 + +T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 13 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=1782 ProdID=4e00 Rev=00.00 +S: Manufacturer=UNISOC +S: Product=UNISOC-8910 +C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=400mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host +E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=4096ms +I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +If#= 2: AT +If#= 3: PPP + AT +If#= 4: Debug + +Co-developed-by: Yangyu Chen +Signed-off-by: Yangyu Chen +Signed-off-by: Asuna Yang +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -609,6 +609,8 @@ static void option_instat_callback(struc + #define UNISOC_VENDOR_ID 0x1782 + /* TOZED LT70-C based on UNISOC SL8563 uses UNISOC's vendor ID */ + #define TOZED_PRODUCT_LT70C 0x4055 ++/* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */ ++#define LUAT_PRODUCT_AIR720U 0x4e00 + + /* Device flags */ + +@@ -2271,6 +2273,7 @@ static const struct usb_device_id option + { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) }, + { } /* Terminating entry */ + }; + MODULE_DEVICE_TABLE(usb, option_ids);