Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp59327lqp; Tue, 11 Jun 2024 14:44:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXB1kKTnYZlOaJkEASN+zIUHGg/r+d9BFd8ZhhGMyOEpD2cAn3HV3Z+3NEI1nVQDpgA+PipLjImZHbhq8CDRXTBbvkf8gVKlDyUttdhWA== X-Google-Smtp-Source: AGHT+IF/JvyHzyAygrxSlLct5PQYgPTsW9DdzSnjLkBPsZAGEVGtzRqdJ+fntPUUeFI+k/JYje6R X-Received: by 2002:a05:6e02:19cf:b0:375:ca78:c443 with SMTP id e9e14a558f8ab-375ccff21bbmr741655ab.0.1718142267035; Tue, 11 Jun 2024 14:44:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718142267; cv=pass; d=google.com; s=arc-20160816; b=AVJD7CahGXw/HSMeHpQbzlMY/TRWDkk9sa5GnxGNvGgND8x7lb3YzMRFHNWYbBgnTG jlFr+/xmoR8MjZcnsoApHVbwj/B6ayvwVK+Vnv7HMjv1qLFvC/bUU3GozOOt/0nByZf7 DaaArIkTpuM+F2QQ3Rr83tR7NampxG8yx3Jbh7dS2sFTKukXjKIlsZRBzZMC2QqHbSP2 qSIKYHocfv8b3brIxfk6ISZchOBEAccpfTd/uEAooBdNawQwIVWYkSQ7ZwhWV3LdgnIe H896Tw12CYoRvShJorNh8IBbWayxeJKTgz/gylqgksjo6garhYjdne6hv3RYCprSC9jm rlmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=8wdnj2RPUNpywaTmVaIrKg5LDfErQYVHsVEZmkylT7g=; fh=VqMrzLr4ipT9Mpi7wNX5OVrCe56tSZKg2FtcCqhCksg=; b=WV84jYhwvqBRXPlCUjxLZtJakmxYrWVzuVGbLeKo7zg85NFnGLq5q3piBuMgYeEvaC ibRWSw83q0BX2sVY+Lil+3RaXhnfeo5ZPX4dXVTH5BZUTitnXlUMZpwV+kOt4uAxkot+ O84JffY7HpP2YlMUL7et1+T0RIiVA8Abs4EuJwA1C3H/n1bjNi9hjYpeIo8286UmLzgg pAoOZ/k7r7qMi0vQppdGC01oKNbhcBcekRuVFS7oLbGC7D0tZuR1ibis4IWdgmQ4hHnC 2BEHkjmcHFiYDNp30rpGmZcU/HIDvnh410tmiQgyvgjdpFuK77mPNMzxA7LisByl+t8n AbtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=F+cXvwq1; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-210625-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210625-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e761f91efasi6554487a12.608.2024.06.11.14.44.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 14:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210625-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=F+cXvwq1; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-210625-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210625-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4547DB232FD for ; Tue, 11 Jun 2024 21:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 519A414B96C; Tue, 11 Jun 2024 21:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="F+cXvwq1" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 69F152CCB7; Tue, 11 Jun 2024 21:44:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718142251; cv=none; b=qLmreUrb72qPeRKudan1O4L2xWBH0Pf+Mj8x8ocq2sTJb9iMI3Q0wd/ktxsjubb1xenebi9QK9J72w3ytfYZMystQZm1miodLWRo8DisbdBMBxs3mrvix4bCAjf7xzJiTMP7EQCl4yxV8lT2whmOjK3Moa4JLeH0v80392TpL10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718142251; c=relaxed/simple; bh=MnMMMfKpCzwe5zM46Q5EbI2heIEE2LunZ3AvfWvTS6g=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=FcHKWT+zuz3mtazc4zksw9Ygre2hENydL3klx329F1qu8cjOnjFSwhegfZCk+L6OnPWyK5xwVhhYF1Ek2UUXEBHmMiVSygY2LgRz/8o/tqYB/SR+/oyc5bZnDuh26Bhl2tG32HlcmqNHtA8G8fgN3ORzjQQtGa5kooimw/J3OrY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=F+cXvwq1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A6C7C2BD10; Tue, 11 Jun 2024 21:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1718142251; bh=MnMMMfKpCzwe5zM46Q5EbI2heIEE2LunZ3AvfWvTS6g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=F+cXvwq1E2TzxC4y2mbbVqf/tGLnfTL2o8VAOeFV12pQ7Iu7bYct4JQXZ+EtFwN7k rGqjg6WRjlAenK2E+/iCAhFqW/WNhMsTRYJcY43kCiht/z4G2QhQc5Di5rHjQyt2Lk 8/A3i9mcX3XNNNebCUrrEHW9Ly/0IHUBh5MrrTms= Date: Tue, 11 Jun 2024 14:44:09 -0700 From: Andrew Morton To: Alice Ryhl Cc: Miguel Ojeda , Matthew Wilcox , Al Viro , 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 , =?ISO-8859-1?Q?"Arve_Hj?= =?ISO-8859-1?Q?=F8nnev=E5g"?= , 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: <20240611144409.21840c70387b29eddcf5c2f5@linux-foundation.org> In-Reply-To: <20240528-alice-mm-v7-2-78222c31b8f4@google.com> References: <20240528-alice-mm-v7-0-78222c31b8f4@google.com> <20240528-alice-mm-v7-2-78222c31b8f4@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 28 May 2024 14:58:03 +0000 Alice Ryhl wrote: > 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. > > ... > > include/linux/uaccess.h | 46 ++++++++++++++++++++++++++++++++-------------- > lib/usercopy.c | 30 ++++-------------------------- > 2 files changed, 36 insertions(+), 40 deletions(-) Acked-by: Andrew Morton