From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-bc0d.mail.infomaniak.ch (smtp-bc0d.mail.infomaniak.ch [45.157.188.13]) (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 5A6912178FF; Fri, 11 Oct 2024 12:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.157.188.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728650843; cv=none; b=TsCAQi554JcVKX237VQaTcVZz7bZDrH5Wmj5AxRD6XIiRBzR/ZiTjaILRHteG6mF5iz4SBsu6kwujit/tG+xmiXZDFF2sqUW2d78NgJxteY5mCpYuCtug9vg48Nq3hchbg9R1NerFToCGORqdY2Alca+x3mEPy1PVATAxhfWAes= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728650843; c=relaxed/simple; bh=Ssj50jhLa6QTaxxQAPUc0/csO1mGN9hS2lCU62Fjl34=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=si6+h85BhDx+RVAtoloHyUEEkK0cPEjKFeo/x/59BQH8zRXWScBFQba9oUoYlV4QV5+zzAy95Fl2QzlM213S7jpbJLUWY7AIOSosd4ENPTS6LZiP112wi2j6YOHd9QY19vfJNR5edq+UePm7k1fxNIvWT+sPCO5ee5/YSSM3C84= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=FzoYcd5l; arc=none smtp.client-ip=45.157.188.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="FzoYcd5l" Received: from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch [10.7.10.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4XQ5xL1Zn9zmd6; Fri, 11 Oct 2024 14:47:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digikod.net; s=20191114; t=1728650838; bh=mUqoHhS7jRHHrLnQ2C+m0/2kYey48fPAy6v5oOk7vrE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FzoYcd5lONxYRZH38zsyGdlP6o2g+tIeo9OaCQPGSPNtSo6aBOrNYhwXqVs8Z4C/G 3UmZ93Lj8H8V947n/8+ZgXmpQ/fi1Zvr505F7cLp2rTv8+nWGmGxAg0tHzOEyetzem TuCagL29HYvAbWFeeg862LwYBgR4v4QswK2UTI9o= Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4XQ5xK4v5hzkK3; Fri, 11 Oct 2024 14:47:17 +0200 (CEST) Date: Fri, 11 Oct 2024 14:47:14 +0200 From: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= To: Christoph Hellwig Cc: Christian Brauner , Paul Moore , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-security-module@vger.kernel.org, audit@vger.kernel.org, Trond Myklebust , Anna Schumaker , Alexander Viro , Jan Kara Subject: Re: [RFC PATCH v1 1/7] fs: Add inode_get_ino() and implement get_ino() for NFS Message-ID: <20241011.ieghie3Aiye4@digikod.net> References: <20241010152649.849254-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Infomaniak-Routing: alpha On Fri, Oct 11, 2024 at 05:30:12AM -0700, Christoph Hellwig wrote: > On Thu, Oct 10, 2024 at 05:26:41PM +0200, Mickaël Salaün wrote: > > When a filesystem manages its own inode numbers, like NFS's fileid shown > > to user space with getattr(), other part of the kernel may still expose > > the private inode->ino through kernel logs and audit. > > > > Another issue is on 32-bit architectures, on which ino_t is 32 bits, > > whereas the user space's view of an inode number can still be 64 bits. > > > > Add a new inode_get_ino() helper calling the new struct > > inode_operations' get_ino() when set, to get the user space's view of an > > inode number. inode_get_ino() is called by generic_fillattr(). > > > > Implement get_ino() for NFS. > > The proper interface for that is ->getattr, and you should use that for > all file systems (through the proper vfs wrappers). How to get the inode number with ->getattr and only a struct inode? > > And yes, it's really time to move to a 64-bit i_ino, but that's a > separate discussion.