Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp25514rbb; Fri, 23 Feb 2024 10:29:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVv9HmquvmHKoXXtGcrcgAMvs68HI3THck/XlJEN2a34Ep5bOd9amEfWGQxqQG3wVOPskvezMMF+b8kmEhJ7494lConouZpWgIxCbwiiw== X-Google-Smtp-Source: AGHT+IH9c952WXJjBgovOE+XLhLGrR7z4GKNqdp/I5dRDR2+BHPeaOHJDfLj/KNJzoNzvV8SmtNc X-Received: by 2002:a17:906:68c6:b0:a41:392d:e11c with SMTP id y6-20020a17090668c600b00a41392de11cmr412139ejr.26.1708712940796; Fri, 23 Feb 2024 10:29:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708712940; cv=pass; d=google.com; s=arc-20160816; b=B8If1EtqT7eeswRlGygY6304a9VOlh7LMgB3jI92Zu//4ZXVysNDicsxM4ESi1Appw t8S0gpEu+sMMIsqXP9d0jeqzYXB91kmp9aP7TH/JNSqb1AkpLg+t2JExYiXPG6wqTq4b 38yyMNi3sAhCjHYQHUoLwmACNE7BFlc5gpl75leF+UwG1bCrlCm35fQzfhIkKXvwo0zZ xWBYyEnNTVSkb5Abx6Aob19aJqrrnIRzB97j95Tt9kN7NafNQfI8Ihf4gjaV0L4JD0SV RpQf9IZCovmPfoaAH1OvfSvRukh/8tvMfqZgDCEKinRNFV5XW67OOcnBmDLY3YhuNgY2 o0Vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=B6EjNaWdiktqEuLncaKVE82jxx+NKh1TlSMryRmLWUA=; fh=J9NNDL9kGZzZzQnR7QO297CevpxuvIuzK3kwrTz96GI=; b=zPa4BbZtaJT5kqEylwjw9iP6Ng2Z/vz23Ttsa3xCDOzfhA5A9RWaRs0/xKjUALiEDi YZLznvQRM/9cXLenGBdyEfu9Soyb6y6kLQxACvOd0IukpvbU7TyDVh/a/pWdbd3XLnVV snTE6uS7ObhsgQQ23JLO2pdVUGtia8QWqWG1VbJBJW0s/63GfKIBvFEwrOVX6GaYClmJ NT//MBbCrkwoDbzr9XKu6HC+nV4cflYgp0QrozB0WxJ1E+Vy0ZszegNTgR7uRS43ziLU SRgHt8Pysx2TTZllj+Dlc2YTKKDUxM5sTBKCsfLY85gBlgJQXvES6e0QrR7Sc6vcEtMD Ghjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa2 header.b=uiEBRAvj; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed2 header.b="oLwsR/0C"; arc=pass (i=1 dkim=pass dkdomain=ravnborg.org); spf=pass (google.com: domain of linux-kernel+bounces-78980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78980-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id le2-20020a170907170200b00a3f2147fcc3si2883305ejc.90.2024.02.23.10.29.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 10:29:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa2 header.b=uiEBRAvj; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed2 header.b="oLwsR/0C"; arc=pass (i=1 dkim=pass dkdomain=ravnborg.org); spf=pass (google.com: domain of linux-kernel+bounces-78980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78980-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 636DD1F26637 for ; Fri, 23 Feb 2024 18:29:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FC33143C54; Fri, 23 Feb 2024 18:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b="uiEBRAvj"; dkim=permerror (0-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b="oLwsR/0C" Received: from mailrelay5-1.pub.mailoutpod2-cph3.one.com (mailrelay5-1.pub.mailoutpod2-cph3.one.com [46.30.211.180]) (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 C54E5142623 for ; Fri, 23 Feb 2024 18:27:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.30.211.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708712881; cv=none; b=P897IuJs+HbpIEPrxGhwTWKJc4XkRHlhr4AhHyEM7DVidgBgqoJBJ8vXOZR4iF9tpXT+iaTEh/HrxzVIXO6exGDNDu1l8zACyYbEebvJDFs3Ke0UvxKoZtEjoCc0xSMSULPhywzKvltvei5BDNs1TZ/cA0XIcTBk5TOcRoiCeNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708712881; c=relaxed/simple; bh=D1QGXZw6sUZ778PeZk9AsWl7LhHjAPoaCloTBO103w8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KD1MkIrOpU8u8dPZDbre3H2OwnCKj9Z81ElyyasL5y8RJREPlotQQWGwkLtJChDB3b1SmJ0kY6yYfNXwKjyn7ycUga7bQQVj+MVGVsY3HVxdY+lc8/06a21MLWOeesz9x0Tdbr5Md2c7Z0dcoQ0DGqbZSALzkjvyJMC+qOPkNIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org; spf=none smtp.mailfrom=ravnborg.org; dkim=pass (2048-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b=uiEBRAvj; dkim=permerror (0-bit key) header.d=ravnborg.org header.i=@ravnborg.org header.b=oLwsR/0C; arc=none smtp.client-ip=46.30.211.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ravnborg.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa2; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=B6EjNaWdiktqEuLncaKVE82jxx+NKh1TlSMryRmLWUA=; b=uiEBRAvjxOsaJwk90DFlIOWSmTME7MH4GDlWu5J/vG1Okq9cmza6UGoBlXeNS3sLDcVsBLxHAADjD e2ZxhAQj4u0cQOdBAuCjB6Un0IEmUZDOm8lciiu7GhoQvittFnnYTZZN1nqSLQaJvZDcEo/XsU/EeY 9jhdNMSD8/Nidu4uaxLuUdRBrtF1MI6JyOCLP+iLcglu6K+1WpQxA+E3YZZHzkGjCfZA9JD+RRUDeg riAheo4PZlQzGtOdPfZ+6di84OcIaib+qjrbHiHIUBXxppG+GEZlylwj1TymX1asVXMUKAVI6/fFoN eK84IcYM75uHLBRpWw/gbRdBjFQF/gg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed2; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=B6EjNaWdiktqEuLncaKVE82jxx+NKh1TlSMryRmLWUA=; b=oLwsR/0Cr6RWTYv5L83UN2z/haUi/To0reQmcJ4qbMung9oH9COqad2IyStuvbuQoBprzANSv0l3C CW/4520DQ== X-HalOne-ID: 19483c2d-d279-11ee-ad41-657a30c718c6 Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay5.pub.mailoutpod2-cph3.one.com (Halon) with ESMTPSA id 19483c2d-d279-11ee-ad41-657a30c718c6; Fri, 23 Feb 2024 18:26:47 +0000 (UTC) Date: Fri, 23 Feb 2024 19:26:46 +0100 From: Sam Ravnborg To: Kees Cook Cc: "David S. Miller" , Andreas Larsson , Masahiro Yamada , Helge Deller , Guo Ren , sparclinux@vger.kernel.org, Catalin Marinas , "Russell King (Oracle)" , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] sparc: vdso: Disable UBSAN instrumentation Message-ID: <20240223182646.GA2825372@ravnborg.org> References: <20240223165942.work.950-kees@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240223165942.work.950-kees@kernel.org> Hi Kees, On Fri, Feb 23, 2024 at 08:59:45AM -0800, Kees Cook wrote: > The UBSAN instrumentation cannot work in the vDSO since it is executing > in userspace, so disable it in the Makefile. Fixes the build failures > such as: > > arch/sparc/vdso/vclock_gettime.c:217: undefined reference to `__ubsan_handle_shift_out_of_bounds' > > Signed-off-by: Kees Cook > --- > Cc: "David S. Miller" > Cc: Andreas Larsson > Cc: Masahiro Yamada > Cc: Sam Ravnborg > Cc: Helge Deller > Cc: Guo Ren > Cc: sparclinux@vger.kernel.org > --- > arch/sparc/vdso/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile > index 7f5eedf1f5e0..e8aef2c8ae99 100644 > --- a/arch/sparc/vdso/Makefile > +++ b/arch/sparc/vdso/Makefile > @@ -2,6 +2,7 @@ > # > # Building vDSO images for sparc. > # > +UBSAN_SANITIZE := n When I read: config UBSAN_SANITIZE_ALL bool "Enable instrumentation for the entire kernel" depends on ARCH_HAS_UBSAN_SANITIZE_ALL default y help This option activates instrumentation for the entire kernel. If you don't enable this option, you have to explicitly specify UBSAN_SANITIZE := y for the files/directories you want to check for UB. Enabling this option will get kernel image size increased significantly. I am left with the understanding that only arch's that selects ARCH_HAS_UBSAN_SANITIZE_ALL would need to turn off UBSAN_SANITIZE. Are this fix papering over some other bug where we enable UBSAN_SANITIZE_ALL for arch's that should not have it, or something else that enable it? Sam