Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp110469pxb; Tue, 24 Aug 2021 21:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfXKdzY0goU8+nmI642I2Nmjc7G7RWNxQNb4SuetCF9N/biBL6LMmv+xKZ7D8v83EeVOL0 X-Received: by 2002:aa7:cb86:: with SMTP id r6mr46850103edt.181.1629866985984; Tue, 24 Aug 2021 21:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629866985; cv=none; d=google.com; s=arc-20160816; b=dxSS5/Y2iWw8xO9+TIRHQAFWPZn8AsF6lhd18fhQoxATJHf4Fd4CEWLNav5itZxoD6 Q53vcxiX0G9PpVPcet6K9awxF3zpzgo38Cww39r79NZTov8oB8TDvY4GP609l455TsiN jmg2wPTyg3cEzgROpkBoStTvnoezAdUGFfC51JSHTelppLYWu+fBr9sXPQx3LCKhDNat wFVMRaYelU3DOWvDKmB4VRvyOCzbS2fZxQrYRfkawnIV6zOcNBfDCYQy+oEJbSoShbbS nXrj9c3I5K1Kxq3BiZpud4X88JFH7q3Jj5ARMmIzPqrdwy7Vo4aGqj9FSD2mw7lBWPjv CEjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=7An1qOKhb0/BJH1XFWypIzS3gCOZ53jVfEc4mO5wsk4=; b=R00gM8CJ/olClUFejbqhTFr4itOdFuk3uJRypqeIH6OodNK6/Uy3RVQSyLSanQpFFA Ww6MVJpy5j6BkMvAC58Hu/eOF13pOe5O/6nRTYu3YVwkPrkL/Z0Rs+B3whfnbs6AWgzJ M1wBSWfA8Fm8+CD57/UkNmwPIK/VqJ+4rcqX2WKSedOjMitVwRiKWQvwzFh1dFsTatdI MkHSGoLbVU9tyK7OcUqq/3ZYDzLg+iPMo+dF7+M0Ts4HI62U7+XIHdDascHrjPCtuw1i aPa4dlSmYH+XWPR1ZdusTMngE47VFGr+D56G+/2tmkSpK+qAMiwBvf5PnwnCgGIOObwM QiRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=v5mcuMrt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js5si1505502ejc.471.2021.08.24.21.49.23; Tue, 24 Aug 2021 21:49:45 -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=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=v5mcuMrt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbhHYEps (ORCPT + 99 others); Wed, 25 Aug 2021 00:45:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbhHYEpq (ORCPT ); Wed, 25 Aug 2021 00:45:46 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67312C061757 for ; Tue, 24 Aug 2021 21:45:01 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id x4so21872886pgh.1 for ; Tue, 24 Aug 2021 21:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=7An1qOKhb0/BJH1XFWypIzS3gCOZ53jVfEc4mO5wsk4=; b=v5mcuMrttY/PcyEkupueYaA4dl1TeGKkRQ3e72JC3lpG3D4457cMIhWBU7Wu+SUumr 0IvTqzap7e7rQPDpnuEZGu5ef4izlONypoQrGH8SqmjSMATYLk0q8FGys6EWCsFPgqji wtMiqNGr5TX5D0OGV/Fg8k8IEY4qzqSWmypEIjkyIu5RIjNe7p+JXFZvhcpD7K2LDgQm X5OKoYgORg3L3dsZka+ILXDnfh+pWC+jEB37us2atFQqzGOu40ij/n1RduGtj8Kg2fGq Y6pzkmyqbamdKxO3iAG7lqyDr7Z18KZgtfj/lKItw1UXel98tcRIuhcrbE7FW2ONU5Cp jqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=7An1qOKhb0/BJH1XFWypIzS3gCOZ53jVfEc4mO5wsk4=; b=U+U5DEbIiYa69Lx+C2H1BmBhCN8+yetPyTqriGeUIONRz+qv+DJ9/YoOgdl2IBmFoS FGFaiiPPhyihIFMp9L/wDU6T7G1MqKmPkcBqFeAPMD1oCeJawLMV/kkgj+ofcPzccTE2 ZIctKGgOyK7QDVpphbDkyqR9lxBA4L7ahkXySWBk+CigVC+5tQs8wJZ7ORLk8Rf73WMH Bc33PWHodeG+6IMjmo4HDew+LZavYaNd7lO+i+zTtATk9qJVi0/tcekvlz2aYrnF8ddE o91hVGPZeZ6KZXyQSD+xsY9VK/2xsi5c950rt2oaMb8bFeo0nOL/9/8yAegRhYDvrNug OXsQ== X-Gm-Message-State: AOAM531ctA+JUhCiFpxjR2TxrWLZqwnE+6fpwHOujV0WRBlh2Sze2gp4 xz8pCUAve/35R6s7qOuK8s0nTw== X-Received: by 2002:a05:6a00:2405:b0:3e1:9f65:9703 with SMTP id z5-20020a056a00240500b003e19f659703mr42768559pfh.6.1629866700873; Tue, 24 Aug 2021 21:45:00 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id pj14sm3597913pjb.35.2021.08.24.21.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 21:45:00 -0700 (PDT) Date: Tue, 24 Aug 2021 21:45:00 -0700 (PDT) X-Google-Original-Date: Tue, 24 Aug 2021 21:44:56 PDT (-0700) Subject: Re: [PATCH] riscv: Enable Undefined Behavior Sanitizer UBSAN In-Reply-To: <20210805003059.26b03ec0@xhacker> CC: Paul Walmsley , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: jszhang3@mail.ustc.edu.cn Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 04 Aug 2021 09:30:59 PDT (-0700), jszhang3@mail.ustc.edu.cn wrote: > From: Jisheng Zhang > > Select ARCH_HAS_UBSAN_SANITIZE_ALL in order to allow the user to > enable CONFIG_UBSAN_SANITIZE_ALL and instrument the entire kernel for > ubsan checks. > > VDSO is excluded because its build doesn't include the > __ubsan_handle_*() functions from lib/ubsan.c, and the VDSO has no > sane way to report errors even if it has definitions of these functions. > > Passed lib/test_ubsan.c test. > > Signed-off-by: Jisheng Zhang > --- > arch/riscv/Kconfig | 1 + > arch/riscv/kernel/vdso/Makefile | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index f133ac72572f..cccb95bf8331 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -28,6 +28,7 @@ config RISCV > select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL > select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL > select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST > + select ARCH_HAS_UBSAN_SANITIZE_ALL > select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX > select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT > select ARCH_STACKWALK > diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile > index 24d936c147cd..30a5335bd317 100644 > --- a/arch/riscv/kernel/vdso/Makefile > +++ b/arch/riscv/kernel/vdso/Makefile > @@ -36,6 +36,7 @@ CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os > GCOV_PROFILE := n > KCOV_INSTRUMENT := n > KASAN_SANITIZE := n > +UBSAN_SANITIZE := n > > # Force dependency > $(obj)/vdso.o: $(obj)/vdso.so Thanks, this is on for-next.