1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Chunwei Chen <david.chen@nutanix.com>
3 Date: Thu, 1 Feb 2018 15:41:05 -0800
4 Subject: [PATCH] Fix zle_decompress out of bound access
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
10 Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
11 Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
13 (cherry picked from commit 5e566c57726226ceeca09b1eb19cb1c373622763)
14 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
16 module/zfs/zle.c | 4 ++++
17 1 file changed, 4 insertions(+)
19 diff --git a/module/zfs/zle.c b/module/zfs/zle.c
20 index 13c5673fb..613607faa 100644
21 --- a/module/zfs/zle.c
22 +++ b/module/zfs/zle.c
23 @@ -74,10 +74,14 @@ zle_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
24 while (src < s_end && dst < d_end) {
27 + if (src + len > s_end || dst + len > d_end)
33 + if (dst + len > d_end)