summaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-10-04 22:38:33 +0200
committerRichard Weinberger <richard@nod.at>2016-12-12 23:07:38 +0100
commit304790c038bc4af4f19774705409db27eafb09fc (patch)
treee1b6ea9c0a61bef84979f3f9b18eee19ac3ade8b /fs/ubifs
parent7799953b34d1838b30e3d69fd36aa3288ac1e89d (diff)
downloadop-kernel-dev-304790c038bc4af4f19774705409db27eafb09fc.zip
op-kernel-dev-304790c038bc4af4f19774705409db27eafb09fc.tar.gz
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 <richard@nod.at>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/replay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index fb0f44c..026e853 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -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");
OpenPOWER on IntegriCloud