From mboxrd@z Thu Jan 1 00:00:00 1970 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 7AC4B63B3; Sat, 10 Feb 2024 06:20:24 +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=1707546025; cv=none; b=YI4kEDaeNWZkc1LrVB/p1zknib4It8ThckoCQY3L1NXyvDABrSYIFiwDcADlO/h87StQ5S4XOJTO9QBVD0LQ0v6t5nrq6FFxIrKXYBnh8X7IXIW42st8IRqPda/saeVqMzbrMnBappVAc1OGxTo5aqhqxALi1uVgPzbUnqUgStk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707546025; c=relaxed/simple; bh=1Ze5VEPfD5vhZYQmXIpz7v4I8v5CLbO0cbP1JVjlVA0=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=UraO47bpwTOS6Kc7qAvdLyXkIDF+4N3Aei5485mlcmuv8Zi5QkDHqSl1uOVLCzL2vEMxbckqfpK/FIA4D69fGlGV2bJ18mrlGfcMPs00BN77pPdWTCAOpLeyYAgRDb34rLxCcj92WRstT6eSi5Zbfqt/XHdUYZ8X7d8+VGq/Jn0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HYuse41w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HYuse41w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D013AC433F1; Sat, 10 Feb 2024 06:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707546023; bh=1Ze5VEPfD5vhZYQmXIpz7v4I8v5CLbO0cbP1JVjlVA0=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=HYuse41w6uCewE/PnPkzXazcAz/wThGf7m58t9dGnuRqD5IQSZFVa/6/5P4IC5WKP uJu84TY6zqt/spjV+HwipurymdhpvxxEQyvDyCwnSy1QrdCPijt16SVUYT94wOrHJ+ 1YsFpEj6FnCul09I37BeSLq/oShjwS2XONlU+1oBLrRzwPnCdd5FiA9wHrkr6j1+xf TbWaSFvDH5GhO9zbuuYo6yrlosdF4jwT2JJEzekHsIiLm3fSJ4SGl7CLZbwZJhtven jvHNQJxurXTP90WREQ9DQbJ4+dSnZWDQizOZNtmQY0suTWReVo3IzJMSTEdMakfQNj +j4aBPXwORtXA== Date: Fri, 09 Feb 2024 22:20:22 -0800 From: Kees Cook To: Alice Ryhl , Greg Kroah-Hartman CC: Trevor Gross , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?ISO-8859-1?Q?Bj=F6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Kees Cook , Al Viro , Andrew Morton , =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= , 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 Subject: Re: [PATCH 1/3] rust: add userspace pointers User-Agent: K-9 Mail for Android In-Reply-To: References: <20240124-alice-mm-v1-0-d1abcec83c44@google.com> <20240124-alice-mm-v1-1-d1abcec83c44@google.com> <2024020859-lusty-ladylike-29d4@gregkh> Message-ID: <9FD5FF49-6C8D-4073-9CE5-EA19C607FAD2@kernel.org> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On February 8, 2024 7:41:52 AM PST, Alice Ryhl wr= ote: >On Thu, Feb 8, 2024 at 4:35=E2=80=AFPM Greg Kroah-Hartman > wrote: >> >> On Thu, Feb 08, 2024 at 01:53:20PM +0100, Alice Ryhl wrote: >> > > Is some sort of `Debug` implementation useful? >> > >> > Leaking pointer addresses in logs is frowned upon in the kernel, so I >> > don't think we should include that=2E >> >> s/frowned upon/forbidden/ :) > >:) > >> Along those lines, you all are tieing in the "I want to print a pointer= , >> so hash it properly before I do so" logic from rust like we have in c, >> right? Ideally you'd use the same logic if at all possible=2E >> >> If not, that probably needs to be done so that you don't accidentally >> start leaking things=2E > >I don't know what the status of this is=2E For anything I've added, I've >just made it entirely impossible to print addresses, hashed or not=2E Thank you! That is certainly the preferred[1] approach=2E :) -Kees [1] https://www=2Ekernel=2Eorg/doc/html/next/process/deprecated=2Ehtml#p-f= ormat-specifier --=20 Kees Cook