lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <170306663962.398.1278759370786877493.tip-bot2@tip-bot2>
Date: Wed, 20 Dec 2023 10:03:59 -0000
From: "tip-bot2 for Vegard Nossum" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Vegard Nossum <vegard.nossum@...cle.com>, Ingo Molnar <mingo@...nel.org>,
 Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: x86/asm] x86/asm: Add DB flag to 32-bit percpu GDT entry

The following commit has been merged into the x86/asm branch of tip:

Commit-ID:     bc90aefa99f74452d549d503a3f1cbf3adc9c6bb
Gitweb:        https://git.kernel.org/tip/bc90aefa99f74452d549d503a3f1cbf3adc9c6bb
Author:        Vegard Nossum <vegard.nossum@...cle.com>
AuthorDate:    Tue, 19 Dec 2023 16:12:00 +01:00
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Wed, 20 Dec 2023 10:57:51 +01:00

x86/asm: Add DB flag to 32-bit percpu GDT entry

The D/B size flag for the 32-bit percpu GDT entry was not set.

The Intel manual (vol 3, section 3.4.5) only specifies the meaning of
this flag for three cases:

 1) code segments used for %cs -- doesn't apply here

 2) stack segments used for %ss -- doesn't apply

 3) expand-down data segments -- but we don't have the expand-down flag
    set, so it also doesn't apply here

The flag likely doesn't do anything here, although the manual does also
say: "This flag should always be set to 1 for 32-bit code and data
segments [...]" so we should probably do it anyway.

Signed-off-by: Vegard Nossum <vegard.nossum@...cle.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Acked-by: Linus Torvalds <torvalds@...ux-foundation.org>
Link: https://lore.kernel.org/r/20231219151200.2878271-6-vegard.nossum@oracle.com
---
 arch/x86/kernel/setup_percpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index f2583de..b30d6e1 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -106,7 +106,7 @@ void __init pcpu_populate_pte(unsigned long addr)
 static inline void setup_percpu_segment(int cpu)
 {
 #ifdef CONFIG_X86_32
-	struct desc_struct d = GDT_ENTRY_INIT(DESC_DATA32 & ~_DESC_DB,
+	struct desc_struct d = GDT_ENTRY_INIT(DESC_DATA32,
 					      per_cpu_offset(cpu), 0xFFFFF);
 
 	write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_PERCPU, &d, DESCTYPE_S);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ