From: Greg Kroah-Hartman Date: Tue, 31 Oct 2023 12:03:28 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v6.1.61~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6035bc3203e872f9c4bf6e3b1bf60809470088d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: f2fs-fix-to-do-sanity-check-on-inode-type-during-garbage-collection.patch kobject-fix-slab-out-of-bounds-in-fill_kobj_path.patch nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch smbdirect-missing-rc-checks-while-waiting-for-rdma-events.patch x86-i8259-skip-probing-when-acpi-madt-advertises-pcat-compatibility.patch --- diff --git a/queue-4.19/acpica-add-support-for-madt-online-enabled-bit.patch b/queue-4.19/acpica-add-support-for-madt-online-enabled-bit.patch deleted file mode 100644 index 3616f31d672..00000000000 --- a/queue-4.19/acpica-add-support-for-madt-online-enabled-bit.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2c2a21d057044c0274c5aac6e35370aa26a6e9db Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 8 Sep 2021 16:41:45 -0500 -Subject: ACPICA: Add support for MADT online enabled bit - -From: Mario Limonciello - -[ Upstream commit 435a8dc8d9b9d91e625901fea5b5695b9b976d84 ] - -The online enabled bit on newer ACPI implmentations will indicate -whether the CPU is hotpluggable. - -Link: http://github.com/acpica/acpica/pull/708/ -Signed-off-by: Mario Limonciello -Signed-off-by: Rafael J. Wysocki -Stable-dep-of: 128b0c9781c9 ("x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility") -Signed-off-by: Sasha Levin ---- - include/acpi/actbl2.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h -index 1d4ef0621174d..4b722c376479e 100644 ---- a/include/acpi/actbl2.h -+++ b/include/acpi/actbl2.h -@@ -715,6 +715,7 @@ struct acpi_madt_generic_translator { - /* MADT Local APIC flags */ - - #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ -+#define ACPI_MADT_ONLINE_CAPABLE (2) /* 01: System HW supports enabling processor at runtime */ - - /* MADT MPS INTI flags (inti_flags) */ - --- -2.42.0 - diff --git a/queue-4.19/f2fs-fix-to-do-sanity-check-on-inode-type-during-garbage-collection.patch b/queue-4.19/f2fs-fix-to-do-sanity-check-on-inode-type-during-garbage-collection.patch new file mode 100644 index 00000000000..1eb6a55515b --- /dev/null +++ b/queue-4.19/f2fs-fix-to-do-sanity-check-on-inode-type-during-garbage-collection.patch @@ -0,0 +1,66 @@ +From 9056d6489f5a41cfbb67f719d2c0ce61ead72d9f Mon Sep 17 00:00:00 2001 +From: Chao Yu +Date: Mon, 6 Dec 2021 22:44:19 +0800 +Subject: f2fs: fix to do sanity check on inode type during garbage collection + +From: Chao Yu + +commit 9056d6489f5a41cfbb67f719d2c0ce61ead72d9f upstream. + +As report by Wenqing Liu in bugzilla: + +https://bugzilla.kernel.org/show_bug.cgi?id=215231 + +- Overview +kernel NULL pointer dereference triggered in folio_mark_dirty() when mount and operate on a crafted f2fs image + +- Reproduce +tested on kernel 5.16-rc3, 5.15.X under root + +1. mkdir mnt +2. mount -t f2fs tmp1.img mnt +3. touch tmp +4. cp tmp mnt + +F2FS-fs (loop0): sanity_check_inode: inode (ino=49) extent info [5942, 4294180864, 4] is incorrect, run fsck to fix +F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=31340049, run fsck to fix. +BUG: kernel NULL pointer dereference, address: 0000000000000000 + folio_mark_dirty+0x33/0x50 + move_data_page+0x2dd/0x460 [f2fs] + do_garbage_collect+0xc18/0x16a0 [f2fs] + f2fs_gc+0x1d3/0xd90 [f2fs] + f2fs_balance_fs+0x13a/0x570 [f2fs] + f2fs_create+0x285/0x840 [f2fs] + path_openat+0xe6d/0x1040 + do_filp_open+0xc5/0x140 + do_sys_openat2+0x23a/0x310 + do_sys_open+0x57/0x80 + +The root cause is for special file: e.g. character, block, fifo or socket file, +f2fs doesn't assign address space operations pointer array for mapping->a_ops field, +so, in a fuzzed image, SSA table indicates a data block belong to special file, when +f2fs tries to migrate that block, it causes NULL pointer access once move_data_page() +calls a_ops->set_dirty_page(). + +Cc: stable@vger.kernel.org +Reported-by: Wenqing Liu +Signed-off-by: Chao Yu +Signed-off-by: Jaegeuk Kim +Signed-off-by: Kazunori Kobayashi +Signed-off-by: Greg Kroah-Hartman +--- + fs/f2fs/gc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/f2fs/gc.c ++++ b/fs/f2fs/gc.c +@@ -958,7 +958,8 @@ next_step: + + if (phase == 3) { + inode = f2fs_iget(sb, dni.ino); +- if (IS_ERR(inode) || is_bad_inode(inode)) ++ if (IS_ERR(inode) || is_bad_inode(inode) || ++ special_file(inode->i_mode)) + continue; + + if (!down_write_trylock( diff --git a/queue-4.19/kobject-fix-slab-out-of-bounds-in-fill_kobj_path.patch b/queue-4.19/kobject-fix-slab-out-of-bounds-in-fill_kobj_path.patch new file mode 100644 index 00000000000..0d4b9e10412 --- /dev/null +++ b/queue-4.19/kobject-fix-slab-out-of-bounds-in-fill_kobj_path.patch @@ -0,0 +1,143 @@ +From 3bb2a01caa813d3a1845d378bbe4169ef280d394 Mon Sep 17 00:00:00 2001 +From: Wang Hai +Date: Tue, 20 Dec 2022 09:21:43 +0800 +Subject: kobject: Fix slab-out-of-bounds in fill_kobj_path() + +From: Wang Hai + +commit 3bb2a01caa813d3a1845d378bbe4169ef280d394 upstream. + +In kobject_get_path(), if kobj->name is changed between calls +get_kobj_path_length() and fill_kobj_path() and the length becomes +longer, then fill_kobj_path() will have an out-of-bounds bug. + +The actual current problem occurs when the ixgbe probe. + +In ixgbe_mii_bus_init(), if the length of netdev->dev.kobj.name +length becomes longer, out-of-bounds will occur. + +cpu0 cpu1 +ixgbe_probe + register_netdev(netdev) + netdev_register_kobject + device_add + kobject_uevent // Sending ADD events + systemd-udevd // rename netdev + dev_change_name + device_rename + kobject_rename + ixgbe_mii_bus_init | + mdiobus_register | + __mdiobus_register | + device_register | + device_add | + kobject_uevent | + kobject_get_path | + len = get_kobj_path_length // old name | + path = kzalloc(len, gfp_mask); | + kobj->name = name; + /* name length becomes + * longer + */ + fill_kobj_path /* kobj path length is + * longer than path, + * resulting in out of + * bounds when filling path + */ + +This is the kasan report: + +================================================================== +BUG: KASAN: slab-out-of-bounds in fill_kobj_path+0x50/0xc0 +Write of size 7 at addr ff1100090573d1fd by task kworker/28:1/673 + + Workqueue: events work_for_cpu_fn + Call Trace: + + dump_stack_lvl+0x34/0x48 + print_address_description.constprop.0+0x86/0x1e7 + print_report+0x36/0x4f + kasan_report+0xad/0x130 + kasan_check_range+0x35/0x1c0 + memcpy+0x39/0x60 + fill_kobj_path+0x50/0xc0 + kobject_get_path+0x5a/0xc0 + kobject_uevent_env+0x140/0x460 + device_add+0x5c7/0x910 + __mdiobus_register+0x14e/0x490 + ixgbe_probe.cold+0x441/0x574 [ixgbe] + local_pci_probe+0x78/0xc0 + work_for_cpu_fn+0x26/0x40 + process_one_work+0x3b6/0x6a0 + worker_thread+0x368/0x520 + kthread+0x165/0x1a0 + ret_from_fork+0x1f/0x30 + +This reproducer triggers that bug: + +while: +do + rmmod ixgbe + sleep 0.5 + modprobe ixgbe + sleep 0.5 + +When calling fill_kobj_path() to fill path, if the name length of +kobj becomes longer, return failure and retry. This fixes the problem. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Wang Hai +Link: https://lore.kernel.org/r/20221220012143.52141-1-wanghai38@huawei.com +Signed-off-by: Oleksandr Tymoshenko +Signed-off-by: Greg Kroah-Hartman +--- + lib/kobject.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/lib/kobject.c ++++ b/lib/kobject.c +@@ -135,7 +135,7 @@ static int get_kobj_path_length(struct k + return length; + } + +-static void fill_kobj_path(struct kobject *kobj, char *path, int length) ++static int fill_kobj_path(struct kobject *kobj, char *path, int length) + { + struct kobject *parent; + +@@ -144,12 +144,16 @@ static void fill_kobj_path(struct kobjec + int cur = strlen(kobject_name(parent)); + /* back up enough to print this name with '/' */ + length -= cur; ++ if (length <= 0) ++ return -EINVAL; + memcpy(path + length, kobject_name(parent), cur); + *(path + --length) = '/'; + } + + pr_debug("kobject: '%s' (%p): %s: path = '%s'\n", kobject_name(kobj), + kobj, __func__, path); ++ ++ return 0; + } + + /** +@@ -165,13 +169,17 @@ char *kobject_get_path(struct kobject *k + char *path; + int len; + ++retry: + len = get_kobj_path_length(kobj); + if (len == 0) + return NULL; + path = kzalloc(len, gfp_mask); + if (!path) + return NULL; +- fill_kobj_path(kobj, path, len); ++ if (fill_kobj_path(kobj, path, len)) { ++ kfree(path); ++ goto retry; ++ } + + return path; + } diff --git a/queue-4.19/nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch b/queue-4.19/nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch new file mode 100644 index 00000000000..c0ffc1a490e --- /dev/null +++ b/queue-4.19/nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch @@ -0,0 +1,51 @@ +From 1aee9158bc978f91701c5992e395efbc6da2de3c Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Sat, 14 Oct 2023 21:34:40 -0400 +Subject: nfsd: lock_rename() needs both directories to live on the same fs + +From: Al Viro + +commit 1aee9158bc978f91701c5992e395efbc6da2de3c upstream. + +... checking that after lock_rename() is too late. Incidentally, +NFSv2 had no nfserr_xdev... + +Fixes: aa387d6ce153 "nfsd: fix EXDEV checking in rename" +Cc: stable@vger.kernel.org # v3.9+ +Reviewed-by: Jeff Layton +Acked-by: Chuck Lever +Tested-by: Jeff Layton +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/vfs.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/fs/nfsd/vfs.c ++++ b/fs/nfsd/vfs.c +@@ -1691,6 +1691,12 @@ nfsd_rename(struct svc_rqst *rqstp, stru + if (!flen || isdotent(fname, flen) || !tlen || isdotent(tname, tlen)) + goto out; + ++ err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev; ++ if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) ++ goto out; ++ if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) ++ goto out; ++ + host_err = fh_want_write(ffhp); + if (host_err) { + err = nfserrno(host_err); +@@ -1724,12 +1730,6 @@ nfsd_rename(struct svc_rqst *rqstp, stru + if (ndentry == trap) + goto out_dput_new; + +- host_err = -EXDEV; +- if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) +- goto out_dput_new; +- if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) +- goto out_dput_new; +- + host_err = vfs_rename(fdir, odentry, tdir, ndentry, NULL, 0); + if (!host_err) { + host_err = commit_metadata(tfhp); diff --git a/queue-4.19/series b/queue-4.19/series index ed7a169c9d2..1eaa1d0ee44 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -20,11 +20,12 @@ nvmem-imx-correct-nregs-for-i.mx6sll.patch nvmem-imx-correct-nregs-for-i.mx6ul.patch perf-core-fix-potential-null-deref.patch iio-exynos-adc-request-second-interupt-only-when-tou.patch -acpica-add-support-for-madt-online-enabled-bit.patch -x86-acpi-don-t-add-cpus-that-are-not-online-capable.patch -x86-acpi-boot-use-fadt-version-to-check-support-for-.patch -x86-i8259-skip-probing-when-acpi-madt-advertises-pca.patch +x86-i8259-skip-probing-when-acpi-madt-advertises-pcat-compatibility.patch nfs-don-t-call-generic_error_remove_page-while-holdi.patch arm-8933-1-replace-sun-solaris-style-flag-on-section.patch drm-dp_mst-fix-null-deref-in-get_mst_branch_device_by_guid_helper.patch arm64-fix-a-concurrency-issue-in-emulation_proc_handler.patch +kobject-fix-slab-out-of-bounds-in-fill_kobj_path.patch +smbdirect-missing-rc-checks-while-waiting-for-rdma-events.patch +f2fs-fix-to-do-sanity-check-on-inode-type-during-garbage-collection.patch +nfsd-lock_rename-needs-both-directories-to-live-on-the-same-fs.patch diff --git a/queue-4.19/smbdirect-missing-rc-checks-while-waiting-for-rdma-events.patch b/queue-4.19/smbdirect-missing-rc-checks-while-waiting-for-rdma-events.patch new file mode 100644 index 00000000000..fb67b951fbf --- /dev/null +++ b/queue-4.19/smbdirect-missing-rc-checks-while-waiting-for-rdma-events.patch @@ -0,0 +1,54 @@ +From 0555b221528e9cb11f5766dcdee19c809187e42e Mon Sep 17 00:00:00 2001 +From: Steve French +Date: Mon, 21 Jun 2021 16:25:20 -0500 +Subject: smbdirect: missing rc checks while waiting for rdma events + +From: Steve French + +commit 0555b221528e9cb11f5766dcdee19c809187e42e upstream. + +There were two places where we weren't checking for error +(e.g. ERESTARTSYS) while waiting for rdma resolution. + +Addresses-Coverity: 1462165 ("Unchecked return value") +Reviewed-by: Tom Talpey +Reviewed-by: Long Li +Signed-off-by: Steve French +Signed-off-by: Anastasia Belova +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/smbdirect.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/fs/cifs/smbdirect.c ++++ b/fs/cifs/smbdirect.c +@@ -706,8 +706,13 @@ static struct rdma_cm_id *smbd_create_id + log_rdma_event(ERR, "rdma_resolve_addr() failed %i\n", rc); + goto out; + } +- wait_for_completion_interruptible_timeout( ++ rc = wait_for_completion_interruptible_timeout( + &info->ri_done, msecs_to_jiffies(RDMA_RESOLVE_TIMEOUT)); ++ /* e.g. if interrupted returns -ERESTARTSYS */ ++ if (rc < 0) { ++ log_rdma_event(ERR, "rdma_resolve_addr timeout rc: %i\n", rc); ++ goto out; ++ } + rc = info->ri_rc; + if (rc) { + log_rdma_event(ERR, "rdma_resolve_addr() completed %i\n", rc); +@@ -720,8 +725,13 @@ static struct rdma_cm_id *smbd_create_id + log_rdma_event(ERR, "rdma_resolve_route() failed %i\n", rc); + goto out; + } +- wait_for_completion_interruptible_timeout( ++ rc = wait_for_completion_interruptible_timeout( + &info->ri_done, msecs_to_jiffies(RDMA_RESOLVE_TIMEOUT)); ++ /* e.g. if interrupted returns -ERESTARTSYS */ ++ if (rc < 0) { ++ log_rdma_event(ERR, "rdma_resolve_addr timeout rc: %i\n", rc); ++ goto out; ++ } + rc = info->ri_rc; + if (rc) { + log_rdma_event(ERR, "rdma_resolve_route() completed %i\n", rc); diff --git a/queue-4.19/x86-acpi-boot-use-fadt-version-to-check-support-for-.patch b/queue-4.19/x86-acpi-boot-use-fadt-version-to-check-support-for-.patch deleted file mode 100644 index 9aa13b7e3c9..00000000000 --- a/queue-4.19/x86-acpi-boot-use-fadt-version-to-check-support-for-.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 730e9f58786ffb9b887d4318f15c98af47d1acaf Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 29 Mar 2023 12:45:35 -0500 -Subject: x86/ACPI/boot: Use FADT version to check support for online capable - -From: Mario Limonciello - -[ Upstream commit a74fabfbd1b7013045afc8cc541e6cab3360ccb5 ] - -ACPI 6.3 introduced the online capable bit, and also introduced MADT -version 5. - -Latter was used to distinguish whether the offset storing online capable -could be used. However ACPI 6.2b has MADT version "45" which is for -an errata version of the ACPI 6.2 spec. This means that the Linux code -for detecting availability of MADT will mistakenly flag ACPI 6.2b as -supporting online capable which is inaccurate as it's an ACPI 6.3 feature. - -Instead use the FADT major and minor revision fields to distinguish this. - - [ bp: Massage. ] - -Fixes: aa06e20f1be6 ("x86/ACPI: Don't add CPUs that are not online capable") -Reported-by: Eric DeVolder -Reported-by: Borislav Petkov -Signed-off-by: Mario Limonciello -Signed-off-by: Borislav Petkov (AMD) -Cc: -Link: https://lore.kernel.org/r/943d2445-84df-d939-f578-5d8240d342cc@unsolicited.net -Stable-dep-of: 128b0c9781c9 ("x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility") -Signed-off-by: Sasha Levin ---- - arch/x86/kernel/acpi/boot.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c -index 5869ade7932c7..fca71bef57644 100644 ---- a/arch/x86/kernel/acpi/boot.c -+++ b/arch/x86/kernel/acpi/boot.c -@@ -156,7 +156,11 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) - printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", - madt->address); - } -- if (madt->header.revision >= 5) -+ -+ /* ACPI 6.3 and newer support the online capable bit. */ -+ if (acpi_gbl_FADT.header.revision > 6 || -+ (acpi_gbl_FADT.header.revision == 6 && -+ acpi_gbl_FADT.minor_revision >= 3)) - acpi_support_online_capable = true; - - default_acpi_madt_oem_check(madt->header.oem_id, --- -2.42.0 - diff --git a/queue-4.19/x86-acpi-don-t-add-cpus-that-are-not-online-capable.patch b/queue-4.19/x86-acpi-don-t-add-cpus-that-are-not-online-capable.patch deleted file mode 100644 index 400143c0378..00000000000 --- a/queue-4.19/x86-acpi-don-t-add-cpus-that-are-not-online-capable.patch +++ /dev/null @@ -1,64 +0,0 @@ -From a6abbca496083ad8d6e6c728634097e019a29709 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 8 Sep 2021 16:41:46 -0500 -Subject: x86/ACPI: Don't add CPUs that are not online capable - -From: Mario Limonciello - -[ Upstream commit aa06e20f1be628186f0c2dcec09ea0009eb69778 ] - -A number of systems are showing "hotplug capable" CPUs when they -are not really hotpluggable. This is because the MADT has extra -CPU entries to support different CPUs that may be inserted into -the socket with different numbers of cores. - -Starting with ACPI 6.3 the spec has an Online Capable bit in the -MADT used to determine whether or not a CPU is hotplug capable -when the enabled bit is not set. - -Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html?#local-apic-flags -Signed-off-by: Mario Limonciello -Signed-off-by: Rafael J. Wysocki -Stable-dep-of: 128b0c9781c9 ("x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility") -Signed-off-by: Sasha Levin ---- - arch/x86/kernel/acpi/boot.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c -index 8b1aa1206d980..5869ade7932c7 100644 ---- a/arch/x86/kernel/acpi/boot.c -+++ b/arch/x86/kernel/acpi/boot.c -@@ -78,6 +78,7 @@ int acpi_fix_pin2_polarity __initdata; - - #ifdef CONFIG_X86_LOCAL_APIC - static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; -+static bool acpi_support_online_capable; - #endif - - #ifdef CONFIG_X86_IO_APIC -@@ -155,6 +156,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) - printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", - madt->address); - } -+ if (madt->header.revision >= 5) -+ acpi_support_online_capable = true; - - default_acpi_madt_oem_check(madt->header.oem_id, - madt->header.oem_table_id); -@@ -256,6 +259,12 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end) - if (processor->id == 0xff) - return 0; - -+ /* don't register processors that can not be onlined */ -+ if (acpi_support_online_capable && -+ !(processor->lapic_flags & ACPI_MADT_ENABLED) && -+ !(processor->lapic_flags & ACPI_MADT_ONLINE_CAPABLE)) -+ return 0; -+ - /* - * We need to register disabled CPU as well to permit - * counting disabled CPUs. This allows us to size --- -2.42.0 - diff --git a/queue-4.19/x86-i8259-skip-probing-when-acpi-madt-advertises-pca.patch b/queue-4.19/x86-i8259-skip-probing-when-acpi-madt-advertises-pcat-compatibility.patch similarity index 82% rename from queue-4.19/x86-i8259-skip-probing-when-acpi-madt-advertises-pca.patch rename to queue-4.19/x86-i8259-skip-probing-when-acpi-madt-advertises-pcat-compatibility.patch index d2988a10474..7cfc378e5b3 100644 --- a/queue-4.19/x86-i8259-skip-probing-when-acpi-madt-advertises-pca.patch +++ b/queue-4.19/x86-i8259-skip-probing-when-acpi-madt-advertises-pcat-compatibility.patch @@ -1,11 +1,11 @@ -From 4a21b5b6a53603da0bdb198838ce2659f3568e0b Mon Sep 17 00:00:00 2001 -From: Sasha Levin +From 128b0c9781c9f2651bea163cb85e52a6c7be0f9e Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner Date: Wed, 25 Oct 2023 23:04:15 +0200 Subject: x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility From: Thomas Gleixner -[ Upstream commit 128b0c9781c9f2651bea163cb85e52a6c7be0f9e ] +commit 128b0c9781c9f2651bea163cb85e52a6c7be0f9e upstream. David and a few others reported that on certain newer systems some legacy interrupts fail to work correctly. @@ -49,15 +49,13 @@ Reviewed-by: Mario Limonciello Cc: stable@vger.kernel.org Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218003 Link: https://lore.kernel.org/r/875y2u5s8g.ffs@tglx -Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman --- - arch/x86/include/asm/i8259.h | 2 ++ - arch/x86/kernel/acpi/boot.c | 3 +++ - arch/x86/kernel/i8259.c | 38 ++++++++++++++++++++++++++++-------- + arch/x86/include/asm/i8259.h | 2 ++ + arch/x86/kernel/acpi/boot.c | 3 +++ + arch/x86/kernel/i8259.c | 38 ++++++++++++++++++++++++++++++-------- 3 files changed, 35 insertions(+), 8 deletions(-) -diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h -index 89789e8c80f66..e16574c16e933 100644 --- a/arch/x86/include/asm/i8259.h +++ b/arch/x86/include/asm/i8259.h @@ -67,6 +67,8 @@ struct legacy_pic { @@ -69,22 +67,18 @@ index 89789e8c80f66..e16574c16e933 100644 extern struct legacy_pic *legacy_pic; extern struct legacy_pic null_legacy_pic; -diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c -index fca71bef57644..6302f425998de 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c -@@ -157,6 +157,9 @@ static int __init acpi_parse_madt(struct acpi_table_header *table) +@@ -156,6 +156,9 @@ static int __init acpi_parse_madt(struct madt->address); } + if (madt->flags & ACPI_MADT_PCAT_COMPAT) + legacy_pic_pcat_compat(); + - /* ACPI 6.3 and newer support the online capable bit. */ - if (acpi_gbl_FADT.header.revision > 6 || - (acpi_gbl_FADT.header.revision == 6 && -diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c -index 8821d0ab0a08c..82753622f4890 100644 + default_acpi_madt_oem_check(madt->header.oem_id, + madt->header.oem_table_id); + --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c @@ -32,6 +32,7 @@ @@ -146,6 +140,3 @@ index 8821d0ab0a08c..82753622f4890 100644 +{ + pcat_compat = true; +} --- -2.42.0 -