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 412FB151CCC; Tue, 20 Feb 2024 21:36:19 +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=1708464979; cv=none; b=rOJNxoie6AL3s3LTd/kbcfX6NwMRioGQaqMgdp+ir3+FscWXhVhh2nnA454ec25iOv8XS82apuV67HgL6OGZlbQOXmfB5Ut05N6cCiln6K9TYBOFHrimiVL68yBkdTW+JvNfFut5yjuR45Ups2o+zDJ+x7Djz4HFWy/opW7uI+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708464979; c=relaxed/simple; bh=xnFE1rDL5sFjN0oEXsKyoYcN0s9MQcPSFCveAJrC4XA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HdPcLdHn+6ruol/lqX89QDfNWgyJCTapVkhrBCeIrf6OqdPxm/OH1irmHZ4emtILvhUyJVSxgLCuBTUZe8uvb6JtAYLBzQN6rwkHoGmQkIUVFnLgBVUqMXeqCrC+WmSNLh6GnhGgXXSVGcZYc1YPG7DDAK4hGkI+KyLtCp59eVw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VgXDTC0p; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VgXDTC0p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA91BC433F1; Tue, 20 Feb 2024 21:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708464979; bh=xnFE1rDL5sFjN0oEXsKyoYcN0s9MQcPSFCveAJrC4XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VgXDTC0pTNKUO+Ex6iR5l0x2z7TMj2iSatkvgS0N82Nz7z7pvC4W/A47zLdQvzo0g 13ksJROja2GZnaS+iqvXyKPhLDLAEKnwHUub62KnsIucZfiGQobCNacF0Y4Ms2S9CP pGDNYcmf/vQUlCARX1WShHK9kJKRkxlw5tPgsqBg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Christian Brauner , Al Viro , Ajay Kaher , kernel test robot , Linus Torvalds , "Steven Rostedt (Google)" Subject: [PATCH 6.7 190/309] eventfs: Initialize the tracefs inode properly Date: Tue, 20 Feb 2024 21:55:49 +0100 Message-ID: <20240220205639.109418964@linuxfoundation.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240220205633.096363225@linuxfoundation.org> References: <20240220205633.096363225@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Torvalds commit 4fa4b010b83fb2f837b5ef79e38072a79e96e4f1 upstream. The tracefs-specific fields in the inode were not initialized before the inode was exposed to others through the dentry with 'd_instantiate()'. Move the field initializations up to before the d_instantiate. Link: https://lore.kernel.org/linux-trace-kernel/20240131185512.478449628@goodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Christian Brauner Cc: Al Viro Cc: Ajay Kaher Cc: Greg Kroah-Hartman Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202401291043.e62e89dc-oliver.sang@intel.com Signed-off-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- fs/tracefs/event_inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -370,6 +370,8 @@ static struct dentry *create_dir(struct ti = get_tracefs(inode); ti->flags |= TRACEFS_EVENT_INODE; + /* Only directories have ti->private set to an ei, not files */ + ti->private = ei; inc_nlink(inode); d_instantiate(dentry, inode); @@ -515,7 +517,6 @@ create_file_dentry(struct eventfs_inode static void eventfs_post_create_dir(struct eventfs_inode *ei) { struct eventfs_inode *ei_child; - struct tracefs_inode *ti; lockdep_assert_held(&eventfs_mutex); @@ -525,9 +526,6 @@ static void eventfs_post_create_dir(stru srcu_read_lock_held(&eventfs_srcu)) { ei_child->d_parent = ei->dentry; } - - ti = get_tracefs(ei->dentry->d_inode); - ti->private = ei; } /**