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 0D0AECF9C64 for ; Sun, 22 Sep 2024 13:16:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B90B6B007B; Sun, 22 Sep 2024 09:16:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 043226B0082; Sun, 22 Sep 2024 09:16:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E269A6B0085; Sun, 22 Sep 2024 09:16:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C2BA16B007B for ; Sun, 22 Sep 2024 09:16:42 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4FF2D1A0DA8 for ; Sun, 22 Sep 2024 13:16:42 +0000 (UTC) X-FDA: 82592423844.09.96D462A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 873E6100002 for ; Sun, 22 Sep 2024 13:16:40 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Irk/UfnB"; spf=pass (imf05.hostedemail.com: domain of sashal@kernel.org designates 139.178.84.217 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=1727010884; 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=dIpS6lo60il3r/y9UWsE5lv6jkE1DSwfIZ5G4TRIGJg=; b=Vp+lmVlf7zSttlXtIKq9M+vvajfKuPIW0+VZbqO4nDTihHiwahKich6Y4f81jtqlssbIIP 3ItOt9kvzCYqRIxtXoBIXD1+oeQ9rSzrq8QJjmOLN+LlU7VtLcZaxblWRCKOwFO5EPK/Ws Y8vVILvkqjjA2pnDB6kZMzV1lsiaHnY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727010884; a=rsa-sha256; cv=none; b=ntTdipUJ1xpvR95qN05HJEYUtHx8MAp4gJO7qyw1akaS1eWQNbr5IeM7wE3O4ZivetCoro hmYuNK8sesGWwtwboXCqf4PVmsTdT7M0Bo7cPJVGkfzdyUwKfnXG5+Cc7HsyKkqJW+M2g2 x/B7AS51BP1zX2ISbNg7HoSycEPhHjU= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Irk/UfnB"; spf=pass (imf05.hostedemail.com: domain of sashal@kernel.org designates 139.178.84.217 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 dfw.source.kernel.org (Postfix) with ESMTP id 306EB5C101E; Sun, 22 Sep 2024 13:16:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23012C4CEC3; Sun, 22 Sep 2024 13:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727010998; bh=3rRxgBShBqpcovq3vY/cbRQuMcbMgN8wYzfCKoUgETc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Irk/UfnBn6jTTFmkWa1K7ZeS+4/YWB2bCmxuN1B7ZVJjaodHUx5aFeM2ehw4DuxzX b66W57SuuU7jqJa8j5lZiqkwHxV6rQrPUxovtTUFwA8cGYLkaPmtqtc1RzOa1sXNe2 tfMXAghm/WeLXreLVI59kwqR3Wj0xO/kfP35KdhSVKK/BsioPfZFm6SLhwKQKS4j8j oHewziQjOaM/JwLiDQjfw9MVNft6DoB21oX7ltnQ/rVSi4zGoBODdHKuTMCpmTNip8 6hQAqjYOnKo8GZCFWZ7WBtEWoxOXDQKqvnCGjGVmdCNW3V/loH39rSJoGii63rnXW1 LKPS7udjAsubA== Date: Sun, 22 Sep 2024 09:16:36 -0400 From: Sasha Levin To: Arnd Bergmann Cc: Alice Ryhl , Tariq Toukan , linux-rdma@vger.kernel.org, Miguel Ojeda , Matthew Wilcox , Alexander 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 , 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: X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 873E6100002 X-Stat-Signature: ka7pptjxsbeq49rzh5ynjniqijkpo7oo X-HE-Tag: 1727011000-822644 X-HE-Meta: U2FsdGVkX1+LTqIC2nVGcanE4Qk5bLuJ7QGxaMpJL8q5hNwfvrbqaealjZ6Xg2KAsiehgtrs9FSNrwidsYCh8nyYsrtlZaIjEVWjblFOEGg+n8c3sUaw3hAlXKfwuQCw8h6pveEHd3N3Ic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EjrOIdUudyanLPdVsfYpFO/H6sBnuAgEf4H4vkK2rPZD89x4QxCScbb+ARA+iY5HyrzEosOh1ti//GVwgio73ZHxXkJ2Qn3+AinItry2NMUN5I/Wd/2P90EjFU77FQAchcZVnHPfQHc46oSDeydBoce2w9UbZbUPDRRKVjhVlhcLJ9z2Zs= 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 Sun, Sep 22, 2024 at 07:52:34AM +0000, Arnd Bergmann wrote: >On Sun, Sep 22, 2024, at 07:08, Sasha Levin wrote: >> 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. > >Right, it seems we still need the fix I posted in > >https://lore.kernel.org/lkml/20230418114730.3674657-1-arnd@kernel.org/ > >Tariq, should I resend this with your Reviewed-by, or can you >apply it from the old version and make sure it finds its way >into mainline and 6.11? The patch above fixes the build issue for me, thanks! -- Thanks, Sasha