From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3507B487A4 for ; Sun, 17 Dec 2023 21:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=zytor.com header.i=@zytor.com header.b="Q8lWjJck" Received: from [127.0.0.1] ([76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 3BHLjrZP415745 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sun, 17 Dec 2023 13:45:54 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 3BHLjrZP415745 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2023121201; t=1702849554; bh=UBkT/UbBN1VUMnPrXVesUOXFqJl0PBzlbqiMgCj6YiM=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Q8lWjJck6lo62970EYOSiAdoOQSYPD2tS12Sy4JJqusCXUNTUZp2BaEEMgM9paE1m 0BbhJtj4d1bauy+7ILwlABKR0aPdrhfRM27JOawwgau08BD+Cn7NYe/lM7NcpUH6sp YJMj6pbfA7N7MF3N2xslYQKZN+ih450F+RqlspH7Anz1ULCPI/ITHqmp2KqMLrFo49 9l+btLU5uKpL3iDLfa2Hquv3ioAo06L3F0GJPmfw3Z7ZGqVdcAoBjp05IO8gYI+Fvn +z5c3qnxVsA2Vj34SDnhvyR4iWlmo2nNybFar31RV8iVaM8zlUBBqEAu5HCpu9uEVs y41WkMTSuaPgg== Date: Sun, 17 Dec 2023 13:45:50 -0800 From: "H. Peter Anvin" To: Linus Torvalds CC: Brian Gerst , linux-kernel@vger.kernel.org, x86@kernel.org, Ingo Molnar , Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Michal Luczaj Subject: Re: [PATCH 3/3] x86/sigreturn: Reject system segements User-Agent: K-9 Mail for Android In-Reply-To: References: <20231213163443.70490-1-brgerst@gmail.com> <20231213163443.70490-4-brgerst@gmail.com> Message-ID: <2D83F195-CFE8-41D2-87AB-60B148CC5672@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On December 17, 2023 1:40:53 PM PST, Linus Torvalds wrote: >On Sun, 17 Dec 2023 at 13:08, H=2E Peter Anvin wrote: >> >> On December 13, 2023 10:54:00 AM PST, Linus Torvalds wrote: >]> >Side note: the SS/CS checks could be stricter than the usual selector= tests=2E >> > >> >In particular, normal segments can be Null segments=2E But CS/SS must = not be=2E >> > >> >Also, since you're now checking the validity, maybe we shouldn't do >> >the "force cpl3" any more, and just make it an error to try to load a >> >non-cpl3 segment at sigreturn=2E=2E >> > >> >That forcing was literally just because we weren't checking it for san= ity=2E=2E=2E >> > >> > Linus >> >> Not to mention that changing a null descriptor to 3 is wrong=2E > >I don't think it is=2E All of 0-3 are "Null selectors"=2E The RPL of the >selector simply doesn't matter when the index is zero, afaik=2E > >But we obviously only do this for CS/SS, which can't be (any kind of) >Null selector and iret will GP on them regardless of the RPL in the >selector=2E > > Linus Of course not for CS/SS, but I would agree that if the selector is 0 befor= e the signal it shouldn't mysteriously and asynchronously become 3=2E