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 1717B2561C; Tue, 16 Jan 2024 00:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fITZekWB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BC70C43390; Tue, 16 Jan 2024 00:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705364119; bh=/nNOHKcpMm14k74pMv/TTcUpawMzNsdAKGcr6vAaNHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fITZekWB3GABD19H3+kCyA4kwcgIJySmybDEJTltb07V9x9pbQXKq+JJ48VJlx8vj IXZMcIh5N/znR41PyXMAxQti2X3nlDdUhesg7/LkBglZU5q9W0hPke3FFVXzbAqHeU loCNOlkiKiP3dq6HNuXxfEWS6T6NtP/YGP+ZkcXwjpKtc+A1fcjVUmuKzRbjh/DiJW wFAco4pXqVOop6ISritegug5BGM5io4MvSwRsdecwz8ZBVTXLAdGDmiap6kiYkmB0z R6yd8DHSL8F/8j9A3GtzXw/ogsr157Cnt0ecMmMMIINgIU8tii8GhrB/8I/HmyKoPO yWJlNLeWkE+Pg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Avadhut Naik , Greg Kroah-Hartman , Tony Luck , "Rafael J . Wysocki" , Sasha Levin , bleung@chromium.org, tzungbi@kernel.org, chrome-platform@lists.linux.dev Subject: [PATCH AUTOSEL 5.4 3/7] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo Date: Mon, 15 Jan 2024 19:15:08 -0500 Message-ID: <20240116001514.214199-3-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116001514.214199-1-sashal@kernel.org> References: <20240116001514.214199-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.267 Content-Transfer-Encoding: 8bit From: Avadhut Naik [ Upstream commit 0706526ec7704dcd046239078ac175d11a88a95e ] The debugfs_create_blob() function has been used to create read-only binary blobs in debugfs. The function filters out permissions, other than S_IRUSR, S_IRGRP and S_IROTH, provided while creating the blobs. The very behavior though is being changed through previous patch in the series (fs: debugfs: Add write functionality to debugfs blobs) which makes the binary blobs writable by owners. Thus, all permissions provided while creating the blobs, except S_IRUSR,S_IWUSR, S_IRGRP, S_IROTH, will be filtered by debugfs_create_blob(). As such, rectify the permissions of panicinfo file since the S_IFREG flag was anyways being filtered out by debugfs_create_blob(). Moreover, the very flag will always be set be set for the panicinfo file through __debugfs_create_file(). Signed-off-by: Avadhut Naik Reviewed-by: Greg Kroah-Hartman Reviewed-by: Tony Luck Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/platform/chrome/cros_ec_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c index c4b57e1df192..b45235b0d777 100644 --- a/drivers/platform/chrome/cros_ec_debugfs.c +++ b/drivers/platform/chrome/cros_ec_debugfs.c @@ -409,7 +409,7 @@ static int cros_ec_create_panicinfo(struct cros_ec_debugfs *debug_info) debug_info->panicinfo_blob.data = msg->data; debug_info->panicinfo_blob.size = ret; - debugfs_create_blob("panicinfo", S_IFREG | 0444, debug_info->dir, + debugfs_create_blob("panicinfo", 0444, debug_info->dir, &debug_info->panicinfo_blob); return 0; -- 2.43.0