Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp33841ybg; Mon, 8 Jun 2020 15:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+JDK1BvBL5ZScPecEYjqljQnbk5WrYfgiF4Qr/DLFxqkhY2HXDTU2YpBfvL+KkzwF06WV X-Received: by 2002:a17:906:c952:: with SMTP id fw18mr22334548ejb.505.1591655966356; Mon, 08 Jun 2020 15:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591655966; cv=none; d=google.com; s=arc-20160816; b=Fz0tNAQXd1PEO95n0nk6FfaV5epVYYZ+GKvDnqMTIxVV5iN2HsLqIiHRASoXNGg9MB A7xLZ4VxRTKWJvgUm0QdSECFTlW+/dX2obLW2RTfWv82IKlJrNo3Raev02uPD/uzcR2C +YvozYOYwDHusU5FrGBdh6ptqRUrwjz00GfwmFUzJFqMrWy9ENcG9vmVsint8r09mDXD hBxJUoQh4SIR4tcMbzeMaM6yk0Gua58YCM8rgnCdQesGNiqEz+yo+jSgjTlIZEM5H3CO D+KH5yQUcixS4lYL7Rbo/XjjJq0kEJM2hUxQg4+rtF3tOVih333AfiINZhBifPdjiWmv /bDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=IHsIUYf/EF7HX/+mLk/exZGdZj+pE5reZm8Wq5yQBdg=; b=lT9Z2776DgzUPAmSy6bJDOVpIWEGqvseEjXokpYh0Hvx8DkNN/eKbs3Jg87ez+Cm5w Rd8GXq5KE9uY7EjmXiJjTuLGtE/8QjMbZRLG2vaVmDpCs0jLLVkVwKvzaVHO8+QC7H6Q +FPWfLGxMl1m8AM1CPBb4sXoe9wxg6SpARwv8lv2HJeXMH0pnBlZVGk495oXG6dGps0q H90HZRw7ijb2EYtYRkk8/iuxDa6nSb3FsTPi0pMHetu15RLLV5HgO2fM9j91Z2vqloc5 a8bsGGQLyjLZuagFeUbkRSFv/lSY69PuyNxrQ4fDs+9kpTJsvsp20mLEehfnXlk/Qzte 2OeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@codeweavers.com header.s=6377696661 header.b=D25L8BuT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de28si9858649edb.492.2020.06.08.15.39.03; Mon, 08 Jun 2020 15:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@codeweavers.com header.s=6377696661 header.b=D25L8BuT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726749AbgFHWgZ (ORCPT + 99 others); Mon, 8 Jun 2020 18:36:25 -0400 Received: from mail.codeweavers.com ([50.203.203.244]:57396 "EHLO mail.codeweavers.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbgFHWgY (ORCPT ); Mon, 8 Jun 2020 18:36:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codeweavers.com; s=6377696661; h=To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IHsIUYf/EF7HX/+mLk/exZGdZj+pE5reZm8Wq5yQBdg=; b=D25L8BuTK+m3Z+sR9Okiw7K8l JYfP55PrFCuiGZ/ocfrd/mWt9B3YPm9GK3UxtodtEDSjYcW4jYm5xsVlFHsv971UaLzbEqoqANeSw IFS9deyjHDXQIfsUthBEeUNFAVXRIZpm8wSMwXlajUrdIU+G3vCKx9D4+IOQhLH4nZz5o=; Received: from cpe-107-184-2-226.socal.res.rr.com ([107.184.2.226] helo=[192.168.2.117]) by mail.codeweavers.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiQNQ-0004gi-EK; Mon, 08 Jun 2020 17:36:22 -0500 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: [PATCH v2] x86/umip: Add emulation/spoofing for SLDT and STR instructions From: Brendan Shanks In-Reply-To: <20200608215315.GB23567@ranerica-svr.sc.intel.com> Date: Mon, 8 Jun 2020 15:36:18 -0700 Cc: LKML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , "Eric W. Biederman" , Andreas Rammhold , "Moger, Babu" Content-Transfer-Encoding: quoted-printable Message-Id: <5256D924-9BFE-47EF-9A3A-2B5FB7B79946@codeweavers.com> References: <20200608181454.14210-1-bshanks@codeweavers.com> <20200608215315.GB23567@ranerica-svr.sc.intel.com> To: Ricardo Neri X-Mailer: Apple Mail (2.3445.104.14) X-Spam-Score: -25.8 X-Spam-Report: Spam detection software, running on the system "mail.codeweavers.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > On Jun 8, 2020, at 2:53 PM, Ricardo Neri wrote: > > On Mon, Jun 08, 2020 at 11:14:54AM -0700, Brendan Shanks wrote: >> Add emulation/spoofing of SLDT and STR [...] Content analysis details: (-25.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -20 USER_IN_WHITELIST From: address is in the user's white-list -6.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -0.5 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.7 AWL AWL: Adjusted score from AWL reputation of From: address Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 8, 2020, at 2:53 PM, Ricardo Neri = wrote: >=20 > On Mon, Jun 08, 2020 at 11:14:54AM -0700, Brendan Shanks wrote: >> Add emulation/spoofing of SLDT and STR for both 32- and 64-bit >> processes. >>=20 >> Wine users have found a small number of Windows apps using SLDT that >> were crashing when run on UMIP-enabled systems. >>=20 >> Reported-by: Andreas Rammhold >> Originally-by: Ricardo Neri >> Signed-off-by: Brendan Shanks >> --- >>=20 >> v2: Return (GDT_ENTRY_LDT * 8) for SLDT when an LDT is set. >>=20 >> arch/x86/kernel/umip.c | 34 +++++++++++++++++++++++++--------- >> 1 file changed, 25 insertions(+), 9 deletions(-) >>=20 >> diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c >> index 8d5cbe1bbb3b..a85f0b0ec2b9 100644 >> --- a/arch/x86/kernel/umip.c >> +++ b/arch/x86/kernel/umip.c >> @@ -64,6 +64,8 @@ >> #define UMIP_DUMMY_GDT_BASE 0xfffffffffffe0000ULL >> #define UMIP_DUMMY_IDT_BASE 0xffffffffffff0000ULL >>=20 >> +#define UMIP_DUMMY_TASK_REGISTER_SELECTOR 0x40 >=20 > One more thing. How was this value selected? Would it be possible to = use > GDT_ENTRY_TSS*8? Linux already uses this value. I used 0x40 because =E2=80=98sldt=E2=80=99 returned that value on every = system I tested. GDT_ENTRY_TSS*8 also equals 0x40 (for 64-bit capable = kernels), yes I can use that instead. Thank you, Brendan Shanks CodeWeavers=