Unverified Commit fc1d9b69 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14472 jfs: fix array-index-out-of-bounds in jfs_readdir

parents 0cdb32a7 6a5f73f5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2891,6 +2891,14 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
		stbl = DT_GETSTBL(p);

		for (i = index; i < p->header.nextindex; i++) {
			if (stbl[i] < 0 || stbl[i] > 127) {
				jfs_err("JFS: Invalid stbl[%d] = %d for inode %ld, block = %lld",
					i, stbl[i], (long)ip->i_ino, (long long)bn);
				free_page(dirent_buf);
				DT_PUTPAGE(mp);
				return -EIO;
			}

			d = (struct ldtentry *) & p->slot[stbl[i]];

			if (((long) jfs_dirent + d->namlen + 1) >