Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp41619lfv; Tue, 12 Apr 2022 16:28:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW1mJ3+P2CiS0Dj8826HSYzvkK7s9ZE+igyFnbNcfgilxk++4JwkzWnGs9OwE9q9hns07C X-Received: by 2002:a05:6a00:8d6:b0:505:b41a:13a0 with SMTP id s22-20020a056a0008d600b00505b41a13a0mr15062195pfu.67.1649806082344; Tue, 12 Apr 2022 16:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649806082; cv=none; d=google.com; s=arc-20160816; b=bJo45gfT0i+8rCxqBRRaXKKC2xvwKW1u1nzE/P8BX/uYFfRkSt6Mpi7mJ/YurSCJrV vB0irRbgcWxjdmXLIgbNJ1J+T5GGKjviZVXjvjOmSqJkKxd4H1mRe+7w2zrqEt8zHrsb tqdSdzPQ/rg47IBxiYWfR1v0/fuKQg4ZR2zcnqQSXpuSk1lCuFbD/NGZvrD7KHBRti8v hQWtAcuFqxVMGnHbPMInPB0s3zc7oxkXNHyb3b+ujQVeZ82S0QfMvpW1V1QHMyXwepC8 NfLANYLu0LwvF6C5zbhWtBUmlLo2RP7cGwjLcacNtfXqVw4iBlGSoKtiWZiBz01ETI1a mtnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2U3afq3nkSJME4YKbYrihzt+18we9KUA5NOLq7ZMOMg=; b=f2bANVf19mA+11I/dZgwVYmgtHZ7eLqDJSs6aJZhhVTC8yGn0jQC+6WcyOrPG4QzBT KUrBAEXItZ/YgI9ueB/kcGyJrJfeqpwEEWODQomhWcqMV9veAl+6xqKIN4wyVkguWAPc 0rnv1YTzRDu906V0DCk7IdDTWp9W/Hwj0cmcF4xdkNxPOqOWTronkTukMmcZvDx80dSk s5R1TFVycutdeh6YE3IK7ce/macsQhtPw7lstC391mtkUa4+gIWNOfffWd9GVSbu67vI kfu24cpkO9I+U72PUqtYc5hRmBzu7bpeB7IrWiVuwM3m6QwkC7OWMJRzJTHOUILUDMP5 MJZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aHtEH8me; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c7-20020a656747000000b0038225bd6f70si4197685pgu.398.2022.04.12.16.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:28:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aHtEH8me; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F28C106609; Tue, 12 Apr 2022 14:20:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355198AbiDLIHa (ORCPT + 99 others); Tue, 12 Apr 2022 04:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354736AbiDLH0k (ORCPT ); Tue, 12 Apr 2022 03:26:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C51246B20; Tue, 12 Apr 2022 00:06:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AC4FDB81B4F; Tue, 12 Apr 2022 07:06:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F41C7C385A1; Tue, 12 Apr 2022 07:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649747189; bh=blGm2AT+cTPGsrJEUISAdrsP2vZTBXy06uJ2DzObYds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aHtEH8mewo7ghXeJhZS8POGc26y3Okkoh8ULsCmUqQ/MioWjgX654oWbxUA+9vHEk /oX9QJ797CXD/ISwYuFzMAigizYSZqwaA/TCv2Q+RtXArXfJQOJthAvp3ZeUq5ZoyS bQYks7aPXTvk708FF044yyFnUoVwf1jl/Mb9NCFk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Zhong , "Chang S. Bae" , Thomas Gleixner , Paolo Bonzini Subject: [PATCH 5.16 274/285] x86/fpu/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation Date: Tue, 12 Apr 2022 08:32:11 +0200 Message-Id: <20220412062951.564252341@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062943.670770901@linuxfoundation.org> References: <20220412062943.670770901@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Yang Zhong commit 063452fd94d153d4eb38ad58f210f3d37a09cca4 upstream. 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 [chang: Backport for 5.16] Signed-off-by: Chang S. Bae Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/fpu/xstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -1626,7 +1626,7 @@ static int __xstate_request_perm(u64 per return ret; /* Pairs with the READ_ONCE() in xstate_get_group_perm() */ - WRITE_ONCE(fpu->perm.__state_perm, requested); + WRITE_ONCE(fpu->perm.__state_perm, mask); /* Protected by sighand lock */ fpu->perm.__state_size = ksize; fpu->perm.__user_state_size = usize;