[PATCH] jffs2: add additinal sanity check for jffs2_acl_from_medium()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the case ACL_USER and ACL_GROUP we check if value has exceeded end,
add same check in the case ACL_OTHER as well.

Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
---
 fs/jffs2/acl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 093ffbd82395..fce32de3a18f 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -94,6 +94,8 @@ static struct posix_acl *jffs2_acl_from_medium(void *value, size_t size)
 			case ACL_MASK:
 			case ACL_OTHER:
 				value += sizeof(struct jffs2_acl_entry_short);
+				if (value > end)
+					goto fail;
 				break;
 
 			case ACL_USER:
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux