Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1820132rbb; Tue, 27 Feb 2024 02:05:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUe/ErAe8p/dRRAr2yWssTy8L9/6ghzK/lyoWzXyoos50X6BV/dbv4RzD88kHeTN00KMbW6jx4GL0uocWfk3yhlAoniaikQ5owWHpuFqg== X-Google-Smtp-Source: AGHT+IF7s1PF5AA1xW2yueggYgskOserXN0/tollT3yB8+vj+XFFaPmxPwQqErETx7pg73nUaIE4 X-Received: by 2002:a17:90b:3641:b0:29a:c89a:bcdb with SMTP id nh1-20020a17090b364100b0029ac89abcdbmr3892112pjb.46.1709028351999; Tue, 27 Feb 2024 02:05:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709028351; cv=pass; d=google.com; s=arc-20160816; b=AuKLP+BRGmeiKhR+i5da2/2znfusc64yU5jq+3SmINmkLmNxQFPpsp9OeuMGNazk2f SJubo84yscwH/oJfx+7OlowYnbcRrwd2oM2jXejpjjFrCgbhKs0kdSlqOQms+9nFRCK6 bSyvjuPlXkzpi80KmSPW1O1LVg8u2AnBtOGWT22eMDJAxxmJ7+oi9wRWHjjYshTXd8Hm iVYJs9Mw4CEOCKCP8jQs/ffhoDirQvgpJjVeuxyYji1g1ASf9uXsfjEqHitDsknpOfnt gNYKz0kdZj0upWjTgH20/1edsCwQSEx/QDyBqKprUt1D7wHjjEq+jUkjdAa+uab1HeQz RJaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=3XXrMIze6Y72f4u2ysv6nK5J2tUBv4eD6P0fxLLqnrU=; fh=eY+GE4inwJV574IgqhshM928wRdY0pIGqdyP1uJTadg=; b=xtCAMMz0M1wJO/uyvQUcWUu5wuouOruAGj0p2j5E/TnesMlzcktuQq3FXsP+ZtXCXL 0ShY5U3LY/rMqtVYeJe9o++KIR4V+sKI0OkiE1+OSPedIAVikh+ek2RuO1khNOdd8mSb e/3jgI7QfBsnfI15eUG44AYce+P91WS1YCqsKk4xZ4AaZ6Qp3j2Rrhu0RQRCkZEOhPo4 F7+akeuY8XEg3c1aczOKOVdPH1BWS3qJjBgYHNesc2uQ8DlUV22rB8a+F5bazuEqb/qN 3i3N8t/MqrAKqiqE9GbxxR1Hbnh3ikm/jUWNR6iq0D0lV0+uBLAxSQTxPjZLCxeoRf1y jDew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="soi8/goX"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="soi8/goX"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=oqhTd1iM; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-83004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id qn15-20020a17090b3d4f00b002997c936f30si5325839pjb.113.2024.02.27.02.05.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 02:05:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="soi8/goX"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="soi8/goX"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=oqhTd1iM; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-83004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8158C28425C for ; Tue, 27 Feb 2024 10:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C5A0137C52; Tue, 27 Feb 2024 10:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="soi8/goX"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="oqhTd1iM"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="soi8/goX"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="oqhTd1iM" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 05D22137C2D; Tue, 27 Feb 2024 10:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709028332; cv=none; b=ScFa1hF1s7DwMmUxlPkR238mPep3x6nCsZ58mmqan5Wczj2ypYlb4wQWUpyXG+ckzy5DQFWiuPEAusrvu0YT82S/Bv7g1Dqu4woK+Db0T256QmixAXL/WY+OCr1JJfycXrVvv/tvywIyeLEBYx05aKcVhVmhOrRrq9FRqIJY2Ls= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709028332; c=relaxed/simple; bh=qTKCh/UYun8MIHt+3k9VcP0gbTE3xP+PfI30BTgmONg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KzPKw0nKLDvS/hkVIoTW0KQoYzOBXSybv3oxrSzeuOZXYF9pbH9oKoyyBOw0AFest8oA8OMf1tOR+1BXOzSi5gmg6ysaqDxIQvZVmqXuH3JoIRcZSvdDmmLlU+iW8lyVx/7eCLdhVH5mHXZxD+ltKUVUE/hPj0lnvcOFpbGOyvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=soi8/goX; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=oqhTd1iM; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=soi8/goX; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=oqhTd1iM; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2853E226E8; Tue, 27 Feb 2024 10:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709028329; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3XXrMIze6Y72f4u2ysv6nK5J2tUBv4eD6P0fxLLqnrU=; b=soi8/goXCUpmlv19LLto6jAlcz8JoEvm1nZpGgqTSTtPbqneegXav+HzwbxK++hleQ9qCj 3k6rRD9ScpgXGEc76aF2PnpvxqqgNu3BOaYXNc7mqXUOKGqmHaQMHFCC9KBlog2uVCvWC3 /QfGbsbvbpNxNVi4ztfU9W6hGk0OshM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709028329; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3XXrMIze6Y72f4u2ysv6nK5J2tUBv4eD6P0fxLLqnrU=; b=oqhTd1iMyjfXSwqjHSZv10e9xCjuScPkIxVR+BErjIYgTHsvgvdHni1yXcYrAS6McMvw+h JC4OhYkBuLdaFZAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709028329; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3XXrMIze6Y72f4u2ysv6nK5J2tUBv4eD6P0fxLLqnrU=; b=soi8/goXCUpmlv19LLto6jAlcz8JoEvm1nZpGgqTSTtPbqneegXav+HzwbxK++hleQ9qCj 3k6rRD9ScpgXGEc76aF2PnpvxqqgNu3BOaYXNc7mqXUOKGqmHaQMHFCC9KBlog2uVCvWC3 /QfGbsbvbpNxNVi4ztfU9W6hGk0OshM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709028329; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3XXrMIze6Y72f4u2ysv6nK5J2tUBv4eD6P0fxLLqnrU=; b=oqhTd1iMyjfXSwqjHSZv10e9xCjuScPkIxVR+BErjIYgTHsvgvdHni1yXcYrAS6McMvw+h JC4OhYkBuLdaFZAA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 9943913216; Tue, 27 Feb 2024 10:05:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id OsmhHeez3WWzOgAAn2gu4w (envelope-from ); Tue, 27 Feb 2024 10:05:27 +0000 Message-ID: Date: Tue, 27 Feb 2024 11:05:22 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/4] rust: uaccess: add userspace pointers Content-Language: en-US To: Alice Ryhl Cc: Greg Kroah-Hartman , =?UTF-8?Q?Arve_Hj=C3=B8nnev=C3=A5g?= , 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 , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Kees Cook , Al Viro , Andrew Morton References: <20240208-alice-mm-v2-0-d821250204a6@google.com> <20240208-alice-mm-v2-1-d821250204a6@google.com> From: =?UTF-8?Q?Carlos_L=C3=B3pez?= In-Reply-To: <20240208-alice-mm-v2-1-d821250204a6@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -1.29 X-Spamd-Result: default: False [-1.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,protonmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROM(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLx931z8whuiu5x894fnbjwz7n)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; BAYES_HAM(-1.50)[91.72%]; RCPT_COUNT_TWELVE(0.00)[24]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[linuxfoundation.org,android.com,joelfernandes.org,google.com,arndb.de,kvack.org,vger.kernel.org,kernel.org,gmail.com,garyguo.net,protonmail.com,proton.me,samsung.com,chromium.org,zeniv.linux.org.uk,linux-foundation.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Flag: NO On 8/2/24 16:47, Alice Ryhl wrote: > + /// Create a reader that can access the same range of data. > + /// > + /// Reading from the clone does not advance the current reader. > + /// > + /// The caller should take care to not introduce TOCTOU issues, as described > + /// in the documentation for [`UserSlice`]. > + pub fn clone_reader(&self) -> UserSliceReader { > + UserSliceReader { > + ptr: self.ptr, > + length: self.length, > + } > + } Just out of curiosity, is there any reason why this is not implemented in terms of the Clone trait? -- Carlos López Security Engineer SUSE Software Solutions