ROMFS: romfs_lookup() shouldn't be doing a partial name comparison
romfs_lookup() should be using a routine akin to strcmp() on the backing store, rather than one akin to strncmp(). If it uses the latter, it's liable to match /bin/shutdown when looking up /bin/sh. Signed-off-by: David Howells <dhowells@redhat.com> Tested-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
a5422a5111
commit
84baf74bf2
@@ -43,5 +43,5 @@ extern int romfs_dev_read(struct super_block *sb, unsigned long pos,
|
||||
void *buf, size_t buflen);
|
||||
extern ssize_t romfs_dev_strnlen(struct super_block *sb,
|
||||
unsigned long pos, size_t maxlen);
|
||||
extern int romfs_dev_strncmp(struct super_block *sb, unsigned long pos,
|
||||
const char *str, size_t size);
|
||||
extern int romfs_dev_strcmp(struct super_block *sb, unsigned long pos,
|
||||
const char *str, size_t size);
|
||||
|
Reference in New Issue
Block a user