Skip to content

Commit 0706526

Browse files
Avadhut Naikrafaeljw
authored andcommitted
platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo
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>
1 parent 71cd3c6 commit 0706526

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/chrome/cros_ec_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static int cros_ec_create_panicinfo(struct cros_ec_debugfs *debug_info)
454454
debug_info->panicinfo_blob.data = data;
455455
debug_info->panicinfo_blob.size = ret;
456456

457-
debugfs_create_blob("panicinfo", S_IFREG | 0444, debug_info->dir,
457+
debugfs_create_blob("panicinfo", 0444, debug_info->dir,
458458
&debug_info->panicinfo_blob);
459459

460460
return 0;

0 commit comments

Comments
 (0)