Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1952493lqp; Tue, 16 Apr 2024 02:57:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzdRNWB1Mnt/vYZXMRVUwoTolnJH/9CbcTuengBuR3xFNio3MsXGUmQdXZyUYeroSeK0rKrenzIfET+X6MK/w75fhC+cI91SA0/T+dFg== X-Google-Smtp-Source: AGHT+IHqNDHBpc8U4A6wuvjP7DFoSxlFMG2jOAGrFXUlaRg1mzXODS6R4prRio02n3t2AYYDCT9l X-Received: by 2002:a17:907:944e:b0:a52:5b3c:b527 with SMTP id dl14-20020a170907944e00b00a525b3cb527mr5684874ejc.28.1713261446562; Tue, 16 Apr 2024 02:57:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713261446; cv=pass; d=google.com; s=arc-20160816; b=pAuTrPJZxAmalGCu5FP3mlCH1m709VWauH3mhif0od61STJe+Ip/nU2M2VTuwRvNMo Y2zeYT4kcqJSDfpqCPkWn2fgmjbQoW1ZpqHjwHD77duBHyY18LbfE4HiOFTjEjTD+MgO /cArr4n3wiD9fhXzziDnC0QSgoRpaa6dWy6yIOLVFZ5MVvkSeG/ZbzwLoGnsslN9hsS9 OM5q+OLhf4sWUC4c7eWuTl5Vz303MKpapHO80t5NsAT2huTkOQ9DK61vWkyVsLZVTV+K RzWm9G/xVlUDU0COHv5kzD6dB7Cu0rEBMRsTMbjmEn+CkUNFTJ3pl1rTqKUq0vbY19jY XJdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=NHiCoxCRUNDM+U/esFCAFumYpu6ndbBWZi/5QFnqRTc=; fh=iUF04BZqtL4v7aSWVaw0YqSOP9+lEoHUdxDzCz0r1dA=; b=pvBCxEb0KIqPqFxXK+vUdapGGkcV7yl4kS+EiCLWZ1xJSGiFF7sMh1w9kcBmq/xUSU QsagPvRDjXShedrM4Rd63v0jqLArJNNImreuIANp6ModgMxaDsw1O8nPpUztt+J0IoyL aynbJ6iM8KawbsQpW0pCQPDtCR5y64iHyfP8/Ye7vQqiXS0mHSH+BBItZ46FfNpvUCqM choV6eyDLZKExqwdIbLKgbhB3tn9A3uPW3IXxvhM4JXVmwo9F+wn+D3hALtcTsQU7ux8 UQZSgjiGitIOIS/IdU3QUVPeHkkURDwNa5afXtOPuMDRE1XDLUWHPZ7ROnQtGIJIwnLl P0dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FbuDV7Ew; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-146580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id go37-20020a1709070da500b00a521fe7778esi5613516ejc.141.2024.04.16.02.57.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 02:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FbuDV7Ew; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-146580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 48C531F21F37 for ; Tue, 16 Apr 2024 09:57:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17F3A86250; Tue, 16 Apr 2024 09:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FbuDV7Ew" Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E85885929 for ; Tue, 16 Apr 2024 09:57:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713261438; cv=none; b=mJZWauJx5fCNPbnOMMMoydZJV4LkBGVGKkGytU7kM5E6uYKsdEUemIHEuZz8Z7awc+uKB7LcYtoPJhclu9P8n9+JAfHojYVSVV+OmcSdPKMrzkos5t1+7AIAdo9GQlp9pz0hLEFtCWeUBTW6Q9Tqm8juzoSwmMrgDZqZ9nMl4Uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713261438; c=relaxed/simple; bh=NHiCoxCRUNDM+U/esFCAFumYpu6ndbBWZi/5QFnqRTc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LCmB0tHUwmA4qXMYp9YiUrxHpddOK1cpm+CIx8d34kX4SSQhERpYNofPhVNgFYPVyhYE4sKsrGEqRjZB/XKyQstL6JfRVdZkz0QeNllx3owIpBpLNcspryswKCIW41qiCX7XyPe5gYUhatEwqo3JbXtTtL/NfuT6u57n1c4WraY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FbuDV7Ew; arc=none smtp.client-ip=209.85.217.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-vs1-f51.google.com with SMTP id ada2fe7eead31-47a404c6decso1113705137.3 for ; Tue, 16 Apr 2024 02:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713261435; x=1713866235; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NHiCoxCRUNDM+U/esFCAFumYpu6ndbBWZi/5QFnqRTc=; b=FbuDV7EwX+FwQw93U6rtrmn01IWg6/YjrdhIk21GdG9dQ3oDnnsqJktJjTvtaPouHD +OZUJcC1c3R7WEqRae5PcN5GZ8QyOHxULY7fePWEyzFnLr7dWVLoJiTNaZNLNPavVH7N 0bkOWmSpkheevBAWtGk082wEB5u/giX9SSZ7B1VgGT1oe2z6wgNE7nYvsK2vtzaR4dLW hGWKpRugoPFuUA03fAfQrecF1rMG45bv6kIVl/PKYk37yfb6OW2buNkaDOBfbuFqghl4 5cmLhkccCeC1fuJ9XgcCSA+10AUqZ5OZkw4ZjymDQiOOxuwhq5HlhjmRNiPPsQG+YPIu jnyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713261435; x=1713866235; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NHiCoxCRUNDM+U/esFCAFumYpu6ndbBWZi/5QFnqRTc=; b=hlGFOBeyyl3UmhSnPnlI45YtLmIj+OuLbrBRZp+wu2V5rkh6VkdEJB3Nk2HiRvDIgI wMX8ihlus8q5qlZKRlpPWaxr7tnolxXyHiuWednr7SuCwXV0j4XUtswOkcnaUN4PEkO+ dry0njyDwU5zMexCItRmroL/CJJ4vTvcQjOREOgmvFh+4R+nFZSxxyfcaCIyP+bouBll ZuQD2xhS9DaqzTbRLHzVY26vo7v9MBNoxe/a9W4I6T5NhR0U9fDAezFKIm2faWiaU88C UZARj+DhqyBkxZUjGB0kHyKdcuHs0SstfMGhOtYCZ5cdCIngeiWX/jKgDNlAxKhCWGlL SfTw== X-Forwarded-Encrypted: i=1; AJvYcCXkvlRGIZu6Ro7Xc/H0z+wY7CLHiBkkjtnmx0xCSMmyQP+VLQyCgKcT8qgiwkcb8FhMJi1KAoPlqq8tuiulGx3iF6n+ezVplxIxkfe5 X-Gm-Message-State: AOJu0Yy93sydMr01Wz59EOvLW46B5hc03SeBN4JrBy2yUkvpt/uW2Yr1 sxNsF7V9DDKAHaxyQ7YKpKabK+qtS7Y3ATeFFiwEvrqhxbwo19cspm0RGxzUzKon6ZfemyyXHgx Xtgy+dshqR3s41ZUqHa6lRTPsa1nycBizIks6 X-Received: by 2002:a05:6102:dcd:b0:47a:296c:def with SMTP id e13-20020a0561020dcd00b0047a296c0defmr11930644vst.29.1713261435254; Tue, 16 Apr 2024 02:57:15 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240415-alice-mm-v5-0-6f55e4d8ef51@google.com> <20240415-alice-mm-v5-2-6f55e4d8ef51@google.com> <202404151605.6EFC791E@keescook> In-Reply-To: <202404151605.6EFC791E@keescook> From: Alice Ryhl Date: Tue, 16 Apr 2024 11:57:03 +0200 Message-ID: Subject: Re: [PATCH v5 2/4] uaccess: always export _copy_[from|to]_user with CONFIG_RUST To: Kees Cook Cc: Miguel Ojeda , Matthew Wilcox , Al Viro , Andrew Morton , 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?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Arnd Bergmann , linux-mm@kvack.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Christian Brauner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 16, 2024 at 1:05=E2=80=AFAM Kees Cook w= rote: > > On Mon, Apr 15, 2024 at 07:13:54AM +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 tes= t > > on x86 using the Android cuttlefish emulator. > > > > Signed-off-by: Arnd Bergmann > > Thanks for the updates and the comment on testing. :) > > Reviewed-by: Kees Cook Thanks for taking a look :) Alice