efivars: allow efi pstore variable when validate filename
PATCH 1/1 efivars: allow efi pstore variable when validate filename
We mount efivarfs fail after pstore generated 'dump-type*' variables and reboot.
This issue introduced by commit 47f531e8ba3bc3901a0c493f4252826c41dea1a1 (efivarfs: Validate filenames much more aggressively)
The pstore variable is 'dump-type*-*-*-*-GUID'style, it could not pass the "GUID should be right after the first '-'" check. This patch allow the variable name that has 'dump-type' pass the name check.
--- drivers/firmware/efivars.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/firmware/efivars.c +1 -1
@@ -930,7 +930,7 @@ static bool efivarfs_valid_name(const char *str, int len)return false;/* GUID should be right after the first '-' */ -if (s -1 !=strchr (str,'-' )) +if (s -1 !=strchr (str,'-' ) && !strstarts (str,"dump-type" ))return false;/*
Signature · 1 line
1.6.4.2
Hi Matt,
Sorry for I didn't aware your 123abd76edf patch fixed issue. Please ignore my patch.
Thanks a lot!
Joey Lee
於 二,2013-03-12 於 03:00 +0800,Lee, Chun-Yi 提到:
Quoted 33 lines
We mount efivarfs fail after pstore generated 'dump-type*' variables and reboot.
This issue introduced by commit
47f531e8ba3bc3901a0c493f4252826c41dea1a1(efivarfs: Validate filenames much more aggressively)The pstore variable is 'dump-type*-*-*-*-GUID'style, it could not pass the "GUID should be right after the first '-'" check. This patch allow the variable name that has 'dump-type' pass the name check.
Cc Matt Fleming <[email protected]>Cc Seiji Aguchi <[email protected]>Cc Matthew Garrett <[email protected]>Cc Al Viro <viro-RmSDqhL/[email protected]>Cc Lingzhu Xiang <[email protected]>Signed-off-by Lee, Chun-Yi <jlee-IBi9RG/[email protected]>--- drivers/firmware/efivars.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/firmware/efivars.c +1
-1@@ -930,7 +930,7 @@ static bool efivarfs_valid_name(const char *str, int len)return false;/* GUID should be right after the first '-' */ -if (s -1 !=strchr (str,'-' )) +if (s -1 !=strchr (str,'-' ) && !strstarts (str,"dump-type" ))return false;/*