From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFB00C433EC for ; Mon, 20 Jul 2020 16:26:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82F1E206E9 for ; Mon, 20 Jul 2020 16:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595262363; bh=EQyByGgZwCdppCC+pTcTPiScPbQ5HgHvHHw/SGK4auQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mXjupetkJFbbtT/czR++ji0OBkXnGX/PWW4M2BSUPvcWvDpHNkng0UIjOHf++dmhe GgLY7B7KZ+DTxx56EKHocxMsS+6YWEVDm6VZOcvn1TAUWaeKRLvfYf6KBhvkLxiFjQ n6/VdQaHhneq/5WywT3SQEZUHUIUvlzjyxWMNbj0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387729AbgGTQ0C (ORCPT ); Mon, 20 Jul 2020 12:26:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:34042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732439AbgGTQAx (ORCPT ); Mon, 20 Jul 2020 12:00:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9E6A22D00; Mon, 20 Jul 2020 16:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595260852; bh=EQyByGgZwCdppCC+pTcTPiScPbQ5HgHvHHw/SGK4auQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tCouV1MP7vi5Ig5UDlurfA87XcYXC2DbyTKBtqb5d8mGGJ8cNr+4XmXJn/+VBUThU h/D21L9ZzJyVdItSJsPvNJLonBuP9XkfEdqzuZbt+2Y2x6JqdZ85Op2x5Rm/6S+rVS lVG2dwgfg1MW7bzhIoy9BV8D4kvOvSW9VkoqdY0E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kevin Buettner , Al Viro , Dave Airlie , Linus Torvalds Subject: [PATCH 5.4 119/215] copy_xstate_to_kernel: Fix typo which caused GDB regression Date: Mon, 20 Jul 2020 17:36:41 +0200 Message-Id: <20200720152825.858152774@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200720152820.122442056@linuxfoundation.org> References: <20200720152820.122442056@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kevin Buettner commit 5714ee50bb4375bd586858ad800b1d9772847452 upstream. This fixes a regression encountered while running the gdb.base/corefile.exp test in GDB's test suite. In my testing, the typo prevented the sw_reserved field of struct fxregs_state from being output to the kernel XSAVES area. Thus the correct mask corresponding to XCR0 was not present in the core file for GDB to interrogate, resulting in the following behavior: [kev@f32-1 gdb]$ ./gdb -q testsuite/outputs/gdb.base/corefile/corefile testsuite/outputs/gdb.base/corefile/corefile.core Reading symbols from testsuite/outputs/gdb.base/corefile/corefile... [New LWP 232880] warning: Unexpected size of section `.reg-xstate/232880' in core file. With the typo fixed, the test works again as expected. Signed-off-by: Kevin Buettner Fixes: 9e4636545933 ("copy_xstate_to_kernel(): don't leave parts of destination uninitialized") Cc: Al Viro Cc: Dave Airlie Signed-off-by: Linus Torvalds 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 @@ -1017,7 +1017,7 @@ int copy_xstate_to_kernel(void *kbuf, st copy_part(offsetof(struct fxregs_state, st_space), 128, &xsave->i387.st_space, &kbuf, &offset_start, &count); if (header.xfeatures & XFEATURE_MASK_SSE) - copy_part(xstate_offsets[XFEATURE_MASK_SSE], 256, + copy_part(xstate_offsets[XFEATURE_SSE], 256, &xsave->i387.xmm_space, &kbuf, &offset_start, &count); /* * Fill xsave->i387.sw_reserved value for ptrace frame: