From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Avadhut Naik <Avadhut.Naik@amd.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tony Luck <tony.luck@intel.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Sasha Levin <sashal@kernel.org>,
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 [thread overview]
Message-ID: <20240116001514.214199-3-sashal@kernel.org> (raw)
In-Reply-To: <20240116001514.214199-1-sashal@kernel.org>
From: Avadhut Naik <Avadhut.Naik@amd.com>
[ 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 <Avadhut.Naik@amd.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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
next prev parent reply other threads:[~2024-01-16 0:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 0:15 [PATCH AUTOSEL 5.4 1/7] regulator: core: Only increment use_count when enable_count changes Sasha Levin
2024-01-16 0:15 ` [PATCH AUTOSEL 5.4 2/7] audit: Send netlink ACK before setting connection in auditd_set Sasha Levin
2024-01-16 0:15 ` Sasha Levin [this message]
2024-01-16 0:15 ` [PATCH AUTOSEL 5.4 4/7] ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop Sasha Levin
2024-01-16 0:15 ` [PATCH AUTOSEL 5.4 5/7] PNP: ACPI: fix fortify warning Sasha Levin
2024-01-16 0:15 ` [PATCH AUTOSEL 5.4 6/7] ACPI: extlog: fix NULL pointer dereference check Sasha Levin
2024-01-16 0:15 ` [PATCH AUTOSEL 5.4 7/7] selftests/nolibc: use EFI -bios for LoongArch qemu Sasha Levin
2024-01-16 10:50 ` Masahiro Yamada
2024-01-16 11:29 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240116001514.214199-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Avadhut.Naik@amd.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=tzungbi@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.