Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp113090rdb; Thu, 25 Jan 2024 09:40:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFv2PYyQ26gA9xsfBqDL9iJyRbZpvIo4+RGm3cJKAFCC/JT4vqZnFW1Njwc8QKR7GIryPPu X-Received: by 2002:a05:6a20:741f:b0:19c:6a7a:2df0 with SMTP id n31-20020a056a20741f00b0019c6a7a2df0mr2997pzd.66.1706204444919; Thu, 25 Jan 2024 09:40:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706204444; cv=pass; d=google.com; s=arc-20160816; b=G7LkPlViiEVjiK6Fni/YW+6jeNAV4okDVsJegELu71BiFWx0iPQgasQhcSGOC0Bi1h bvURzAdk1yDWJFN4MaKO1h4uNn8UdaTZCmu6zu6DVEeKut1UDj56knANcmp4mOwzbdLG dVPBiglTrjVV3tvNEBtZCOVLT9O3qcPLANxZaCD57t0ypCeD5sJEAeRqlPDDqdDdguCX syBgWvbYw4k/USlVl0vc/q9oiQlb74HfMR86eVzR0FNppbsnyC2VAiZYQRWFlsVqxIi4 +4miP9a42gl04jK4ssb0oy0GFi9bDhZHmRJPvlnhaKJPcR2iimOvNZoeuhZdULUyMAtb fAPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7HDQmuOSdcdU+f79ptdgiMslrCzhUNv+O+0TSQ9EtyY=; fh=YDQTXy5xjsUNagq/16KciCbNWPtg4Qm32xPwHYODB4g=; b=Vj6m8QjGlKJG62Wzc2wqBtCD3zKZTLbQpVnEruqdiXdthN8diXjBlBPW7f7P1pvrFo AfqwNWveXY0ol5668+25yHUT0Rjn+I8hDZQSpWjch7LyiLi8LHWDmv0e/0QsgQQJ0O9N /f53Hvj3Xv7ah4rtfF09/CwMsiEcnDB5a23B2q2Hb5O/AFhk12zaKy2K4IP4mPXwjMCN 7rm4RBfhR4pSYxA980UWnBVSH+kH0//ETjXv2vf8PKVGLWUroBdqE8Js8XsK8tTNcZmd ULrgqDs0i9T4CbF0kXurD4AFHt0a83cyF4h0MPaa69vC540acIGpjUBCvWxhko86p+Z9 dbpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KeMsgi/f"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39046-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x185-20020a6363c2000000b005d674a9a40fsi1331210pgb.507.2024.01.25.09.40.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 09:40:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39046-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="KeMsgi/f"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39046-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8BA922901E7 for ; Thu, 25 Jan 2024 17:40:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81D37131754; Thu, 25 Jan 2024 17:40:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KeMsgi/f" 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 A4A7863407 for ; Thu, 25 Jan 2024 17:40:37 +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=1706204437; cv=none; b=SYE98bEpyZAx+6VAWs5sIUbSyojBfOkBOafOWRpCuRCalNeMKg9+4vtKB4SpFAGOR+59GPOFiovQI9RMFXZhx78nvHaqBYLFGwuK/HDL3AJOe0oruz3TpMY2qHmZqBYXhkZd9khIQXHAnI2Kf7XMMjG3JS48XowXRkCCMtZH5IQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706204437; c=relaxed/simple; bh=MNsS8xhfLazNPkpX0xDXLMjg/ydZvJAqYMw5ftV2uSM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G8sDqih58w7Z1wLXay6XAKRl4HfExVT9Cl972JCsL/wrikAubqMKexbaijtLlgrvXsN3NMkdq37i9BkDCxSdB2MYYWDjwDDaXa1RRDdhz7V38HEZ6Mi2sXhegTzF0my9i4T3SeE7eU7lMp3pzuupb6L2xEx07OrKJLyZqnRSY3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KeMsgi/f; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A11FC433F1; Thu, 25 Jan 2024 17:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706204437; bh=MNsS8xhfLazNPkpX0xDXLMjg/ydZvJAqYMw5ftV2uSM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KeMsgi/fsn+w9Ztk5dm9VbbHMnLx9G3J+Ld5oYHV0F67UqoiS1wKZAATmkd6ayspb lJyJs0G6+0VNjAWJjmXx5J2nkSLdTnVJmQqAfbu3RYINzqmp0QielOsF46KuJx5DiT fBEKvPXmX10NkOHUNvNNTpCcpsw1eTqvIXzfx/79Rczz2DszK38CI9U3v5e8kw0xMp 1/ciGqxZKKNLXfdReP4mCeWNtplEniMDBI1wQXaIBBjsUhkQ/FjvYP5OkrLHF7Or7i BsiD9k2CBDneKbFEzgXLj7xq4OGzg02soYRVLWI9grIEbZ6rbixGun/BEnZbxSiqXv 0WAgS5tL4Bzlg== Date: Thu, 25 Jan 2024 18:40:31 +0100 From: Christian Brauner To: Steven Rostedt Cc: Linus Torvalds , Geert Uytterhoeven , Kees Cook , linux-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Al Viro , Ajay Kaher Subject: Re: [for-linus][PATCH 1/3] eventfs: Have the inodes all for files and directories all be the same Message-ID: <20240125-deportation-sogenannten-2d57a7ce8f81@brauner> References: <20240117143548.595884070@goodmis.org> <20240117143810.531966508@goodmis.org> <20240122100630.6a400dd3@gandalf.local.home> <20240122114743.7e46b7cb@gandalf.local.home> <20240122144443.0f9cf5b9@gandalf.local.home> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240122144443.0f9cf5b9@gandalf.local.home> On Mon, Jan 22, 2024 at 02:44:43PM -0500, Steven Rostedt wrote: > On Mon, 22 Jan 2024 10:19:12 -0800 > Linus Torvalds wrote: > > > On Mon, 22 Jan 2024 at 09:39, Linus Torvalds > > wrote: > > > > > > Actually, why not juist add an inode number to your data structures, > > > at least for directories? And just do a static increment on it as they > > > get registered? > > > > > > That avoids the whole issue with possibly leaking kernel address data. > > > > The 'nlink = 1' thing doesn't seem to make 'find' any happier for this > > case, sadly. > > > > But the inode number in the 'struct eventfs_inode' looks trivial. And > > doesn't even grow that structure on 64-bit architectures at least, > > because the struct is already 64-bit aligned, and had only one 32-bit > > entry at the end. > > > > On 32-bit architectures the structure size grows, but I'm not sure the > > allocation size grows. Our kmalloc() is quantized at odd numbers. > > > > IOW, this trivial patch seems to be much safer than worrying about > > some pointer exposure. > > I originally wanted to avoid the addition of the 4 bytes, but your comment > about it not making a difference on 64bit due to alignment makes sense. Non-unique inode numbers aren't exactly great for userspace and there are a surprisingly small yet large enough number of tools that trip over this in various ways. So if that can be avoided then great. But luckily no one is probably going to tar up tracefs. ;)