Some more problems kicked up by fuzz testing:
* Further verification of chunk tags.
* If loading details for root dir or lost+found then don't change the
* variant type since we know they are directories.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
} else if (tags.objectId > YAFFS_MAX_OBJECT_ID ||
tags.chunkId > YAFFS_MAX_CHUNK_ID ||
} else if (tags.objectId > YAFFS_MAX_OBJECT_ID ||
tags.chunkId > YAFFS_MAX_CHUNK_ID ||
- (tags.chunkId > 0 && tags.byteCount > dev->nDataBytesPerChunk)) {
+ (tags.chunkId > 0 && tags.byteCount > dev->nDataBytesPerChunk) ||
+ tags.sequenceNumber != bi->sequenceNumber ) {
T(YAFFS_TRACE_SCAN,
(TSTR("Chunk (%d:%d) with bad tags:obj = %d, chunkId = %d, byteCount = %d, ignored"TENDSTR),
blk, c,tags.objectId, tags.chunkId, tags.byteCount));
T(YAFFS_TRACE_SCAN,
(TSTR("Chunk (%d:%d) with bad tags:obj = %d, chunkId = %d, byteCount = %d, ignored"TENDSTR),
blk, c,tags.objectId, tags.chunkId, tags.byteCount));
- in->variantType = oh->type;
in->yst_mode = oh->yst_mode;
#ifdef CONFIG_YAFFS_WINCE
in->yst_mode = oh->yst_mode;
#ifdef CONFIG_YAFFS_WINCE
in->yst_ctime = oh->yst_ctime;
in->yst_rdev = oh->yst_rdev;
in->yst_ctime = oh->yst_ctime;
in->yst_rdev = oh->yst_rdev;
- } else {
- in->variantType = tags.extraObjectType;