The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: d298b03506d3e161f7492c440babb0bfae35e650
Gitweb: https://git.kernel.org/tip/d298b03506d3e161f7492c440babb0bfae35e650
Author: Borislav Petkov <bp(a)suse.de>
AuthorDate: Wed, 06 Oct 2021 18:33:52 +02:00
Committer: Borislav Petkov <bp(a)suse.de>
CommitterDate: Fri, 08 Oct 2021 11:12:17 +02:00
x86/fpu: Restore the masking out of reserved MXCSR bits
Ser Olmy reported a boot failure:
init[1] bad frame in sigreturn frame:(ptrval) ip:b7c9fbe6 sp:bf933310 orax:ffffffff \
in libc-2.33.so[b7bed000+156000]
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
CPU: 0 PID: 1 Comm: init Tainted: G W 5.14.9 #1
Hardware name: Hewlett-Packard HP PC/HP Board, BIOS JD.00.06 12/06/2001
Call Trace:
dump_stack_lvl
dump_stack
panic
do_exit.cold
do_group_exit
get_signal
arch_do_signal_or_restart
? force_sig_info_to_task
? force_sig
exit_to_user_mode_prepare
syscall_exit_to_user_mode
do_int80_syscall_32
entry_INT80_32
on an old 32-bit Intel CPU:
vendor_id : GenuineIntel
cpu family : 6
model : 6
model name : Celeron (Mendocino)
stepping : 5
microcode : 0x3
Ser bisected the problem to the commit in Fixes.
tglx suggested reverting the rejection of invalid MXCSR values which
this commit introduced and replacing it with what the old code did -
simply masking them out to zero.
Further debugging confirmed his suggestion:
fpu->state.fxsave.mxcsr: 0xb7be13b4, mxcsr_feature_mask: 0xffbf
WARNING: CPU: 0 PID: 1 at arch/x86/kernel/fpu/signal.c:384 __fpu_restore_sig+0x51f/0x540
so restore the original behavior only for 32-bit kernels where you have
ancient machines with buggy hardware. For 32-bit programs on 64-bit
kernels, user space which supplies wrong MXCSR values is considered
malicious so fail the sigframe restoration there.
Fixes: 6f9866a166cd ("x86/fpu/signal: Let xrstor handle the features to init")
Reported-by: Ser Olmy <ser.olmy(a)protonmail.com>
Signed-off-by: Borislav Petkov <bp(a)suse.de>
Tested-by: Ser Olmy <ser.olmy(a)protonmail.com>
Cc: <stable(a)vger.kernel.org>
Link: https://lkml.kernel.org/r/YVtA67jImg3KlBTw@zn.tnic
---
arch/x86/kernel/fpu/signal.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c
index 445c57c..fa17a27 100644
--- a/arch/x86/kernel/fpu/signal.c
+++ b/arch/x86/kernel/fpu/signal.c
@@ -379,9 +379,14 @@ static int __fpu_restore_sig(void __user *buf, void __user *buf_fx,
sizeof(fpu->state.fxsave)))
return -EFAULT;
- /* Reject invalid MXCSR values. */
- if (fpu->state.fxsave.mxcsr & ~mxcsr_feature_mask)
- return -EINVAL;
+ if (IS_ENABLED(CONFIG_X86_64)) {
+ /* Reject invalid MXCSR values. */
+ if (fpu->state.fxsave.mxcsr & ~mxcsr_feature_mask)
+ return -EINVAL;
+ } else {
+ /* Mask invalid bits out for historical reasons (broken hardware). */
+ fpu->state.fxsave.mxcsr &= ~mxcsr_feature_mask;
+ }
/* Enforce XFEATURE_MASK_FPSSE when XSAVE is enabled */
if (use_xsave())
From: Nikolay Martynov <mar.kolya(a)gmail.com>
Tested on SD5200T TB3 dock which has Fresco Logic FL1100 USB 3.0 Host
Controller.
Before this patch streaming video from USB cam made mouse and keyboard
connected to the same USB bus unusable. Also video was jerky.
With this patch streaming video doesn't have any effect on other
periferals and video is smooth.
Signed-off-by: Nikolay Martynov <mar.kolya(a)gmail.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman(a)linux.intel.com>
---
drivers/usb/host/xhci-pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 633413d78380..2484a9d38ce2 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -30,6 +30,7 @@
#define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
#define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009
+#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100
#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400
#define PCI_VENDOR_ID_ETRON 0x1b6f
@@ -113,6 +114,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
/* Look for vendor-specific quirks */
if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
(pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
+ pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 ||
pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
pdev->revision == 0x0) {
--
2.25.1
Third Time's the Charm, now with the proper stable@ address. ;)
On 2021-09-26 at 21:10, Krzysztof Olędzki wrote:
> (fixed Greg's e-mail)
>
> Hi,
>
> On 2021-09-20 at 19:32, Krzysztof Olędzki wrote:
>> Hi Greg, Sasha,
>>
>> On 2021-09-14 at 19:58, Krzysztof Olędzki wrote:
>>> Hi,
>>>
>>> Would it be possible to add both:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
>>> into the -stable trees?
>>>
>>> Right now only the second patch (8a6430ab9c9c87cb64c512e505e8690bbaee190b) is tagged with "Cc: stable(a)vger.kernel.org", but has not been include into 5.4.146-rc1 and is also not in stable-queue.git.
>>>
>>> If it helps, I have tested both of them on 5.4.145 and they apply cleanly.
>>
>>
>> Looks like 8a6430ab9c9c87cb64c512e505e8690bbaee190b - "libata: add ATA_HORKAGE_NO_NCQ_TRIM for Samsung 860 and 870 SSDs" has been included into the most recent wave of -stable kernels.
>>
>> Can we include 7a8526a5cd51cf5f070310c6c37dd7293334ac49 - "libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD." in the next releases, pretty please?
>
> With the new set of -stable kernel just released, is this a good moment to re-ask for 7a8526a5cd51cf5f070310c6c37dd7293334ac49?
>
> Thanks,
> Krzysztof
>
I'd like to request commit 02d029a41dc986e2d5a77ecca45803857b346829
("perf/x86: Reset destroy callback on event init failure") be merged
to the 5.10 stable branch.
This fixes a bug which was exposed by commit f11dd0d80555
("perf/x86/amd/ibs: Extend PERF_PMU_CAP_NO_EXCLUDE to IBS Op") merged
into 5.10.65 (as commit bafece6cd1f9), and partially broke perf on AMD
StoneyRidge systems.
I've tested this patch locally on 5.10.70 on an AMD StoneyRidge
(A4-9120C) system.