• Matt Fleming's avatar
    efivarfs: guid part of filenames are case-insensitive · da27a243
    Matt Fleming authored
    It makes no sense to treat the following filenames as unique,
    
    	VarName-abcdefab-abcd-abcd-abcd-abcdefabcdef
    	VarName-ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF
    	VarName-ABcDEfAB-ABcD-ABcD-ABcD-ABcDEfABcDEf
    	VarName-aBcDEfAB-aBcD-aBcD-aBcD-aBcDEfaBcDEf
    	... etc ...
    
    since the guid will be converted into a binary representation, which
    has no case.
    
    Roll our own dentry operations so that we can treat the variable name
    part of filenames ("VarName" in the above example) as case-sensitive,
    but the guid portion as case-insensitive. That way, efivarfs will
    refuse to create the above files if any one already exists.
    Reported-by: default avatarLingzhu Xiang <lxiang@redhat.com>
    Cc: Matthew Garrett <mjg59@srcf.ucam.org>
    Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
    da27a243
efivars.c 48.1 KB