Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1157611
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.0 007/148] x86/fpu: Disable XSAVES* support for now |
| Date | 2015-06-03 15:00 +0200 |
| Message-ID | <pxgr3-1sR-67@gated-at.bofh.it> (permalink) |
| References | <pxfOh-E4-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ingo Molnar <mingo@kernel.org>
commit e88221c50cadade0eb4f7f149f4967d760212695 upstream.
The kernel's handling of 'compacted' xsave state layout is buggy:
http://marc.info/?l=linux-kernel&m=142967852317199
I don't have such a system, and the description there is vague, but
from extrapolation I guess that there were two kinds of bugs
observed:
- boot crashes, due to size calculations being wrong and the dynamic
allocation allocating a too small xstate area. (This is now fixed
in the new FPU code - but still present in stable kernels.)
- FPU state corruption and ABI breakage: if signal handlers try to
change the FPU state in standard format, which then the kernel
tries to restore in the compacted format.
These breakages are scary, but they only occur on a small number of
systems that have XSAVES* CPU support. Yet we have had XSAVES support
in the upstream kernel for a large number of stable kernel releases,
and the fixes are involved and unproven.
So do the safe resolution first: disable XSAVES* support and only
use the standard xstate format. This makes the code work and is
easy to backport.
On top of this we can work on enabling (and testing!) proper
compacted format support, without backporting pressure, on top of the
new, cleaned up FPU code.
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/i387.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -169,6 +169,21 @@ static void init_thread_xstate(void)
xstate_size = sizeof(struct i387_fxsave_struct);
else
xstate_size = sizeof(struct i387_fsave_struct);
+
+ /*
+ * Quirk: we don't yet handle the XSAVES* instructions
+ * correctly, as we don't correctly convert between
+ * standard and compacted format when interfacing
+ * with user-space - so disable it for now.
+ *
+ * The difference is small: with recent CPUs the
+ * compacted format is only marginally smaller than
+ * the standard FPU state format.
+ *
+ * ( This is easy to backport while we are fixing
+ * XSAVES* support. )
+ */
+ setup_clear_cpu_cap(X86_FEATURE_XSAVES);
}
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 4.0 000/148] 4.0.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 021/148] mfd: da9052: Fix broken regulator probe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 061/148] ASoC: wm8994: correct BCLK DIV 348 to 384 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 026/148] hwmon: (ntc_thermistor) Ensure iio channel is of type IIO_VOLTAGE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 048/148] module: Call module notifier on failure after complete_formation() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 053/148] ALSA: hda/realtek - ALC292 dock fix for Thinkpad L450 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 046/148] lib: Fix strnlen_user() to not touch memory after specified maximum Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 065/148] staging: vt6655: device_free_tx_buf use only ieee80211_tx_status_irqsafe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 008/148] KVM: MMU: fix CR4.SMEP=1, CR0.WP=0 with shadow pages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 033/148] iio: adc: cc10001: Fix incorrect use of power-up/power-down register Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 034/148] iio: adc: cc10001: Add delay before setting START bit Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 040/148] hwmon: (tmp401) Do not auto-detect chip on I2C address 0x37 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 049/148] ALSA: usb-audio: Add quirk for MS LifeCam Studio Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 009/148] KVM: MMU: fix smap permission check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 023/148] Revert "libceph: clear r_req_lru_item in __unregister_linger_request()" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 050/148] ALSA: hda - Add Conexant codecs CX20721, CX20722, CX20723 and CX20724 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 045/148] brcmfmac: avoid null pointer access when brcmf_msgbuf_get_pktid() fails Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 035/148] iio: adc: cc10001: Fix regulator_get_voltage() return value check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 060/148] ASoC: wm8960: fix "RINPUT3" audio route error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 022/148] libceph: request a new osdmap if lingering request maps to no osd Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 025/148] xen/events: dont bind non-percpu VIRQs with percpu chip Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 004/148] iommu/arm-smmu: Fix sign-extension of upstream bus addresses at stage 1 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 057/148] ASoC: mc13783: Fix wrong mask value used in mc13xxx_reg_rmw() calls Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 024/148] Btrfs: fix racy system chunk allocation when setting block group ro Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 051/148] ALSA: hda - Add headphone quirk for Lifebook E752 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 007/148] x86/fpu: Disable XSAVES* support for now Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 064/148] staging: vt6656: use ieee80211_tx_info to select packet type. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 056/148] ALSA: hda - Fix noise on AMD radeon 290x controller Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 003/148] iommu/amd: Fix bug in put_pasid_state_wait Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 032/148] iio: adc: cc10001: Fix the channel number mapping Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:00 +0200 [PATCH 4.0 015/148] omfs: fix sign confusion for bitmap loop counter Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 [PATCH 4.0 018/148] lguest: fix out-by-one error in address checking. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 [PATCH 4.0 002/148] fs_pin: Allow for the possibility that m_list or s_list go unused. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 [PATCH 4.0 016/148] xfs: xfs_attr_inactive leaves inconsistent attr fork state behind Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 [PATCH 4.0 014/148] fs, omfs: add NULL terminator in the end up the token list Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 [PATCH 4.0 017/148] xfs: xfs_iozero can return positive errno Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 [PATCH 4.0 019/148] ovl: dont remove non-empty opaque directory Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-06-03 15:10 +0200 Re: [PATCH 4.0 000/148] 4.0.5-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2015-06-03 19:00 +0200
csiph-web