From patchwork Wed Jan 3 01:50:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 18655 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp4783853dyb; Tue, 2 Jan 2024 17:52:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4nr/v3Jar1JX7MWlnA+60InZ2kS9NGS1PSSfULFv44oUJNIGEdasaqYswwkbAXKfk1D/7 X-Received: by 2002:a50:aad0:0:b0:553:6b20:b707 with SMTP id r16-20020a50aad0000000b005536b20b707mr11600882edc.15.1704246724544; Tue, 02 Jan 2024 17:52:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704246724; cv=none; d=google.com; s=arc-20160816; b=EXeKlC8AXOFdqBgZw7MiSQtMHN7HRFuoP1S3/wLyLjwSbm8Pn/RGWPCqqaMMJ5KmB3 AGyS1QTTxcWiBWMRykHG5NMUkDaRb6o9yyPLnfeeHsNpHQ5VTg25drY3TdznlD0HmA3m 1acEItoBVwGc4CF0hx5l+hJQ1pyfsVhxAjZugxY1Fg/BuVsmvVsAbazLswwxSA8NmN4J e7KECbkoo119xjzSE2W0yE22pV6A+gflK8IOYSAr3pzn49mQT7w5v4at+LrwQjRZhN6G pcG39+vaA77TA/2epAkowMbbHN8ejjN7duWzJPQjsN5EjR2q7zUoD8I0yLdQwYfq0O7N kvlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :from:date:user-agent:message-id; bh=DtqgzqjEHlyyldPtU/9psd7VkYY4zs8R9aFZTyoLZDg=; fh=mTYg3JJ8i2GBNLFt8qb4bgYwOyk0kmrOzICLbi6qJ1c=; b=U6MhKAccasu7o5Gn458oLOnkN3njtumcJjkdscadwOVwkuBINxobfOd9q+ft/yYFOB uLIZoPlMmwQJAQzuRFv1Y0sbumH+dt4b5oNrt1l5YhM4WzTOvq0S0D3AaoH1VZmg1yLq NqGKBMAPJ1K1YJ1oE48a+SVYq03gioCl31OJQZMbR/wg7M9e0i2tdpiEjyblJtMX8cxO JzUw2O1ESgXJ9HmPEGk+9h64Glslu5Mnz7IoJrIFKDhR/VDs7ZLzWSL/hzTCNeyM75A0 /lAg0LeSBr1k7H/UpIZBAkLKK1o3hkL3m7lTxsBGIHx685XU9g5cTuH34iwOl69ZpBrl c86A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15048-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15048-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q9-20020a50aa89000000b0055472e7a4f0si9961821edc.251.2024.01.02.17.52.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 17:52:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15048-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15048-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15048-ouuuleilei=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2DFBD1F2290F for ; Wed, 3 Jan 2024 01:52:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D9BE1119C; Wed, 3 Jan 2024 01:51:28 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 9CFE017981 for ; Wed, 3 Jan 2024 01:51:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AF21C433C8; Wed, 3 Jan 2024 01:51:26 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rKqQm-00000000k5G-1GON; Tue, 02 Jan 2024 20:52:28 -0500 Message-ID: <20240103015043.912131206@goodmis.org> User-Agent: quilt/0.67 Date: Tue, 02 Jan 2024 20:50:43 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-linus][PATCH 0/2] tracing: Two more small fixes for v6.7-rc8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787032213248193287 X-GMAIL-MSGID: 1787032213248193287 tracing fixes for v6.7-rc8: - Fix a NULL kernel dereference in set_gid() on tracefs mounting. When tracefs is mounted with "gid=1000", it will update the existing dentries to have the new gid. The tracefs_inode which is retrieved by a container_of(dentry->d_inode) has flags to see if the inode belongs to the eventfs system. The issue that was fixed was if getdents() was called on tracefs that was previously mounted, and was not closed. It will leave a "cursor dentry" in the subdirs list of the current dentries that set_gid() walks. On a remount of tracefs, the container_of(dentry->d_inode) will dereference a NULL pointer and cause a crash when referenced. Simply have a check for dentry->d_inode to see if it is NULL and if so, skip that entry. - Fix the bits of the eventfs_inode structure. The "is_events" bit was taken from the nr_entries field, but the nr_entries field wasn't updated to be 30 bits and was still 31. Including the "is_freed" bit this would use 33 bits which would make the structure use another integer for just one bit. Steven Rostedt (Google) (2): tracefs: Check for dentry->d_inode exists in set_gid() eventfs: Fix bitwise fields for "is_events" ---- fs/tracefs/inode.c | 4 ++++ fs/tracefs/internal.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)