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 2C998C54FB9 for ; Wed, 15 Nov 2023 20:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234920AbjKOUxu (ORCPT ); Wed, 15 Nov 2023 15:53:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234923AbjKOUxt (ORCPT ); Wed, 15 Nov 2023 15:53:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FB7F8F for ; Wed, 15 Nov 2023 12:53:47 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B9FAC4E778; Wed, 15 Nov 2023 20:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700081626; bh=RusFOEymhXmN0tJ0DKQeVEdrp2Z+61kxtJmR+ONsP5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cXPxUiJnlX5+mEQ1s0kYNn4DkVncJWK7b8ant0UUx7lYG5SspuvxPv72BoOonx6Oj vImwUuk5SuTEVBKcY5ndwdvi2m0YUhLlsZszGKfrxVNR36bbWf87TUHyoTHy9r9nZU JcTL0DKthbWqaILqKemJTvqVpDJcdM+BYXp5nf+I= 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 5.10 006/191] x86/boot: Fix incorrect startup_gdt_descr.size Date: Wed, 15 Nov 2023 15:44:41 -0500 Message-ID: <20231115204644.901170414@linuxfoundation.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231115204644.490636297@linuxfoundation.org> References: <20231115204644.490636297@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 5.10-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 efe13ab366f47..8596b4dca9455 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