From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1F21CF9C69 for ; Sun, 22 Sep 2024 07:08:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D3856B007B; Sun, 22 Sep 2024 03:08:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05B9E6B0082; Sun, 22 Sep 2024 03:08:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E17706B0085; Sun, 22 Sep 2024 03:08:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BA2516B007B for ; Sun, 22 Sep 2024 03:08:46 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2ADC8ABB3A for ; Sun, 22 Sep 2024 07:08:46 +0000 (UTC) X-FDA: 82591496652.29.508246F Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf30.hostedemail.com (Postfix) with ESMTP id 8233180015 for ; Sun, 22 Sep 2024 07:08:44 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ivwm1e57; spf=pass (imf30.hostedemail.com: domain of sashal@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sashal@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726988807; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2eIgec9y/D7Av6xzKKxiz6+chHX3zYS98yQVPnuXR5o=; b=SMZz5n7UnDrBONPJ3XKBdgbUVwqp2Xd/vjUz22t2DZ+D5clcClDQnKhrRR3d/XAA8BABOI kn6dwl21oe14kjc6UTRONgfnY/zAvVdp+CLUaEcC6oiZBX3Izp0w1q7mNFHLskpDNu43iZ Qb66OOfS+Ld3jqQ8gBs270FSELoUbTU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726988807; a=rsa-sha256; cv=none; b=jU57LInjqfk5vzMuOlhJyJLCaRVwtYeDSIxVxkE5qI/U5Sn9IByF64hXoeBAziLXdkhgEr guq3QqQ7Oak8ZAHHM19AZBQ7WXHqwIZTvN3Y1AsU7767RblB2VZRO4vhWnRCTiA1FDUMEJ sCiFWizmcEb3PLFC1CySTYhiw4UvcXI= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ivwm1e57; spf=pass (imf30.hostedemail.com: domain of sashal@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sashal@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 7CC76A40BE1; Sun, 22 Sep 2024 07:08:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A5E7C4CEC3; Sun, 22 Sep 2024 07:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726988923; bh=Pl7LYO3PH7IY3j9QY3/tjp3FFfGRuEsI3T5Rp9sTW6U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ivwm1e571wNQdXqM6SOXXlWAWg8UkYarzwFQC5sWGuzkMmdX95fCmpn0YJq60zBHy PxvhmAjic/dTRGPHGEIyWAOQ68Z7cXvDH/ahPQSwfwHfr4mVBMNFP3DI2AKkR/j6KH D7ucUtNXJwAWbQsTKeTnWSrXxSJUz0cfOijaLz7+G33K4TlvqaH9+xbBVLtjNvBURK A7N05XyA7EIVnp2IHIi2VjT6k3m8jUi7eAlEFzEd7AfUp2ZiUXqMS3G4TZOXwZMHjE jQSQdwE23Sn0ikDmaHeFzTtoPTaMdvX84sO1GwpC5jVJqk5mVjCCuphrUnyUH5DYbU 5UGvBXXsxj61Q== Date: Sun, 22 Sep 2024 03:08:41 -0400 From: Sasha Levin To: Alice Ryhl Cc: Miguel Ojeda , Matthew Wilcox , Al Viro , Andrew Morton , Kees Cook , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Arnd Bergmann , Trevor Gross , linux-mm@kvack.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Christian Brauner Subject: Re: [PATCH v7 2/4] uaccess: always export _copy_[from|to]_user with CONFIG_RUST Message-ID: References: <20240528-alice-mm-v7-0-78222c31b8f4@google.com> <20240528-alice-mm-v7-2-78222c31b8f4@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20240528-alice-mm-v7-2-78222c31b8f4@google.com> X-Stat-Signature: iubwss3akk19xxkcrbonj5dgmnssmkaa X-Rspamd-Queue-Id: 8233180015 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1726988924-420418 X-HE-Meta: U2FsdGVkX18bG8YykqimQNfHvcPyNDA82shaL0sZxUe3sNmuwThZO6eDI6QokQt9EN5MG1R8F1EYpAmPUCpIB6OZF/EXTw/r2fRE8a57churaqwd60IL+BpZ8Oi20TMxbRYLLfQvo/AgpyxahusVYh74xM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Gg1Veanb2IFfiYssIS2EwP+ew40oRf8IS93eVnI8AftCk8Ny2iKPMyV0N9wSu8hcu9JnLwqyx2TySjWoTPnor7uHpzzL8Z39RSVuNDRl2TJ174mFzu7cEpfPpdzy5B2z2+Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, May 28, 2024 at 02:58:03PM +0000, Alice Ryhl wrote: >From: Arnd Bergmann > >Rust code needs to be able to access _copy_from_user and _copy_to_user >so that it can skip the check_copy_size check in cases where the length >is known at compile-time, mirroring the logic for when C code will skip >check_copy_size. To do this, we ensure that exported versions of these >methods are available when CONFIG_RUST is enabled. > >Alice has verified that this patch passes the CONFIG_TEST_USER_COPY test >on x86 using the Android cuttlefish emulator. Hi folks, I've noticed a build failure using GCC 9.5.0 on arm64 allmodconfig builds: In file included from ./arch/arm64/include/asm/preempt.h:6, from ./include/linux/preempt.h:79, from ./include/linux/alloc_tag.h:11, from ./include/linux/percpu.h:5, from ./include/linux/context_tracking_state.h:5, from ./include/linux/hardirq.h:5, from drivers/net/ethernet/mellanox/mlx4/cq.c:37: In function 'check_copy_size', inlined from 'mlx4_init_user_cqes' at ./include/linux/uaccess.h:203:7: ./include/linux/thread_info.h:244:4: error: call to '__bad_copy_from' declared with attribute error: copy source size is too small 244 | __bad_copy_from(); | ^~~~~~~~~~~~~~~~~ make[7]: *** [scripts/Makefile.build:244: drivers/net/ethernet/mellanox/mlx4/cq.o] Error 1 I do not have CONFIG_RUST enabled in those builds. I've bisected the issue (twice!) and bisection points to this patch which landed upstream as 1f9a8286bc0c ("uaccess: always export _copy_[from|to]_user with CONFIG_RUST"). Reverting said commit on top of Linus's tree fixes the build breakage. -- Thanks, Sasha