[PATCH 1/3] efivarfs: fix error on non-existent file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



efivarfs returns -EINVAL if the non-existing file .doesn't conform to
the NAME-GUID format and -ENOENT if it does.  This is caused by
efivars_d_hash returning -EINVAL if the name isn't formatted
correctly.  This error is returned before simple_lookup returns a
negative dentry and is what the user sees.  Fix by removing this
check.  If the file doesn't exist, simple_lookup will return a
negative dentry leading to -ENOENT and efivarfs_create already has a
validity check before it creates an entry (and will correctly return
-EINVAL)

Signed-off-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
---
 fs/efivarfs/super.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index a929f1b613be..beba15673be8 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -144,9 +144,6 @@ static int efivarfs_d_hash(const struct dentry *dentry, struct qstr *qstr)
 	const unsigned char *s = qstr->name;
 	unsigned int len = qstr->len;
 
-	if (!efivarfs_valid_name(s, len))
-		return -EINVAL;
-
 	while (len-- > EFI_VARIABLE_GUID_LEN)
 		hash = partial_name_hash(*s++, hash);
 
-- 
2.35.3





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux