Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1215471pxu; Wed, 6 Jan 2021 16:09:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxq2b3/78CvqtOHbJXh8iVqoLzaHpscLBXbv5PEcTStaQb0VL5RH8pd/4HJCOLSpt/nrNXV X-Received: by 2002:a17:907:a8a:: with SMTP id by10mr4419954ejc.423.1609978160255; Wed, 06 Jan 2021 16:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609978160; cv=none; d=google.com; s=arc-20160816; b=Stg7hOroYW6uH/A7cS9Rll1dBmnPJLqUiBbMZmESx5Ctij1CUdG6w93Ci+cPgFbnhw 4A0Oiz5/f+NBcu2XaSmGfOb9Sxjzjrl4A8s4EPqHFKMw8wbo+uslt56QQIoI8SS4iYEH sNf3DIenhSPqg6ZJMCbaY9y3kZnF0ccK1Fm6hlSlHTFV+LzPKL3TLfSEabsMX89U9n53 v9oVUrZPMorAaWsWOdlOxa+4YAtKGg1LFHCUrLDjIftOCazfpX5L1z5T8s+YXvcYS+lL cVdsD9jSQuR7kzUxUcO7N9uri1I1ZPOghEcPgDtjCPAfAHxKw8BdJt4QtsLg+TsEc4ep zCWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=1QZxiN2Y8LEelG7OpYOldYUkGlfcW+4VFUmTA5CQW+c=; b=OWo825EaGsXL5YndniJSCfNTHz2bEyr1otQA9nUy2ao+7YHZVrYKxKiq+lDek6MW+d q8EiY6zkW/A5R22Zd+8FExcl6bhaZASZ9c2GL+almdu+xK/1+1czoImpnzV99S2UpeLM yaAOOXWsRGBF2p8/t1d+rzoJQCjj8CxmVlaWgkQgyNB40Q2V5rqdfplPFVttQJuIzfQi 96j4HodffGfsFbhSymM+HxHDFiqCffl1Pza5BkI9bBYqz38JjYxCm/6Jlg4Zfmt77CP1 JVVfcJ0e0k9hUtAAbIIPtLEx6TWx8W78XCyyhlL7LY2Y6wchaM56UO/6GqIvbzUSk/Hi CnCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="XK/J1qNF"; 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 n8si1497811edt.440.2021.01.06.16.08.55; Wed, 06 Jan 2021 16:09:20 -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=@infradead.org header.s=merlin.20170209 header.b="XK/J1qNF"; 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 S1727688AbhAGAHu (ORCPT + 99 others); Wed, 6 Jan 2021 19:07:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbhAGAHu (ORCPT ); Wed, 6 Jan 2021 19:07:50 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D70C06136B for ; Wed, 6 Jan 2021 16:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=1QZxiN2Y8LEelG7OpYOldYUkGlfcW+4VFUmTA5CQW+c=; b=XK/J1qNFzLJxho9wHgBcVIyrJr qIXGdrmGZWYJSw6/YqYmrGDdvkSMoNyVmoG8DiOnOTDFvcb5YIrGvMdLqb/70a0QFOu0H2M5/OoLh DHtl9liIWd4xLDKLIhu77cklm1aJRpHLx0NlmQ5TqDJlgpCbdHMzJf9RoAMXPPwKaL4195HHDi1bQ emzwiWqJv6pdrN7bK9zeRG1Wj9zuyqGVbNymOW+ECbL+2PHQRBwOdUiWgOp6dmlcolFoeEVN7pozV pTDs+gXxSJ5I1z8qTpQxCwh5e0kNLMxDEf1h4nPl/Jom4eQxQRLN+5wLDlf/2LYsYFT/IqCJ5f2vb iQ7dGFiA==; Received: from [2601:1c0:6280:3f0::79df] by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxIpU-000816-69; Thu, 07 Jan 2021 00:07:04 +0000 Subject: Re: [PATCH] mm/uaccess: Use 'unsigned long' to placate UBSAN warnings, again To: Kees Cook , Peter Zijlstra Cc: Josh Poimboeuf , Alexander Viro , linux-kernel@vger.kernel.org, aryabinin@virtuozzo.com, dvyukov@google.com References: <590998aa9cc50f431343f76cae72b2abf8ac1fdd.1608699683.git.jpoimboe@redhat.com> <20210104151317.GR3021@hirez.programming.kicks-ass.net> <202101061536.C4A93132@keescook> From: Randy Dunlap Message-ID: Date: Wed, 6 Jan 2021 16:06:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <202101061536.C4A93132@keescook> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/6/21 3:37 PM, Kees Cook wrote: > On Mon, Jan 04, 2021 at 04:13:17PM +0100, Peter Zijlstra wrote: >> On Tue, Dec 22, 2020 at 11:04:54PM -0600, Josh Poimboeuf wrote: >>> GCC 7 has a known bug where UBSAN ignores '-fwrapv' and generates false >>> signed-overflow-UB warnings. The type mismatch between 'i' and >>> 'nr_segs' in copy_compat_iovec_from_user() is causing such a warning, >>> which also happens to violate uaccess rules: >>> >>> lib/iov_iter.o: warning: objtool: iovec_from_user()+0x22d: call to __ubsan_handle_add_overflow() with UACCESS enabled >>> >>> Fix it by making the variable types match. >>> >>> This is similar to a previous commit: >>> >>> 29da93fea3ea ("mm/uaccess: Use 'unsigned long' to placate UBSAN warnings on older GCC versions") >> >> Maybe it's time we make UBSAN builds depend on GCC-8+ ? > > I would be totally fine with that. The only thing I can think of that > might care is syzbot. Dmitry, does syzbot use anything older than gcc 8? I use UBSAN successfully with GCC 7.5.0. However, I can revert whatever future patch someone adds for this... -- ~Randy