Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1351865pxb; Thu, 24 Mar 2022 18:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP379yjqUR+OAZp3CvTqNrnE4rct2a2wDJFQbEPWrQzs77c9906tHH1KKzbX/2iJ56O6bz X-Received: by 2002:a63:24d:0:b0:380:ada1:cd4b with SMTP id 74-20020a63024d000000b00380ada1cd4bmr6133976pgc.127.1648171762131; Thu, 24 Mar 2022 18:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648171762; cv=none; d=google.com; s=arc-20160816; b=oLiXqgNmMb33j3ZNNFfyDp4t9ZibZugWwjlSy0wU553sAcdeLjbm6hK4zZ9Sw/vfh0 793NJZlKlvGO/Fq4BR4eRGdZpvZAjk2KtEHzYI0zJ7pGdPkLKQ5lsZ137G25sEtB+Gq4 BQ854IiWvPnGfOHJ1/wss3F2E0OQhmMb4uWlVpUc92bI5jR9Kc5ZphICka2X5wFvKins cDRVJpmu+p171ustdbRRv3N8yjZ5Vj2YBit9gHQwGMdm8ChzfyTwb3AfbXQbaPXI7uai Qjr2/0UEv7vdk+/TQ79awlp9+sNUpdWjftzhLqQ+giohMvkODIKgfRXiWg2NjkXdF57Q j6Lg== 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=PT1maxWW5NNo9X1wLuCr6EW7XZ21JWxdjhPR3iYLg6M=; b=KZB3CWh1U7clNr+gH0s8PYpadE/Ui7T6eHW35oYQFuz0eeNplu1Ri6DRue9w9MnITa WR/7uExqHyX9t8634ShpyI0kmx1Gl1xN1zHadsgXBZQdlaCAibjqWUJ8dJv8Df5lZ9vE cpbfpql1d4hT4jCydnsmXz9YB/lIXsPqT9vZoOLtQbjcLsdb/c66Wz8fLoHiJx+HhoJA ZeS/0d5ltPuHQ4aba7o8r81IQzLbxek9/TO0gfW7R4RbT+jX+ig8K+7gafdz7/hu0GuZ /P5TXJKspRwbKPeP7hYmnsqe99pwxVfRFyU0CKVF6zFjWxUC2MPVUmFP1fjWNyjfjD9t Upeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=m97itk0c; dkim=neutral (no key) header.i=@linutronix.de header.b=hoJySjsg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm14-20020a17090b3ece00b001bd14e01f2asi4489154pjb.24.2022.03.24.18.28.59; Thu, 24 Mar 2022 18:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=m97itk0c; dkim=neutral (no key) header.i=@linutronix.de header.b=hoJySjsg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345528AbiCWXdU (ORCPT + 99 others); Wed, 23 Mar 2022 19:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345405AbiCWXdQ (ORCPT ); Wed, 23 Mar 2022 19:33:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A8FE90CD5; Wed, 23 Mar 2022 16:31:44 -0700 (PDT) Date: Wed, 23 Mar 2022 23:31:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1648078302; 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=PT1maxWW5NNo9X1wLuCr6EW7XZ21JWxdjhPR3iYLg6M=; b=m97itk0cwVz2OFyFZgoHOLAehrle3xst6TRwYXT8Fzqs7/NftfylqFRIPfTc+YgMZyObr9 crPuhA1+A+w/zWr2L4yAmx38LcNY3Iztb3bvaGuK2Hl4AovskX11ess2hlolHOc2hTyGIQ kEpJLFLvE4/X7fBAe29tFoTXJUBenf9wg6r1SFgqYkLh7iM+kE4JXWHFOStAuGEXZ44R9i qBdjBWditqJ6rwuINo1Ff3tyEE2g81xZDNGVTR7qhz4V4GvQfO79hzfQ4CG/uGhAwyOuf3 nluERvh64gBEtId1k/6hdr0hI+0j3KP3hEtV7r7bP0CVYAL3R8e/m1n8QdHjow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1648078302; 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=PT1maxWW5NNo9X1wLuCr6EW7XZ21JWxdjhPR3iYLg6M=; b=hoJySjsgFmvMf/dUsT0yWpvZELjWwCo2Pf/1Ylxr0fNeFVWgZ8FAnDJalRYPeHbclDhjFG JTPc4jcuQ1XXuRCw== From: "tip-bot2 for Yang Zhong" 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/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation Cc: Yang Zhong , "Chang S. Bae" , Thomas Gleixner , Paolo Bonzini , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220129173647.27981-2-chang.seok.bae@intel.com> References: <20220129173647.27981-2-chang.seok.bae@intel.com> MIME-Version: 1.0 Message-ID: <164807830122.389.15178914175068421091.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: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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: 063452fd94d153d4eb38ad58f210f3d37a09cca4 Gitweb: https://git.kernel.org/tip/063452fd94d153d4eb38ad58f210f3d37a09cca4 Author: Yang Zhong AuthorDate: Sat, 29 Jan 2022 09:36:46 -08:00 Committer: Thomas Gleixner CommitterDate: Wed, 23 Mar 2022 21:28:34 +01:00 x86/fpu/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation ARCH_REQ_XCOMP_PERM is supposed to add the requested feature to the permission bitmap of thread_group_leader()->fpu. But the code overwrites the bitmap with the requested feature bit only rather than adding it. Fix the code to add the requested feature bit to the master bitmask. Fixes: db8268df0983 ("x86/arch_prctl: Add controls for dynamic XSTATE components") Signed-off-by: Yang Zhong Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Cc: Paolo Bonzini Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220129173647.27981-2-chang.seok.bae@intel.com --- arch/x86/kernel/fpu/xstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 7c7824a..dc6d5e9 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -1639,7 +1639,7 @@ static int __xstate_request_perm(u64 permitted, u64 requested, bool guest) perm = guest ? &fpu->guest_perm : &fpu->perm; /* Pairs with the READ_ONCE() in xstate_get_group_perm() */ - WRITE_ONCE(perm->__state_perm, requested); + WRITE_ONCE(perm->__state_perm, mask); /* Protected by sighand lock */ perm->__state_size = ksize; perm->__user_state_size = usize;