]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ubifs: Relax checks in ubifs_validate_entry()
authorRichard Weinberger <richard@nod.at>
Tue, 4 Oct 2016 20:38:33 +0000 (22:38 +0200)
committerRichard Weinberger <richard@nod.at>
Mon, 12 Dec 2016 22:07:38 +0000 (23:07 +0100)
With encrypted filenames we store raw binary data, doing
string tests is no longer possible.

Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/replay.c

index fb0f44cd1e28f8afd37314fe9da98bf06978baff..026e853d31a79ecbd5d80bbf900395990a720b82 100644 (file)
@@ -456,7 +456,7 @@ int ubifs_validate_entry(struct ubifs_info *c,
        if (le32_to_cpu(dent->ch.len) != nlen + UBIFS_DENT_NODE_SZ + 1 ||
            dent->type >= UBIFS_ITYPES_CNT ||
            nlen > UBIFS_MAX_NLEN || dent->name[nlen] != 0 ||
-           strnlen(dent->name, nlen) != nlen ||
+           (key_type == UBIFS_XENT_KEY && strnlen(dent->name, nlen) != nlen) ||
            le64_to_cpu(dent->inum) > MAX_INUM) {
                ubifs_err(c, "bad %s node", key_type == UBIFS_DENT_KEY ?
                          "directory entry" : "extended attribute entry");