Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13891771pxu; Mon, 4 Jan 2021 07:17:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIqXuYjphzQNOS3dhnaKYfrg3y43broEEh5u3K4pR0+OLYDzqldjv/0gP9Ry7/WtFmQDKN X-Received: by 2002:a17:906:32d6:: with SMTP id k22mr67848615ejk.457.1609773421630; Mon, 04 Jan 2021 07:17:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609773421; cv=none; d=google.com; s=arc-20160816; b=sn0a+MCap4q1iltI+6JitGRJqCzsuBGi9VwrlPDd3D7kuj1nZBMBwVuo939ZcPVnzN AIIcc6KmiDt9FCaHUwSROSYrCz9QYeltX6t2xoxiakpUVSTIAdHdO+/DUxvvbXbyvDWg Aj0tlMIUYUTlJEc9QMecXcPUnNjP1s2kXI1VtcK0VzzWhUl9+p6wOerp4yL9y1zWWQ+W pAD0VOfHPelhfNAL/SoMeBfPb5/pabhEam+J76KYBsGKTitKdxqqf8LHYQ2fTJpCPCPa MloSkzmomZ35thIUzJ84MBJMJ+W6Xk0ATJD4n+NNgIEbph3SSBR44OiGa8IwAEgvXNjD ZUgg== 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=YpDUHurETXnbwAv5Csd3J2yCBg+qIHwWG+OP1AFi31I=; b=hPYMKakL7oPBxl5Fq2v+s3gKJyv8GyNm+MPVJv7yUQg9FZYB0Zutdf4IfjKoZjpnev MEcRJn6RY+zHKbBixBfTDjQRZfedvvKwWmb5b6h0mSdM1tdHxnWKzUrIVCVxeETZtOEI PtisVqd1AW3DVKwqRTIfJdkyAelT86Z6/hEijsga1zW4eP5hIZnCOnwbD7lwGC8lAvCC ggZesw71SkmhKtwjzsFuaOFgN4PjwhfVVIC890xpzAu7F4zbXjEAWWPJkrRrLPh5H4Cg IMawO7yCgpDAt7JB/OOauG3/zI2Lb1CCXlvG40QB/Y7UbJyOwO77pzplSCbqFWNzvwWu Byxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dXuZoGMR; 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 h1si32257118edj.73.2021.01.04.07.16.38; Mon, 04 Jan 2021 07:17:01 -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=casper.20170209 header.b=dXuZoGMR; 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 S1727091AbhADPO4 (ORCPT + 99 others); Mon, 4 Jan 2021 10:14:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbhADPOz (ORCPT ); Mon, 4 Jan 2021 10:14:55 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 405DBC061574 for ; Mon, 4 Jan 2021 07:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YpDUHurETXnbwAv5Csd3J2yCBg+qIHwWG+OP1AFi31I=; b=dXuZoGMR1+lh5DHlVphhfT4+95 h/LU+ksW+vGcmMaWeK+mv03KN3Hq6Ru+6dYbsWetWJVOoeFKATfy0f1wW3JZljLdF0qW47NAQo6AD NoFYacYtyutNXz5U6glNcu7gWIyZb66u04alyoOOC4e0w7ZyPxMmWhdwSGrtoB2oDUBd2TCKjOa1j QxRiZZqSsDtSJxSGnDtfY3L6Hh+ounwjBkhCkclp9A1ZMQnRBYGWOFSX+BmmV8GTK6qfVjKZZrj/5 yrTzfUM6o+8U2SAafSbfLj4zUL8TbwVt7iCOGOJz6YFCIHtaQNrUfIvdThs7YSkg/UHAJRd0u3zXk Y8QD4TTQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1kwRXs-000ELy-5c; Mon, 04 Jan 2021 15:13:37 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 60158305C10; Mon, 4 Jan 2021 16:13:17 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3BF362072C989; Mon, 4 Jan 2021 16:13:17 +0100 (CET) Date: Mon, 4 Jan 2021 16:13:17 +0100 From: Peter Zijlstra To: Josh Poimboeuf Cc: Alexander Viro , linux-kernel@vger.kernel.org, Randy Dunlap , aryabinin@virtuozzo.com, dvyukov@google.com, keescook@chromium.org Subject: Re: [PATCH] mm/uaccess: Use 'unsigned long' to placate UBSAN warnings, again Message-ID: <20210104151317.GR3021@hirez.programming.kicks-ass.net> References: <590998aa9cc50f431343f76cae72b2abf8ac1fdd.1608699683.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <590998aa9cc50f431343f76cae72b2abf8ac1fdd.1608699683.git.jpoimboe@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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+ ?