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

!9453 jffs2: prevent xattr node from overflowing the eraseblock

parents d8358467 fe8a574b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1151,6 +1151,9 @@ int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname,
		return rc;

	request = PAD(sizeof(struct jffs2_raw_xattr) + strlen(xname) + 1 + size);
	if (request > c->sector_size - c->cleanmarker_size)
		return -ERANGE;

	rc = jffs2_reserve_space(c, request, &length,
				 ALLOC_NORMAL, JFFS2_SUMMARY_XATTR_SIZE);
	if (rc) {