From: Greg Kroah-Hartman Date: Mon, 28 Oct 2024 00:32:47 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v5.15.170~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94ad2a40a820264e9570bef3686b2a28d313ce01;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: acpi-button-add-dmi-quirk-for-samsung-galaxy-book2-to-fix-initial-lid-detection-issue.patch drm-amd-guard-against-bad-data-for-atif-acpi-method.patch hv_netvsc-fix-vf-namespace-also-in-synthetic-nic-netdev_register-event.patch nilfs2-fix-kernel-bug-due-to-missing-clearing-of-buffer-delay-flag.patch --- diff --git a/queue-4.19/acpi-button-add-dmi-quirk-for-samsung-galaxy-book2-to-fix-initial-lid-detection-issue.patch b/queue-4.19/acpi-button-add-dmi-quirk-for-samsung-galaxy-book2-to-fix-initial-lid-detection-issue.patch new file mode 100644 index 00000000000..ad66a1d92a1 --- /dev/null +++ b/queue-4.19/acpi-button-add-dmi-quirk-for-samsung-galaxy-book2-to-fix-initial-lid-detection-issue.patch @@ -0,0 +1,50 @@ +From 8fa73ee44daefc884c53a25158c25a4107eb5a94 Mon Sep 17 00:00:00 2001 +From: Shubham Panwar +Date: Sun, 20 Oct 2024 15:20:46 +0530 +Subject: ACPI: button: Add DMI quirk for Samsung Galaxy Book2 to fix initial lid detection issue + +From: Shubham Panwar + +commit 8fa73ee44daefc884c53a25158c25a4107eb5a94 upstream. + +Add a DMI quirk for Samsung Galaxy Book2 to fix an initial lid state +detection issue. + +The _LID device incorrectly returns the lid status as "closed" during +boot, causing the system to enter a suspend loop right after booting. + +The quirk ensures that the correct lid state is reported initially, +preventing the system from immediately suspending after startup. It +only addresses the initial lid state detection and ensures proper +system behavior upon boot. + +Signed-off-by: Shubham Panwar +Link: https://patch.msgid.link/20241020095045.6036-2-shubiisp8@gmail.com +[ rjw: Changelog edits ] +Cc: All applicable +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/button.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/acpi/button.c ++++ b/drivers/acpi/button.c +@@ -124,6 +124,17 @@ static const struct dmi_system_id lid_bl + }, + .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, + }, ++ { ++ /* ++ * Samsung galaxybook2 ,initial _LID device notification returns ++ * lid closed. ++ */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "750XED"), ++ }, ++ .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, ++ }, + {} + }; + diff --git a/queue-4.19/drm-amd-guard-against-bad-data-for-atif-acpi-method.patch b/queue-4.19/drm-amd-guard-against-bad-data-for-atif-acpi-method.patch new file mode 100644 index 00000000000..669f3f72329 --- /dev/null +++ b/queue-4.19/drm-amd-guard-against-bad-data-for-atif-acpi-method.patch @@ -0,0 +1,75 @@ +From bf58f03931fdcf7b3c45cb76ac13244477a60f44 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Fri, 11 Oct 2024 12:23:15 -0500 +Subject: drm/amd: Guard against bad data for ATIF ACPI method + +From: Mario Limonciello + +commit bf58f03931fdcf7b3c45cb76ac13244477a60f44 upstream. + +If a BIOS provides bad data in response to an ATIF method call +this causes a NULL pointer dereference in the caller. + +``` +? show_regs (arch/x86/kernel/dumpstack.c:478 (discriminator 1)) +? __die (arch/x86/kernel/dumpstack.c:423 arch/x86/kernel/dumpstack.c:434) +? page_fault_oops (arch/x86/mm/fault.c:544 (discriminator 2) arch/x86/mm/fault.c:705 (discriminator 2)) +? do_user_addr_fault (arch/x86/mm/fault.c:440 (discriminator 1) arch/x86/mm/fault.c:1232 (discriminator 1)) +? acpi_ut_update_object_reference (drivers/acpi/acpica/utdelete.c:642) +? exc_page_fault (arch/x86/mm/fault.c:1542) +? asm_exc_page_fault (./arch/x86/include/asm/idtentry.h:623) +? amdgpu_atif_query_backlight_caps.constprop.0 (drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:387 (discriminator 2)) amdgpu +? amdgpu_atif_query_backlight_caps.constprop.0 (drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:386 (discriminator 1)) amdgpu +``` + +It has been encountered on at least one system, so guard for it. + +Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") +Acked-by: Alex Deucher +Signed-off-by: Mario Limonciello +Signed-off-by: Alex Deucher +(cherry picked from commit c9b7c809b89f24e9372a4e7f02d64c950b07fdee) +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +@@ -90,6 +90,7 @@ static union acpi_object *amdgpu_atif_ca + struct acpi_buffer *params) + { + acpi_status status; ++ union acpi_object *obj; + union acpi_object atif_arg_elements[2]; + struct acpi_object_list atif_arg; + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; +@@ -112,16 +113,24 @@ static union acpi_object *amdgpu_atif_ca + + status = acpi_evaluate_object(atif->handle, NULL, &atif_arg, + &buffer); ++ obj = (union acpi_object *)buffer.pointer; + +- /* Fail only if calling the method fails and ATIF is supported */ ++ /* Fail if calling the method fails and ATIF is supported */ + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + DRM_DEBUG_DRIVER("failed to evaluate ATIF got %s\n", + acpi_format_exception(status)); +- kfree(buffer.pointer); ++ kfree(obj); + return NULL; + } + +- return buffer.pointer; ++ if (obj->type != ACPI_TYPE_BUFFER) { ++ DRM_DEBUG_DRIVER("bad object returned from ATIF: %d\n", ++ obj->type); ++ kfree(obj); ++ return NULL; ++ } ++ ++ return obj; + } + + /** diff --git a/queue-4.19/hv_netvsc-fix-vf-namespace-also-in-synthetic-nic-netdev_register-event.patch b/queue-4.19/hv_netvsc-fix-vf-namespace-also-in-synthetic-nic-netdev_register-event.patch new file mode 100644 index 00000000000..609002e3e8f --- /dev/null +++ b/queue-4.19/hv_netvsc-fix-vf-namespace-also-in-synthetic-nic-netdev_register-event.patch @@ -0,0 +1,75 @@ +From 4c262801ea60c518b5bebc22a09f5b78b3147da2 Mon Sep 17 00:00:00 2001 +From: Haiyang Zhang +Date: Fri, 18 Oct 2024 11:25:22 -0700 +Subject: hv_netvsc: Fix VF namespace also in synthetic NIC NETDEV_REGISTER event + +From: Haiyang Zhang + +commit 4c262801ea60c518b5bebc22a09f5b78b3147da2 upstream. + +The existing code moves VF to the same namespace as the synthetic NIC +during netvsc_register_vf(). But, if the synthetic device is moved to a +new namespace after the VF registration, the VF won't be moved together. + +To make the behavior more consistent, add a namespace check for synthetic +NIC's NETDEV_REGISTER event (generated during its move), and move the VF +if it is not in the same namespace. + +Cc: stable@vger.kernel.org +Fixes: c0a41b887ce6 ("hv_netvsc: move VF to same namespace as netvsc device") +Suggested-by: Stephen Hemminger +Signed-off-by: Haiyang Zhang +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/1729275922-17595-1-git-send-email-haiyangz@microsoft.com +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/hyperv/netvsc_drv.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/drivers/net/hyperv/netvsc_drv.c ++++ b/drivers/net/hyperv/netvsc_drv.c +@@ -2526,6 +2526,31 @@ static struct hv_driver netvsc_drv = { + }, + }; + ++/* Set VF's namespace same as the synthetic NIC */ ++static void netvsc_event_set_vf_ns(struct net_device *ndev) ++{ ++ struct net_device_context *ndev_ctx = netdev_priv(ndev); ++ struct net_device *vf_netdev; ++ int ret; ++ ++ vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); ++ if (!vf_netdev) ++ return; ++ ++ if (!net_eq(dev_net(ndev), dev_net(vf_netdev))) { ++ ret = dev_change_net_namespace(vf_netdev, dev_net(ndev), ++ "eth%d"); ++ if (ret) ++ netdev_err(vf_netdev, ++ "Cannot move to same namespace as %s: %d\n", ++ ndev->name, ret); ++ else ++ netdev_info(vf_netdev, ++ "Moved VF to namespace with: %s\n", ++ ndev->name); ++ } ++} ++ + /* + * On Hyper-V, every VF interface is matched with a corresponding + * synthetic interface. The synthetic interface is presented first +@@ -2538,6 +2563,11 @@ static int netvsc_netdev_event(struct no + struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); + int ret = 0; + ++ if (event_dev->netdev_ops == &device_ops && event == NETDEV_REGISTER) { ++ netvsc_event_set_vf_ns(event_dev); ++ return NOTIFY_DONE; ++ } ++ + ret = check_dev_is_matching_vf(event_dev); + if (ret != 0) + return NOTIFY_DONE; diff --git a/queue-4.19/nilfs2-fix-kernel-bug-due-to-missing-clearing-of-buffer-delay-flag.patch b/queue-4.19/nilfs2-fix-kernel-bug-due-to-missing-clearing-of-buffer-delay-flag.patch new file mode 100644 index 00000000000..cc66ff1b069 --- /dev/null +++ b/queue-4.19/nilfs2-fix-kernel-bug-due-to-missing-clearing-of-buffer-delay-flag.patch @@ -0,0 +1,55 @@ +From 6ed469df0bfbef3e4b44fca954a781919db9f7ab Mon Sep 17 00:00:00 2001 +From: Ryusuke Konishi +Date: Wed, 16 Oct 2024 06:32:07 +0900 +Subject: nilfs2: fix kernel bug due to missing clearing of buffer delay flag + +From: Ryusuke Konishi + +commit 6ed469df0bfbef3e4b44fca954a781919db9f7ab upstream. + +Syzbot reported that after nilfs2 reads a corrupted file system image +and degrades to read-only, the BUG_ON check for the buffer delay flag +in submit_bh_wbc() may fail, causing a kernel bug. + +This is because the buffer delay flag is not cleared when clearing the +buffer state flags to discard a page/folio or a buffer head. So, fix +this. + +This became necessary when the use of nilfs2's own page clear routine +was expanded. This state inconsistency does not occur if the buffer +is written normally by log writing. + +Signed-off-by: Ryusuke Konishi +Link: https://lore.kernel.org/r/20241015213300.7114-1-konishi.ryusuke@gmail.com +Fixes: 8c26c4e2694a ("nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption") +Reported-by: syzbot+985ada84bf055a575c07@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=985ada84bf055a575c07 +Cc: stable@vger.kernel.org +Signed-off-by: Christian Brauner +Signed-off-by: Greg Kroah-Hartman +--- + fs/nilfs2/page.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/nilfs2/page.c ++++ b/fs/nilfs2/page.c +@@ -78,7 +78,8 @@ void nilfs_forget_buffer(struct buffer_h + const unsigned long clear_bits = + (BIT(BH_Uptodate) | BIT(BH_Dirty) | BIT(BH_Mapped) | + BIT(BH_Async_Write) | BIT(BH_NILFS_Volatile) | +- BIT(BH_NILFS_Checked) | BIT(BH_NILFS_Redirected)); ++ BIT(BH_NILFS_Checked) | BIT(BH_NILFS_Redirected) | ++ BIT(BH_Delay)); + + lock_buffer(bh); + set_mask_bits(&bh->b_state, clear_bits, 0); +@@ -412,7 +413,8 @@ void nilfs_clear_dirty_page(struct page + const unsigned long clear_bits = + (BIT(BH_Uptodate) | BIT(BH_Dirty) | BIT(BH_Mapped) | + BIT(BH_Async_Write) | BIT(BH_NILFS_Volatile) | +- BIT(BH_NILFS_Checked) | BIT(BH_NILFS_Redirected)); ++ BIT(BH_NILFS_Checked) | BIT(BH_NILFS_Redirected) | ++ BIT(BH_Delay)); + + bh = head = page_buffers(page); + do { diff --git a/queue-4.19/series b/queue-4.19/series index e5188d42542..d274ae908db 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -313,3 +313,7 @@ dt-bindings-power-add-r8a774b1-sysc-power-domain-def.patch net-usb-usbnet-fix-name-regression.patch posix-clock-posix-clock-fix-unbalanced-locking-in-pc.patch alsa-hda-realtek-update-default-depop-procedure.patch +drm-amd-guard-against-bad-data-for-atif-acpi-method.patch +acpi-button-add-dmi-quirk-for-samsung-galaxy-book2-to-fix-initial-lid-detection-issue.patch +nilfs2-fix-kernel-bug-due-to-missing-clearing-of-buffer-delay-flag.patch +hv_netvsc-fix-vf-namespace-also-in-synthetic-nic-netdev_register-event.patch