Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933649AbcJUM5K (ORCPT ); Fri, 21 Oct 2016 08:57:10 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:46004 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933230AbcJUMtT (ORCPT ); Fri, 21 Oct 2016 08:49:19 -0400 From: Richard Weinberger To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, dedekind1@gmail.com, adrian.hunter@intel.com, tytso@mit.edu, jaegeuk@kernel.org, david@sigma-star.at, wd@denx.de, sbabic@denx.de, dengler@linutronix.de, Richard Weinberger Subject: [PATCH 16/26] ubifs: Relax checks in ubifs_validate_entry() Date: Fri, 21 Oct 2016 14:48:31 +0200 Message-Id: <1477054121-10198-17-git-send-email-richard@nod.at> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1477054121-10198-1-git-send-email-richard@nod.at> References: <1477054121-10198-1-git-send-email-richard@nod.at> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 880 Lines: 23 With encrypted filenames we store raw binary data, doing string tests is no longer possible. Signed-off-by: Richard Weinberger --- fs/ubifs/replay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 3ca4540130b5..f02adc49425b 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"); -- 2.7.3