From: Greg Kroah-Hartman Date: Wed, 15 Sep 2021 14:24:10 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.14.5~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5eecb4da5c66f468e67f4c37995d5b4e507a3cd;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: arm-9105-1-atags_to_fdt-don-t-warn-about-stack-size.patch libata-add-ata_horkage_no_ncq_trim-for-samsung-860-and-870-ssds.patch pci-restrict-asmedia-asm1062-sata-max-payload-size-supported.patch pci-return-0-data-on-pciconfig_read-cap_sys_admin-failure.patch --- diff --git a/queue-4.4/arm-9105-1-atags_to_fdt-don-t-warn-about-stack-size.patch b/queue-4.4/arm-9105-1-atags_to_fdt-don-t-warn-about-stack-size.patch new file mode 100644 index 00000000000..4e105d6b718 --- /dev/null +++ b/queue-4.4/arm-9105-1-atags_to_fdt-don-t-warn-about-stack-size.patch @@ -0,0 +1,46 @@ +From b30d0289de72c62516df03fdad8d53f552c69839 Mon Sep 17 00:00:00 2001 +From: David Heidelberg +Date: Mon, 9 Aug 2021 19:07:30 +0100 +Subject: ARM: 9105/1: atags_to_fdt: don't warn about stack size + +From: David Heidelberg + +commit b30d0289de72c62516df03fdad8d53f552c69839 upstream. + +The merge_fdt_bootargs() function by definition consumes more than 1024 +bytes of stack because it has a 1024 byte command line on the stack, +meaning that we always get a warning when building this file: + +arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs': +arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] + +However, as this is the decompressor and we know that it has a very shallow +call chain, and we do not actually risk overflowing the kernel stack +at runtime here. + +This just shuts up the warning by disabling the warning flag for this +file. + +Tested on Nexus 7 2012 builds. + +Acked-by: Nicolas Pitre +Signed-off-by: David Heidelberg +Signed-off-by: Arnd Bergmann +Cc: +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/compressed/Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/boot/compressed/Makefile ++++ b/arch/arm/boot/compressed/Makefile +@@ -86,6 +86,8 @@ $(addprefix $(obj)/,$(libfdt_objs) atags + $(addprefix $(obj)/,$(libfdt_hdrs)) + + ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) ++CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN} ++CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280 + OBJS += $(libfdt_objs) atags_to_fdt.o + endif + diff --git a/queue-4.4/libata-add-ata_horkage_no_ncq_trim-for-samsung-860-and-870-ssds.patch b/queue-4.4/libata-add-ata_horkage_no_ncq_trim-for-samsung-860-and-870-ssds.patch new file mode 100644 index 00000000000..5c844afe0c6 --- /dev/null +++ b/queue-4.4/libata-add-ata_horkage_no_ncq_trim-for-samsung-860-and-870-ssds.patch @@ -0,0 +1,50 @@ +From 8a6430ab9c9c87cb64c512e505e8690bbaee190b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 23 Aug 2021 11:52:20 +0200 +Subject: libata: add ATA_HORKAGE_NO_NCQ_TRIM for Samsung 860 and 870 SSDs + +From: Hans de Goede + +commit 8a6430ab9c9c87cb64c512e505e8690bbaee190b upstream. + +Commit ca6bfcb2f6d9 ("libata: Enable queued TRIM for Samsung SSD 860") +limited the existing ATA_HORKAGE_NO_NCQ_TRIM quirk from "Samsung SSD 8*", +covering all Samsung 800 series SSDs, to only apply to "Samsung SSD 840*" +and "Samsung SSD 850*" series based on information from Samsung. + +But there is a large number of users which is still reporting issues +with the Samsung 860 and 870 SSDs combined with Intel, ASmedia or +Marvell SATA controllers and all reporters also report these problems +going away when disabling queued trims. + +Note that with AMD SATA controllers users are reporting even worse +issues and only completely disabling NCQ helps there, this will be +addressed in a separate patch. + +Fixes: ca6bfcb2f6d9 ("libata: Enable queued TRIM for Samsung SSD 860") +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=203475 +Cc: stable@vger.kernel.org +Cc: Kate Hsuan +Signed-off-by: Hans de Goede +Reviewed-by: Damien Le Moal +Reviewed-by: Martin K. Petersen +Link: https://lore.kernel.org/r/20210823095220.30157-1-hdegoede@redhat.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ata/libata-core.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -4269,6 +4269,10 @@ static const struct ata_blacklist_entry + ATA_HORKAGE_ZERO_AFTER_TRIM, }, + { "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | + ATA_HORKAGE_ZERO_AFTER_TRIM, }, ++ { "Samsung SSD 860*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | ++ ATA_HORKAGE_ZERO_AFTER_TRIM, }, ++ { "Samsung SSD 870*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | ++ ATA_HORKAGE_ZERO_AFTER_TRIM, }, + { "FCCT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | + ATA_HORKAGE_ZERO_AFTER_TRIM, }, + diff --git a/queue-4.4/pci-restrict-asmedia-asm1062-sata-max-payload-size-supported.patch b/queue-4.4/pci-restrict-asmedia-asm1062-sata-max-payload-size-supported.patch new file mode 100644 index 00000000000..9f6aae87893 --- /dev/null +++ b/queue-4.4/pci-restrict-asmedia-asm1062-sata-max-payload-size-supported.patch @@ -0,0 +1,52 @@ +From b12d93e9958e028856cbcb061b6e64728ca07755 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Thu, 24 Jun 2021 19:14:18 +0200 +Subject: PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Marek Behún + +commit b12d93e9958e028856cbcb061b6e64728ca07755 upstream. + +The ASMedia ASM1062 SATA controller advertises Max_Payload_Size_Supported +of 512, but in fact it cannot handle incoming TLPs with payload size of +512. + +We discovered this issue on PCIe controllers capable of MPS = 512 (Aardvark +and DesignWare), where the issue presents itself as an External Abort. +Bjorn Helgaas says: + + Probably ASM1062 reports a Malformed TLP error when it receives a data + payload of 512 bytes, and Aardvark, DesignWare, etc convert this to an + arm64 External Abort. [1] + +To avoid this problem, limit the ASM1062 Max Payload Size Supported to 256 +bytes, so we set the Max Payload Size of devices that may send TLPs to the +ASM1062 to 256 or less. + +[1] https://lore.kernel.org/linux-pci/20210601170907.GA1949035@bjorn-Precision-5520/ +BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=212695 +Link: https://lore.kernel.org/r/20210624171418.27194-2-kabel@kernel.org +Reported-by: Rötti +Signed-off-by: Marek Behún +Signed-off-by: Bjorn Helgaas +Reviewed-by: Krzysztof Wilczyński +Reviewed-by: Pali Rohár +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/quirks.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -2921,6 +2921,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SO + PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1, fixup_mpss_256); + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLARFLARE, + PCI_DEVICE_ID_SOLARFLARE_SFC4000B, fixup_mpss_256); ++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ASMEDIA, 0x0612, fixup_mpss_256); + + /* Intel 5000 and 5100 Memory controllers have an errata with read completion + * coalescing (which is enabled by default on some BIOSes) and MPS of 256B. diff --git a/queue-4.4/pci-return-0-data-on-pciconfig_read-cap_sys_admin-failure.patch b/queue-4.4/pci-return-0-data-on-pciconfig_read-cap_sys_admin-failure.patch new file mode 100644 index 00000000000..8ff699d2bc5 --- /dev/null +++ b/queue-4.4/pci-return-0-data-on-pciconfig_read-cap_sys_admin-failure.patch @@ -0,0 +1,56 @@ +From a8bd29bd49c4156ea0ec5a97812333e2aeef44e7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= +Date: Thu, 29 Jul 2021 23:37:54 +0000 +Subject: PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Krzysztof Wilczyński + +commit a8bd29bd49c4156ea0ec5a97812333e2aeef44e7 upstream. + +The pciconfig_read() syscall reads PCI configuration space using +hardware-dependent config accessors. + +If the read fails on PCI, most accessors don't return an error; they +pretend the read was successful and got ~0 data from the device, so the +syscall returns success with ~0 data in the buffer. + +When the accessor does return an error, pciconfig_read() normally fills the +user's buffer with ~0 and returns an error in errno. But after +e4585da22ad0 ("pci syscall.c: Switch to refcounting API"), we don't fill +the buffer with ~0 for the EPERM "user lacks CAP_SYS_ADMIN" error. + +Userspace may rely on the ~0 data to detect errors, but after e4585da22ad0, +that would not detect CAP_SYS_ADMIN errors. + +Restore the original behaviour of filling the buffer with ~0 when the +CAP_SYS_ADMIN check fails. + +[bhelgaas: commit log, fold in Nathan's fix +https://lore.kernel.org/r/20210803200836.500658-1-nathan@kernel.org] +Fixes: e4585da22ad0 ("pci syscall.c: Switch to refcounting API") +Link: https://lore.kernel.org/r/20210729233755.1509616-1-kw@linux.com +Signed-off-by: Krzysztof Wilczyński +Signed-off-by: Bjorn Helgaas +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/syscall.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/pci/syscall.c ++++ b/drivers/pci/syscall.c +@@ -23,8 +23,10 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned + long err; + int cfg_ret; + ++ err = -EPERM; ++ dev = NULL; + if (!capable(CAP_SYS_ADMIN)) +- return -EPERM; ++ goto error; + + err = -ENODEV; + dev = pci_get_bus_and_slot(bus, dfn); diff --git a/queue-4.4/series b/queue-4.4/series index 246adc568d8..a0fd07dbc9b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -77,3 +77,7 @@ power-supply-max17042-handle-fails-of-reading-status-register.patch vmci-fix-null-pointer-dereference-when-unmapping-queue-pair.patch media-uvc-don-t-do-dma-on-stack.patch media-rc-loopback-return-number-of-emitters-rather-than-error.patch +libata-add-ata_horkage_no_ncq_trim-for-samsung-860-and-870-ssds.patch +arm-9105-1-atags_to_fdt-don-t-warn-about-stack-size.patch +pci-restrict-asmedia-asm1062-sata-max-payload-size-supported.patch +pci-return-0-data-on-pciconfig_read-cap_sys_admin-failure.patch