Skip to content

Commit 304790c

Browse files
ubifs: Relax checks in ubifs_validate_entry()
With encrypted filenames we store raw binary data, doing string tests is no longer possible. Signed-off-by: Richard Weinberger <[email protected]>
1 parent 7799953 commit 304790c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ubifs/replay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ int ubifs_validate_entry(struct ubifs_info *c,
456456
if (le32_to_cpu(dent->ch.len) != nlen + UBIFS_DENT_NODE_SZ + 1 ||
457457
dent->type >= UBIFS_ITYPES_CNT ||
458458
nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 ||
459-
strnlen(dent->name, nlen) != nlen ||
459+
(key_type == UBIFS_XENT_KEY && strnlen(dent->name, nlen) != nlen) ||
460460
le64_to_cpu(dent->inum) > MAX_INUM) {
461461
ubifs_err(c, "bad %s node", key_type == UBIFS_DENT_KEY ?
462462
"directory entry" : "extended attribute entry");

0 commit comments

Comments
 (0)