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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49163C54FB9 for ; Wed, 15 Nov 2023 19:32:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234190AbjKOTdA (ORCPT ); Wed, 15 Nov 2023 14:33:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234184AbjKOTc7 (ORCPT ); Wed, 15 Nov 2023 14:32:59 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89FBC19D for ; Wed, 15 Nov 2023 11:32:56 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08AB4C433C7; Wed, 15 Nov 2023 19:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700076776; bh=vG/YDix8XTlMzTk3h+oNZuHo/CUfcepZGO0W8TeD9pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KbCiFaQtxwXjZzBMmrY26H97DSp0FwvGBy5FGLcgz0/L0i9StuaUdHIlm61Asno4H EAu6PliFOy4ijVtLDlcyGzNxS+9p0LPzizxlLYifataDGeYyqL9CxAB5zJwcMCjLY7 L2xOoJAtKxLRDTdjzizdDLLmNJ3AS8yqS4C/H+oQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuntao Wang , Ingo Molnar , "H. Peter Anvin" , Sasha Levin Subject: [PATCH 6.6 023/603] x86/boot: Fix incorrect startup_gdt_descr.size Date: Wed, 15 Nov 2023 14:09:28 -0500 Message-ID: <20231115191614.776577609@linuxfoundation.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231115191613.097702445@linuxfoundation.org> References: <20231115191613.097702445@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yuntao Wang [ Upstream commit 001470fed5959d01faecbd57fcf2f60294da0de1 ] Since the size value is added to the base address to yield the last valid byte address of the GDT, the current size value of startup_gdt_descr is incorrect (too large by one), fix it. [ mingo: This probably never mattered, because startup_gdt[] is only used in a very controlled fashion - but make it consistent nevertheless. ] Fixes: 866b556efa12 ("x86/head/64: Install startup GDT") Signed-off-by: Yuntao Wang Signed-off-by: Ingo Molnar Cc: "H. Peter Anvin" Link: https://lore.kernel.org/r/20230807084547.217390-1-ytcoode@gmail.com Signed-off-by: Sasha Levin --- arch/x86/kernel/head64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 49f7629b17f73..bbc21798df10e 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -80,7 +80,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = { * while the kernel still uses a direct mapping. */ static struct desc_ptr startup_gdt_descr = { - .size = sizeof(startup_gdt), + .size = sizeof(startup_gdt)-1, .address = 0, }; -- 2.42.0