Chrome platform driver development
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.10 3/8] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo
       [not found] <20240116001457.214018-1-sashal@kernel.org>
@ 2024-01-16  0:14 ` Sasha Levin
  2024-01-16 20:45   ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2024-01-16  0:14 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Avadhut Naik, Greg Kroah-Hartman, Tony Luck, Rafael J . Wysocki,
	Sasha Levin, bleung, tzungbi, chrome-platform

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 0dbceee87a4b..e2940d3b69c3 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -427,7 +427,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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH AUTOSEL 5.10 3/8] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo
  2024-01-16  0:14 ` [PATCH AUTOSEL 5.10 3/8] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo Sasha Levin
@ 2024-01-16 20:45   ` Pavel Machek
  2024-01-30 21:05     ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2024-01-16 20:45 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Avadhut Naik, Greg Kroah-Hartman, Tony Luck,
	Rafael J . Wysocki, bleung, tzungbi, chrome-platform

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

Hi!

> 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().

This needs previous patch to make sense (according to changelog), and
we don't have that. Please drop.

BR,
								Pavel

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH AUTOSEL 5.10 3/8] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo
  2024-01-16 20:45   ` Pavel Machek
@ 2024-01-30 21:05     ` Sasha Levin
  0 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2024-01-30 21:05 UTC (permalink / raw)
  To: Pavel Machek
  Cc: linux-kernel, stable, Avadhut Naik, Greg Kroah-Hartman, Tony Luck,
	Rafael J . Wysocki, bleung, tzungbi, chrome-platform

On Tue, Jan 16, 2024 at 09:45:12PM +0100, Pavel Machek wrote:
>Hi!
>
>> 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().
>
>This needs previous patch to make sense (according to changelog), and
>we don't have that. Please drop.

Dropped, thanks!

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-30 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240116001457.214018-1-sashal@kernel.org>
2024-01-16  0:14 ` [PATCH AUTOSEL 5.10 3/8] platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo Sasha Levin
2024-01-16 20:45   ` Pavel Machek
2024-01-30 21:05     ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox