Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3953647rdb; Thu, 14 Sep 2023 07:41:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5RkKQhVatw4bEN/iIBdQObhSV+IUpXdKF3BWVARomXmLhvD/IgKbQNHMUa7dywbM0iIpl X-Received: by 2002:a05:6359:5e9e:b0:142:fba8:dcfe with SMTP id px30-20020a0563595e9e00b00142fba8dcfemr757863rwb.16.1694702496822; Thu, 14 Sep 2023 07:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694702496; cv=none; d=google.com; s=arc-20160816; b=NNxI0+KXcpcxwvQYFFxpH7CIDWXsHLoHoz+mBHjn5ksIUqzhItGuyfV9atMdr7YVCC pi+WFw9lhNTvkjb1P38S/BcH/FvmKBfTf1bur3mOCL7jorEV+I0lBQFWJ9ci1rbBynOy XeeEf3zEXigJvItddRMY9/wRvZ/OfsKi6u2zzXnwah18n0gOEfk/pkS9kPZf9qbRO/ho 4B6sDVBhcVvoT2bpsWAQmXB6qt4dQv1g50oWFyj7b2Q6tBBFpt5yz0r6+6bwUbhMEdAu NAnbnZWvaizz/r7UAjpIe6HizXCn2GxWK6vFrRjYvx1AvG5z7O5l3gt1UVPtnXnv1jG6 /sIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=U+9lxCGIAXIBCuloyKhhileQmPydRd0vGCXF79l3kpc=; fh=n7fF7QC0RNRn6F3FQu0v+CrFD4hMTQOXYoV2ln8SMUQ=; b=YtO3tq2Gy1MQEyeoz+nsHUeka5uYTVyJlXruWzaq3WC5DfaRXMaeh7QpoqRdpP/dqY VKV+T949l1npLvbyuVGefm0H8w1ywchVhfNUxzp23Ma/En3jiyEVBcT4nmJdMhkJOXQJ FX6SVdhIx7ElO79aDBeVovv+C+++uTHvQCvPizfptqNGLUD2JNeysNa69j5WPevc8WpL 4VLyNYf7f+fbmkqTa4Hn/zjFFikoWsnYefRAmhf596RsfJvV/oHXrD5/GP2XQGvAo573 wU/yaBcOic6vF5j2S8L4h4Uo+Dw5AnS05ziIDZuciDF+R+kKa+bz7822I6V/PGOROIzJ sI1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="mg/48v65"; dkim=neutral (no key) header.i=@linutronix.de header.b="ITm/l6S5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id o6-20020a6548c6000000b005780a1effa4si578643pgs.375.2023.09.14.07.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 07:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="mg/48v65"; dkim=neutral (no key) header.i=@linutronix.de header.b="ITm/l6S5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6D73B81FD29D; Thu, 14 Sep 2023 04:27:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237828AbjINL1T (ORCPT + 99 others); Thu, 14 Sep 2023 07:27:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235307AbjINL1K (ORCPT ); Thu, 14 Sep 2023 07:27:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 305341A5; Thu, 14 Sep 2023 04:27:06 -0700 (PDT) Date: Thu, 14 Sep 2023 11:27:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694690824; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U+9lxCGIAXIBCuloyKhhileQmPydRd0vGCXF79l3kpc=; b=mg/48v65EyGLB5PQpDwmbJGvV4rhym5wswrU+tNtOxHYcn7tkh/+YQByBXlWc0BtzQ+eoK pF665Wge09i7s/wW3vsDh10kfkBJaUJ8HEFF0tgZJnfwxF7CgVyeZAtyPchZz8ktc5t8Xb i12ug582MyApSMnP4MxMXv5u8ghk3aTJpc1UlucXJSwVS1XgI2TiIquVAetiX1LqSS6OYL 0muHLZPlW6iGUhSq+SWLGjSpQ5SDUyqcoJ/sFFo+lcqRQpmdh6avxoXgVQDqvJC9qos+r0 eKeSrxR5Q76g1X8PAzEnfyLz+SXwgix3UDgh6de2asIn93G9NEtO2z4JkjwakQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694690824; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U+9lxCGIAXIBCuloyKhhileQmPydRd0vGCXF79l3kpc=; b=ITm/l6S5+pV3Os5lhA3rDVLwyLR1aZMnOK8BncwwxkjW+MnB7FQptYi4wILiXjwI4PBV0W 5cyHvhVm4QRXESAg== From: "tip-bot2 for Nikolay Borisov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/entry] x86/entry: Rename ignore_sysret() Cc: Nikolay Borisov , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230623111409.3047467-3-nik.borisov@suse.com> References: <20230623111409.3047467-3-nik.borisov@suse.com> MIME-Version: 1.0 Message-ID: <169469082431.27769.8435967971182289551.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 04:27:36 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email The following commit has been merged into the x86/entry branch of tip: Commit-ID: f71e1d2ff8e6a183bd4004bc97c453ba527b7dc6 Gitweb: https://git.kernel.org/tip/f71e1d2ff8e6a183bd4004bc97c453ba527b7dc6 Author: Nikolay Borisov AuthorDate: Fri, 23 Jun 2023 14:14:05 +03:00 Committer: Thomas Gleixner CommitterDate: Thu, 14 Sep 2023 13:19:53 +02:00 x86/entry: Rename ignore_sysret() The SYSCALL instruction cannot really be disabled in compatibility mode. The best that can be done is to configure the CSTAR msr to point to a minimal handler. Currently this handler has a rather misleading name - ignore_sysret() as it's not really doing anything with sysret. Give it a more descriptive name. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-3-nik.borisov@suse.com --- arch/x86/entry/entry_64.S | 4 ++-- arch/x86/include/asm/processor.h | 2 +- arch/x86/kernel/cpu/common.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 43606de..3be71ac 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -1516,12 +1516,12 @@ SYM_CODE_END(asm_exc_nmi) * This handles SYSCALL from 32-bit code. There is no way to program * MSRs to fully disable 32-bit SYSCALL. */ -SYM_CODE_START(ignore_sysret) +SYM_CODE_START(entry_SYSCALL32_ignore) UNWIND_HINT_END_OF_STACK ENDBR mov $-ENOSYS, %eax sysretl -SYM_CODE_END(ignore_sysret) +SYM_CODE_END(entry_SYSCALL32_ignore) #endif .pushsection .text, "ax" diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 0086920..93cd28d 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -399,7 +399,7 @@ static inline unsigned long cpu_kernelmode_gs_base(int cpu) return (unsigned long)per_cpu(fixed_percpu_data.gs_base, cpu); } -extern asmlinkage void ignore_sysret(void); +extern asmlinkage void entry_SYSCALL32_ignore(void); /* Save actual FS/GS selectors and bases to current->thread */ void current_save_fsgs(void); diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 382d4e6..b3f8cba 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -2087,7 +2087,7 @@ void syscall_init(void) (unsigned long)(cpu_entry_stack(smp_processor_id()) + 1)); wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat); #else - wrmsrl_cstar((unsigned long)ignore_sysret); + wrmsrl_cstar((unsigned long)entry_SYSCALL32_ignore); wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)GDT_ENTRY_INVALID_SEG); wrmsrl_safe(MSR_IA32_SYSENTER_ESP, 0ULL); wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);