Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp958320pxb; Tue, 9 Feb 2021 18:01:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwm+mBY1n4PuAMUxNrCmXyEs7H/oAWPgLnhEt+feXWrCc5uHo87Qy6pzEmjq26JzF++1+3f X-Received: by 2002:a17:906:9401:: with SMTP id q1mr626664ejx.516.1612922475176; Tue, 09 Feb 2021 18:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612922475; cv=none; d=google.com; s=arc-20160816; b=rfwKhYdnzcOT4jr/g2q0iKEuIA8X12zB6mR9KZpKc6K5QtSBLShWvU/qD086UU2jKu wbchrLQqEpiihXk7vhPZt9xeA8Q41rlp5Bb+1QmQwGQkwpqbzzEA89jWx+odufAw/f6e 4wzlhbIz57TYtC9B8iUDi4ogwZqXfNfEs45FXLHke7ed3V7xaP2p3TfzK3gza9MvodS6 dQ0oTLHKUozuJ3W70za9pDNs0v215TAmGARYsCiplahxOumZFlNl5lP5lM8sJTLbDnrO 8n6NrlKGUA1Hu1d4JNn7gbigkq4yke4C0NsAdFZQF96ENCI5O90rt5wgR6HYw/Q7C4f/ sGSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xpBrTHZJIfUTFMKDRSVnPUYodzY0EXGoifdbMVRjzIA=; b=uOUS/B1OWsljWtrVnUmh9YqeVrw9Y4hS6lEaHXMwaOLptNZHFRp8s3UKlMG7nxkuVe 0HF6JJZEEWnItWenw9XhqaCNWG3tzmYGzdsvO9joI0I+sTLx/p1dswO9Tck1a4aM4FWt S/H89VwufpLO8qeiEwv5Jv30MI0E9KDcRo/Z3X4DQAtF6f5dHPypsHINqylLQ8HbXyrh 2p3xojJEe+WaCfXN1zIN2mp3cmLjH5Nq3TksDCk3NVyieutM0INzaC4cAvEuhtZRR8qO VRASZ1KTAxqYpEdfT9HPGGhu0NMMbXg1WwMyOd2WFWWZk5xYM8YBPJ1Qs5doHoX0Xt41 PTMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Oluwae3W; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si313297eja.553.2021.02.09.18.00.51; Tue, 09 Feb 2021 18:01:15 -0800 (PST) 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=@chromium.org header.s=google header.b=Oluwae3W; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235199AbhBJB5m (ORCPT + 99 others); Tue, 9 Feb 2021 20:57:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233657AbhBJAWD (ORCPT ); Tue, 9 Feb 2021 19:22:03 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E691C061756 for ; Tue, 9 Feb 2021 16:21:23 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id k22so232151pll.6 for ; Tue, 09 Feb 2021 16:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xpBrTHZJIfUTFMKDRSVnPUYodzY0EXGoifdbMVRjzIA=; b=Oluwae3WirHiapSlTkfy5plypAC2akuWcS9Qathv2uBak2h0Gny5J29+LM3LBM6LIs JcSO7/q7D1wm6ZhXz6sjvYEU6h4bnNoJ2yeFrnQQxXhhZpps7MT66zfPAwfQfb872hr4 Zh7Gt6vc0eXc1ihLVl/y/PRPJc63GhR78fG98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xpBrTHZJIfUTFMKDRSVnPUYodzY0EXGoifdbMVRjzIA=; b=Tr33jX0Rw0VV0e89cl11Zh7cVS4Zuf8ux8btRVa5F99If13KkbnnHkCZfi3slcrxto SjcDiu/rbJPNqv8GUVjwGaVBd7ASZSFT+EY7w4EqbK6atfP+TDbK28Dop8v/5gje2M00 ip/OR57Bx1GbHCOlI4ROmTTUtRLfQ+irMbKF1oYRCcpj1UHn633kLXCsFSer17eYU89w cDjnClvp4FeE0jZ52T3RoouysHHR53V2HTVJIs46b1UeyfiroF0oLNN1Kdky8q59VT/Q A5raTlN5fUAgEhNTJyrpSbpdeKzM/tWcU9gyo6eObmiXFGCbdlmlPiePc/has8kwypIb CpxQ== X-Gm-Message-State: AOAM53362dgshYHKuL+6vk6OmXBf1LRVZhC9IonIgrqkza8gtVsRCShT TcBBYAaMyyTu+zrDaWZUElR9Hg== X-Received: by 2002:a17:90a:be03:: with SMTP id a3mr446982pjs.55.1612916482662; Tue, 09 Feb 2021 16:21:22 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n12sm87531pff.29.2021.02.09.16.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 16:21:22 -0800 (PST) Date: Tue, 9 Feb 2021 16:21:21 -0800 From: Kees Cook To: Andrey Rybainin Cc: Josh Poimboeuf , Peter Zijlstra , Alexander Viro , linux-kernel@vger.kernel.org, Randy Dunlap , dvyukov@google.com Subject: Re: [PATCH] ubsan: Require GCC-8+ or Clang to use UBSAN Message-ID: <202102091619.8D6D5B4@keescook> References: <590998aa9cc50f431343f76cae72b2abf8ac1fdd.1608699683.git.jpoimboe@redhat.com> <20210104151317.GR3021@hirez.programming.kicks-ass.net> <20210118175337.rnh2b6vdnqw3ue63@treble> <20210209182423.te43h3mmhtvwi2d7@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 02:17:57AM +0300, Andrey Rybainin wrote: > >>>> Subject: ubsan: Require GCC-8+ or Clang to use UBSAN > >>>> > >>>> Just like how we require GCC-8.2 for KASAN due to compiler bugs, require > >>>> a sane version of GCC for UBSAN. > >>>> > >>>> Specifically, before GCC-8 UBSAN doesn't respect -fwrapv and thinks > >>>> signed arithmetic is buggered. > >>> > >>> Actually removing CONFIG_UBSAN_SIGNED_OVERFLOW would give us the same > >>> effect without restricting GCC versions. > >> > >> Is that preferable? Always happy to remove code, just need some > >> justification behind it. > > > > Is Peter's patch acceptable or do you want to do something else? > > I do prefer to just remove the code, I'll send the patch shortly. I have a specific goal of getting both signed and unsigned overflow detection working sanely, so removing this entirely from the kernel really makes working on that difficult. :) I view the primary problem as compiler-specific. I'd much rather we correctly mask against versions (or better yet, behaviors). -- Kees Cook