From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 384E71714DF; Sun, 22 Sep 2024 07:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726991608; cv=none; b=BXB/2dtCLHKOP0x9RBh4xCPipG0QFV2JRVfcklxlxuBYN+rCyfnKr10ORsPo8N4J9RRvz7BNUrmORINtrQoPokKQVbjU0dfd22Qz13YbN8MYGIFHoZmpC9gfeFH/Ovobk78jC0L8pDpQSlEvtvtbYHr79c9kP6amFJp3wCc5huk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726991608; c=relaxed/simple; bh=RnxEDmqYi58xxblh/2elLK2On8jjWvn31+HcyDQs2Tw=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=sWpfrrwW48KzwRe55/oMopc0+s90iT2FaV141Xp7U4XczDIKHUR5eKLVP6MkI7UopQwBMnOueHdnXHTP5WysAGpiekxvmG5dkOREFHbCJAg9RkMoh8jj0MNg5aDEtViIOzIUa99OhxOPLV/tSM4p2ph2L/kZBSVJpIrmfvgLjT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=WTg4SCK7; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ck9fR1vA; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="WTg4SCK7"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ck9fR1vA" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 23371138025D; Sun, 22 Sep 2024 03:53:25 -0400 (EDT) Received: from phl-imap-11 ([10.202.2.101]) by phl-compute-10.internal (MEProxy); Sun, 22 Sep 2024 03:53:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1726991605; x=1727078005; bh=QtaWawvvQ39ZGWhwZAM+wk43O+xWu43ctkOGufDANlo=; b= WTg4SCK7ZKahfqfM7lYYiEhNtnIT0IibS25Lmi3UMz0l+2y2dAGGeMnlK2t8QiVy EybR2vMJHg3SLiTlUlx5zTE2wE+pEwvVsOFZFVFiy5wZXRmZ9en7886qHfvcRYyE NccWP3g7D/QTiGby+/yywFDH77VWh3CgdGH2qF/G9I0LseT9xxPGDWqRRZPcLaKM z9kw4rOWEH+knInCrC/Tw65c4VNVgY/knK/v7RR4CDZ8dkqv6DwuA/MsEyDAwXfv ub+ysd6CjEJPvpwgiSAYEXoQy4yfwd14kdAeSJcfWw8Cg69AuddDnVU0qH5N6aGy TtiPUOyQ5LzlBKcePhlyyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1726991605; x= 1727078005; bh=QtaWawvvQ39ZGWhwZAM+wk43O+xWu43ctkOGufDANlo=; b=c k9fR1vAujL8EsBM/M/jMAiGA9sgre59FmPS2yUud9KMxJV23y55+sL/YArc+CPIL nCZqYm++XJU+1WkpjRRCAYBiGDxI0DZh7dZl4MpGrakzyjP3RZ8G+uDvtlcumbZx nUyIc202eBe7enpc5rwLr8ZojRcEcnSl36yN0hkWpye+rxCdhG0yLtJMmdRmDDvx /F7WxqY5UlxgxFezlCIKYqSaGQPNmR5Cri/O67MMID88jgouh76zjhT+D96adPBK +zgg9yYiRk4jiAES0Mh4nYAbVYBzCjYHDVP447gh9Gqm/bj5TQx9U94u+XoDryDs yVIy4weu5Sm0D/3/fpgQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeliedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvvefkjghfufgtgfesthejredtredt tdenucfhrhhomhepfdetrhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusg druggvqeenucggtffrrghtthgvrhhnpeefhfehteffuddvgfeigefhjeetvdekteekjeef keekleffjeetvedvgefhhfeihfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegr rhhnuggsrdguvgdpnhgspghrtghpthhtohepvdekpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopegrrhhvvgesrghnughrohhiugdrtghomhdprhgtphhtthhopehmrggtohes rghnughrohhiugdrtghomhdprhgtphhtthhopehtkhhjohhssegrnhgurhhoihgurdgtoh hmpdhrtghpthhtohepkhgvvghstghoohhksegthhhrohhmihhumhdrohhrghdprhgtphht thhopehgrghrhiesghgrrhihghhuohdrnhgvthdprhgtphhtthhopegrlhgvgidrghgrhi hnohhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghoqhhunhdrfhgvnhhgsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepfigvughsohhnrghfsehgmhgrihhlrdgtohhmpdhrtg hpthhtoheprghlihgtvghrhihhlhesghhoohhglhgvrdgtohhm X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 867632220071; Sun, 22 Sep 2024 03:53:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Sun, 22 Sep 2024 07:52:34 +0000 From: "Arnd Bergmann" To: "Sasha Levin" , "Alice Ryhl" , "Tariq Toukan" , linux-rdma@vger.kernel.org Cc: "Miguel Ojeda" , "Matthew Wilcox" , "Alexander Viro" , "Andrew Morton" , "Kees Cook" , "Alex Gaynor" , "Wedson Almeida Filho" , "Boqun Feng" , "Gary Guo" , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Greg Kroah-Hartman" , =?UTF-8?Q?Arve_Hj=C3=B8nnev=C3=A5g?= , "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" Message-Id: In-Reply-To: References: <20240528-alice-mm-v7-0-78222c31b8f4@google.com> <20240528-alice-mm-v7-2-78222c31b8f4@google.com> Subject: Re: [PATCH v7 2/4] uaccess: always export _copy_[from|to]_user with CONFIG_RUST Content-Type: text/plain Content-Transfer-Encoding: 7bit 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? Arnd