Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp636876pxb; Fri, 15 Oct 2021 12:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhNjomFlTIjh9dtn2//CNakf3np48yhHvYlnc1P00Gd6sK/trZwNzO+YCq5KO+8UJwZd5R X-Received: by 2002:a05:6a00:992:b0:44d:8981:37f6 with SMTP id u18-20020a056a00099200b0044d898137f6mr9016747pfg.76.1634327039341; Fri, 15 Oct 2021 12:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634327039; cv=none; d=google.com; s=arc-20160816; b=AhYd3Uw/fGNmIZu/5te3+xLgVLsrvNqcTExxnAahjZ0ADGwKTdN4bXXX4VV7NLFJ4S vG6sK1ImB6PEW5w+7W/2AbOUxWfvNCZBhmtSUHOwrtJZkF8qJ9M72qCKx+WRF8ht/sYC nSCcxrUGKlp1tgeJJsJE2OVPqqYQMQ+7FRsiaX6dvBCQ4TuNe1F4nbacZl171V/Fx7Xd jXnRYPJjrFpberS/PFEGCYkMCybNAo33bWGZ+l+qRZop8SSC2IKE6JFmAiOGPc2U7xCJ zRcTc6sDlegFcEJ/3N34OilR50+95U7rEbS6Sw9gNN/OkJQs9D0XnKIEIJ5Qn+xNFElA gfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hrJLWbbRUBeuLFY0ZXFJKj4jdgvFkQtSue6zAwY5Snw=; b=MzZUhN8DnPCJ9eDlfesK6wag7iS1gcFLvNT0Dz1ssWPIC9SCsDyNQLadqKPJnjQiD5 YuBO1rZFEb7oVfmjuuUqdU/JGiBOrU1tAlQYMQtptzO16EEWzKsgySlHeu1unUfdorAN dY6XNg643gRzAIrrfvT46CYrx8vs8hYJ86wrIQFHAyisb4UbF2j7vZd0uKle2cxAIDce 0jQK+UVKIrd5GbYt0MZ86sV/kKzS32rWy/33YrGzu2FUCi6VYa8FL8ISFFwDvVhPHwfz Z+El9xVnyeM/NoTLtuHbBn3ZKGhW+jsSVZRvShCGi7qguo46KtUn6rS1xMEigR19drAf 60Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RaStao5G; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si8680704pgv.55.2021.10.15.12.43.46; Fri, 15 Oct 2021 12:43:59 -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=@alien8.de header.s=dkim header.b=RaStao5G; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238252AbhJOLGh (ORCPT + 99 others); Fri, 15 Oct 2021 07:06:37 -0400 Received: from mail.skyhub.de ([5.9.137.197]:49304 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238241AbhJOLGg (ORCPT ); Fri, 15 Oct 2021 07:06:36 -0400 Received: from zn.tnic (p200300ec2f0cfb0087c6997658fca07e.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:fb00:87c6:9976:58fc:a07e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 0F48F1EC0593; Fri, 15 Oct 2021 13:04:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1634295869; h=from:from: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=hrJLWbbRUBeuLFY0ZXFJKj4jdgvFkQtSue6zAwY5Snw=; b=RaStao5GeW3kwT/Xxp0Y189C1BvagALuCuIkuRrrCfAXXVhKC38p7l9w4ANF44do1QCgBn 0iO6uYq0Z1qDUYCSSrlho4XqanV6iBFoTD36/ye+3hX7U17NZa4BW5jcbLJ6snFWj32ylf S3bmJEGNctQ0Pqyvaf2JucLZW0FhzRI= Date: Fri, 15 Oct 2021 13:04:28 +0200 From: Borislav Petkov To: Ville =?utf-8?B?U3lyasOkbMOk?= , Ser Olmy Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [regression] commit d298b03506d3 ("x86/fpu: Restore the masking out of reserved MXCSR bits") Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ok, here it is. Ser, I'd appreciate you running it too, to make sure your box is still ok. Thx. --- From: Borislav Petkov Date: Fri, 15 Oct 2021 12:46:25 +0200 Subject: [PATCH] x86/fpu: Mask out the invalid MXCSR bits properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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älä Fixes: d298b03506d3 ("x86/fpu: Restore the masking out of reserved MXCSR bits") Signed-off-by: Borislav Petkov 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 fa17a27390ab..831b25c5e705 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 __user *buf_fx, return -EINVAL; } else { /* Mask invalid bits out for historical reasons (broken hardware). */ - fpu->state.fxsave.mxcsr &= ~mxcsr_feature_mask; + fpu->state.fxsave.mxcsr &= mxcsr_feature_mask; } /* Enforce XFEATURE_MASK_FPSSE when XSAVE is enabled */ -- 2.29.2 -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette