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 49A6CC433EB for ; Mon, 20 Jul 2020 16:20:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BB4A20656 for ; Mon, 20 Jul 2020 16:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595262015; bh=81C3VjzhW5ZmEN+yM0OFhoBByB8E8wfop5z0GRFfSX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ydEx1tiRpXUc7Lh87kX+egIw3MRuEge4i5XasFsZsAPK53CwPD1JinuX8QFncQU0D 6lm8TrZZSEmDLXTBrngCFfCyFJRak1191qEc7JhBmk1Triz0bFBhtrEepma4L1NLJo 6ocpGaoIPiJDSi2kRiJcYp5kjVRIwmfUo0aWw968= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388605AbgGTQUN (ORCPT ); Mon, 20 Jul 2020 12:20:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:49298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387690AbgGTQKk (ORCPT ); Mon, 20 Jul 2020 12:10:40 -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 00E652064B; Mon, 20 Jul 2020 16:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595261439; bh=81C3VjzhW5ZmEN+yM0OFhoBByB8E8wfop5z0GRFfSX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nS8mHhfMpZXhu2TUp7vSrsHhue3+lFwiMfh6jFtBgojWRxy9oy5zG2SkRXIwtEPGF f8ge98wkS5pSmPWVMb2oMElgLJEuy4F4LB5jLPM2Dq0jQP0NKF87IwGQo6DopRxrfL Tb5NJTiIJyn7Wglc7lzL/oan18TEASWzcBZCbIKI= 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.7 117/244] copy_xstate_to_kernel: Fix typo which caused GDB regression Date: Mon, 20 Jul 2020 17:36:28 +0200 Message-Id: <20200720152831.404472124@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200720152825.863040590@linuxfoundation.org> References: <20200720152825.863040590@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 @@ -1022,7 +1022,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: