Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2615792pxb; Sun, 17 Oct 2021 20:36:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwylxu7PGRbXpMerU+cOKgNMn9zKjCw5kiVtxCg3xne5noKPVc9om3U45nsEkv18AepeLzW X-Received: by 2002:a63:6ac8:: with SMTP id f191mr16084659pgc.386.1634528169025; Sun, 17 Oct 2021 20:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634528169; cv=none; d=google.com; s=arc-20160816; b=We06SUof0WzPZ7cOQ/NddMyghbI5+xLdfD28nMbOpZVxF7x/8IHlRQYSLrPfAKnxKY 1n5nRlr4VbBBv741UCGHgw6jgvWOEkj1SZ1xrrEiCFSGRPcNGj1/VZJRUffwiSRj0TrO Vv1Hcnl/IjDF7Lom4Bb9GA7O8zKyGSC7KeH0CGWR7a4KVg+/OTjVq8ySbl6UJEHNd9U6 HzgYi++wKYl2i0ZOlhQRymnPYxyLcnZeYI0x+CJHGPjrnFi67zgvqlh1xcLyfs8K5dff n2CkqtHdiTmAlf2F7t4JB3QY/fa1rsvFuZV5givC81ZcP1wE5cZ8/VZwgLFnyx4XeEr+ VaSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=PAajLHzkK+bz/d1vGmfCT4vXEyfeEfkH7hLzQJ3hlBk=; b=K3R2/WM3yZ8qnMuyMCeAD7PukGuM3qq1tAfg0H74JyTldVykYMb95nBkWT57+jJLSV 6/rhQzwLxZdJJuaykiwyWskKeEgp+57MuzuW0cAXVsimV09EGuXVj8cOwLS35dOTHvCa woVhzaxBJujVxMYLjAZwukjCLgNaMwh3a3i0QLl6aM72D+iPe8N3tRVm6xlceVXG4Fb5 zPiDF7FK1ca6nBc1BeiGFCIJoKgN/8AbDxtMwWRfM2vF6Dn9XZfp0//qRa6aaQwWB2Ev If/O9Gwo+ShIu6MyyTzJYZXa4XZYL0qoFYIqhOV4eW8WlUBPcM2Th45J91CA5izjfHxZ QFKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LFEYoZzg; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si11343972pgn.357.2021.10.17.20.35.57; Sun, 17 Oct 2021 20:36:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LFEYoZzg; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240411AbhJPMYo (ORCPT + 98 others); Sat, 16 Oct 2021 08:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235147AbhJPMYn (ORCPT ); Sat, 16 Oct 2021 08:24:43 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02782C061570; Sat, 16 Oct 2021 05:22:34 -0700 (PDT) Date: Sat, 16 Oct 2021 12:22:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634386952; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PAajLHzkK+bz/d1vGmfCT4vXEyfeEfkH7hLzQJ3hlBk=; b=LFEYoZzg8rMl1VAiqNczs4I0l5tJm3esM8io65zJX40/OWp5CyCQBKWSPh/sRtOHaidVEP 9KwDJIXq4bKGCnrc7EUvA5jEVRWyrbYPOcfKULnwLRJY2EkqoNAdmQXsCfWhPsnpKrPXPB xJfMRqNMLTs56W3hvJooo9udF/k4OT4YzWQ/XPvEqlFbE+w0awI/Z7bMKwOk1p64vlBWqo RZv1nVSJ4XcVXRDuCAJdd4JTUS6Dh8hq4ZcW+66svmDRRxA2+yBu+g6XK0b1jE2qKmkxoI n7Tuwq/bjKbVmE4R2IIz3kQRDeH0voT60niL3NENq6dlNeXV68A2qG8ZwSKMNQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634386952; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PAajLHzkK+bz/d1vGmfCT4vXEyfeEfkH7hLzQJ3hlBk=; b=KnqC0+7gnsp+r+o310imQ+wY/sOt0J4cVQMmLWefoki0BfCxh4zEk010IB4OipDZF2SVlA V+OXpQedI9R0SXDQ== From: "tip-bot2 for Borislav Petkov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/fpu: Mask out the invalid MXCSR bits properly Cc: Borislav Petkov , ville.syrjala@linux.intel.com, Ser Olmy , , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <163438695111.25758.6599528756955601567.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: b2381acd3fd9bacd2c63f53b2c610c89959b31cc Gitweb: https://git.kernel.org/tip/b2381acd3fd9bacd2c63f53b2c610c89959= b31cc Author: Borislav Petkov AuthorDate: Fri, 15 Oct 2021 12:46:25 +02:00 Committer: Borislav Petkov CommitterDate: Sat, 16 Oct 2021 12:37:50 +02:00 x86/fpu: Mask out the invalid MXCSR bits properly This is a fix for the fix (yeah, /facepalm). The correct mask to use is not the negation of the MXCSR_MASK but the actual mask which contains the supported bits in the MXCSR register. Reported and debugged by Ville Syrj=C3=A4l=C3=A4 Fixes: d298b03506d3 ("x86/fpu: Restore the masking out of reserved MXCSR bits= ") Signed-off-by: Borislav Petkov Tested-by: Ville Syrj=C3=A4l=C3=A4 Tested-by: Ser Olmy Cc: Link: https://lore.kernel.org/r/YWgYIYXLriayyezv@intel.com --- arch/x86/kernel/fpu/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c index fa17a27..831b25c 100644 --- a/arch/x86/kernel/fpu/signal.c +++ b/arch/x86/kernel/fpu/signal.c @@ -385,7 +385,7 @@ static int __fpu_restore_sig(void __user *buf, void __use= r *buf_fx, return -EINVAL; } else { /* Mask invalid bits out for historical reasons (broken hardware). */ - fpu->state.fxsave.mxcsr &=3D ~mxcsr_feature_mask; + fpu->state.fxsave.mxcsr &=3D mxcsr_feature_mask; } =20 /* Enforce XFEATURE_MASK_FPSSE when XSAVE is enabled */