Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp978881lqb; Wed, 29 May 2024 17:25:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCjFH/d4fIP0idwrntJfPTzZC16sA74fvaUKD1OJzHydjl9tYoX1/ziJS2AridIB0PCkknupZKvH6TPx3SHuMkct0D+qlgUpT88zNbkg== X-Google-Smtp-Source: AGHT+IH2+OlsEPXEEnQPbL9cpkPA5ATNncWvODboBZ9xLeJkVa7WWZdN2nJ9yPBqoNvLwdpNHotv X-Received: by 2002:a05:620a:3bc9:b0:790:b2a3:f86b with SMTP id af79cd13be357-794e9da2077mr81377785a.25.1717028709467; Wed, 29 May 2024 17:25:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717028709; cv=pass; d=google.com; s=arc-20160816; b=FtJNrfYevcugN2n8GSEvboQTrLAkwmjYgf0CVDRoEI03Y8IhVkRZDHdeLyOSmEkAw6 eMz5d1tTtbs24fq8unw8xs9LH5pBztrS9Vt1CpzdUsqdW0rqJvF7FCj/IGfCMiKTv2rm SIYL7RMb5SUFpFagNaPPVR6rVZVieiQrVTSmrQH+YoS2mS1ukpYpKak40K2EzqJ/axAg 8PxM09eT2/4ucPXX5Wroo59Z3Clfalfh1lm2mkq4ipSSZ+W6KH3l2nYjd7oCs2kSic1p iqvNuEqscIQkfZRmcosywWKffrHqs/5xgHRZZ5dTbMptwKia/PAzH1bGvdgmI44lE6+p Yg4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=8WU/Su/TdkCMJqoSn+Qk/ofrN8Qleakj9+qJnBXhLHY=; fh=tbAdhyGsWk37bnc4ru2fxdCirjF+VyBS5qSEokShaM0=; b=INIL16NqcLz8UmQgLHbWiZyG9QJeIIaYCjGZj4eCmujRlljuT7tT5mo6aRTLxb83Nl Q22vyyo9dk3qlwIFS/42S0Crh/frjz72/OWwKrfZyj/bKPrWeMZC6WnhWWiPXCtjYooj V9aY6Q+kaK/qMlKlcBXvX/pLQXjLK0zMOvINEbjbV+Dk/0cX0z2lM4+D+F37V6PViTiO ovR9EnhiT8VpyX/Wndbl77ByRwr6yyfqqTl35fImN1RXAZekUmVgwWGqEc+Yf1pzdanf J6Nz0q2E1n27uzVSHnfIiEgmSRmg2HT/B+XShKMOfEshQOxqEfzxTg58uTS76LojD5Ok pzAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=ZNm5rxnF; arc=pass (i=1 spf=pass spfdomain=cloud.com dkim=pass dkdomain=citrix.com dmarc=pass fromdomain=citrix.com); spf=pass (google.com: domain of linux-kernel+bounces-194807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcc60f5si1318296385a.198.2024.05.29.17.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 17:25:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=ZNm5rxnF; arc=pass (i=1 spf=pass spfdomain=cloud.com dkim=pass dkdomain=citrix.com dmarc=pass fromdomain=citrix.com); spf=pass (google.com: domain of linux-kernel+bounces-194807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 26A941C216FB for ; Thu, 30 May 2024 00:25:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A0538828; Thu, 30 May 2024 00:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="ZNm5rxnF" Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEFDC8836 for ; Thu, 30 May 2024 00:24:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717028701; cv=none; b=mooHC9GJS6XvSf1XOgfBJd3Nz41LQP78ImRoqnHgJPmba4J8lqmUk//cyJ0JidelSeipZfNp1lnM/ckduMXnr4Y5eqI5a3a7jA1CSABPAvtmRcN3BsTyv4a5kx6315LY5cGG8wb0oTU2D/S0AwWmXbXEhM7UzoIRT+BDJxqwlFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717028701; c=relaxed/simple; bh=fi6T2j94Ji7pMV4CVbe0HpecLMs+r9lr+Q6XndjoPC8=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=BaEz96EqnHTvVXv2/4O0HHYigBacTbPRoGpYJNYCK9hLRDFC8T6yWBams58Tfj4Wbkx8nOEWC6TfdewXJNz1sPCj3WS6WeZiUN/1R+qaPQbjr4pcCGqwKSzNw8jGFE9yelPk4Dp9z8qXhQGklV+NECu0oum6G1hqIcEFHyA5otU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com; spf=pass smtp.mailfrom=cloud.com; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b=ZNm5rxnF; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloud.com Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35507e3a5deso316352f8f.1 for ; Wed, 29 May 2024 17:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1717028698; x=1717633498; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=8WU/Su/TdkCMJqoSn+Qk/ofrN8Qleakj9+qJnBXhLHY=; b=ZNm5rxnF18iGymBrX8CxLT/XRY86SaM+7TZAAN8pgwx10ZlQz1WGpbqUu/lV8phwMw 7c5kkEBFzbe6JmNcpntYtmM9r4yNuS5kGpBNrkZ+E9pxB5OAkhqRurjrD8GBZ5sjLsXv s8xvhw0nlQweCKlKoxWdqsIh7t7qruzFeFEeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717028698; x=1717633498; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8WU/Su/TdkCMJqoSn+Qk/ofrN8Qleakj9+qJnBXhLHY=; b=kDx02M+1qSMUEqCIR+PeY9St+ADVJeEv0a4/anlI6I06Ink7r4g8lARQtyBzWi3KsU dfZyjETKOb2TvsTJSIrWyDa5dwn8xw8G7zG1ViMAxo5MDm3sXxt7QPXMEP2Nh+KVYNxI e2gbms2azvvHyyWEPRBmTZpa3Xxqy7ZMgzkhHgUwUeT5SMj085TmerjPohB+W8ty1Zt9 +Mmc4ZtPQKcwDeVRgMvvLAPRVY0jCpGBcX087PaSdAR5I4EJxthCt53SiXNRNm3NyQT+ ovAmLtiw80gkXYuQnshv1sn4G24nS/RKnxZ2DPtl7sm6vNYzVerXtjEzOiCeU1d7qVUX AEyw== X-Forwarded-Encrypted: i=1; AJvYcCW/jwOwYgWRiXsUB40CwovbPzU7OYvzP4Md5vyCyHxAAQBynLLzbVzsaWtWSxMBHJc5ymy/JRkHiVIr1SHoqu1sf9/+EcKXSDwAwTcF X-Gm-Message-State: AOJu0Yxh/00jKbxx7UYo0pfvSJa1RAdDnjdGSJwMxptsRmiyWOYxg0yt Sg470y8yX9yHYJvFi1ftMYbZ9oYD+cG2DKSRh/5d1DCObmwtBB7cIgct9pH8Krs= X-Received: by 2002:adf:ea0f:0:b0:354:f729:c3e7 with SMTP id ffacd0b85a97d-35dc7ec9862mr169890f8f.34.1717028698143; Wed, 29 May 2024 17:24:58 -0700 (PDT) Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212709d378sm8137365e9.29.2024.05.29.17.24.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 May 2024 17:24:57 -0700 (PDT) Message-ID: Date: Thu, 30 May 2024 01:24:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86/traps: Enable UBSAN traps on x86 To: Gatlin Newhouse , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook , Marco Elver , Andrey Konovalov , Andrey Ryabinin , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton , Baoquan He , Rick Edgecombe , Changbin Du , Pengfei Xu , Josh Poimboeuf , Xin Li , Jason Gunthorpe , "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-hardening@vger.kernel.org, llvm@lists.linux.dev References: <20240529022043.3661757-1-gatlin.newhouse@gmail.com> Content-Language: en-GB From: Andrew Cooper Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZX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KFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== In-Reply-To: <20240529022043.3661757-1-gatlin.newhouse@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 29/05/2024 3:20 am, Gatlin Newhouse wrote: > diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h > index a3ec87d198ac..e3fbed9073f8 100644 > --- a/arch/x86/include/asm/bug.h > +++ b/arch/x86/include/asm/bug.h > @@ -13,6 +13,14 @@ > #define INSN_UD2 0x0b0f > #define LEN_UD2 2 > > +/* > + * In clang we have UD1s reporting UBSAN failures on X86, 64 and 32bit. > + */ > +#define INSN_UD1 0xb90f > +#define LEN_UD1 2 > +#define INSN_REX 0x67 > +#define LEN_REX 1 That's an address size override prefix, not a REX prefix. What information is actually encoded in this UD1 instruction?  I can't find anything any documentation which actually discusses how the ModRM byte is encoded. ~Andrew