public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Avadhut Naik <avadhut.naik@amd.com>
To: <rafael@kernel.org>, <gregkh@linuxfoundation.org>,
	<lenb@kernel.org>, <linux-acpi@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>
Cc: <yazen.ghannam@amd.com>, <alexey.kardashevskiy@amd.com>,
	<linux-kernel@vger.kernel.org>, <avadnaik@amd.com>
Subject: [PATCH v4 3/4] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo
Date: Wed, 21 Jun 2023 03:51:01 +0000	[thread overview]
Message-ID: <20230621035102.13463-4-avadhut.naik@amd.com> (raw)
In-Reply-To: <20230621035102.13463-1-avadhut.naik@amd.com>

From: Avadhut Naik <Avadhut.Naik@amd.com>

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.

As such, rectify the permissions of panicinfo file to ensure it remains
read-only.

Signed-off-by: Avadhut Naik <Avadhut.Naik@amd.com>
---
 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 c876120e0ebc..4428dcbd2a68 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -454,7 +454,7 @@ static int cros_ec_create_panicinfo(struct cros_ec_debugfs *debug_info)
 	debug_info->panicinfo_blob.data = 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.34.1


  parent reply	other threads:[~2023-06-21  3:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21  3:50 [PATCH v4 0/4] Add support for Vendor Defined Error Types in Einj Module Avadhut Naik
2023-06-21  3:50 ` [PATCH v4 1/4] ACPI: APEI: EINJ: Refactor available_error_type_show() Avadhut Naik
2023-06-21  3:51 ` [PATCH v4 2/4] fs: debugfs: Add write functionality to debugfs blobs Avadhut Naik
2023-06-23  8:09   ` Greg KH
2023-06-21  3:51 ` Avadhut Naik [this message]
2023-06-23  8:09   ` [PATCH v4 3/4] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo Greg KH
2023-06-21  3:51 ` [PATCH v4 4/4] ACPI: APEI: EINJ: Add support for vendor defined error types Avadhut Naik
2023-08-11  5:18 ` [PATCH v4 0/4] Add support for Vendor Defined Error Types in Einj Module Avadhut Naik

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=20230621035102.13463-4-avadhut.naik@amd.com \
    --to=avadhut.naik@amd.com \
    --cc=alexey.kardashevskiy@amd.com \
    --cc=avadnaik@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox