diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 07:30:32 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-28 07:30:32 +0100 |
commit | 085686fb8491a7cbf6a7260d5b9d4169a041c340 (patch) | |
tree | 6b35dea52e658376f67d0a4e0cb511e0589602ea /fs/btrfs/lzo.c | |
parent | 2be483f12ea34b43826f70c60f0924a7bda991bd (diff) | |
parent | 7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 (diff) | |
download | linux-085686fb8491a7cbf6a7260d5b9d4169a041c340.tar.bz2 |
Merge 5.17-rc6 into char-misc-next
We need the char-misc fixes in here.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs/lzo.c')
-rw-r--r-- | fs/btrfs/lzo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index 0fb90cbe7669..e6e28a9c7987 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -380,6 +380,17 @@ int lzo_decompress_bio(struct list_head *ws, struct compressed_bio *cb) kunmap(cur_page); cur_in += LZO_LEN; + if (seg_len > lzo1x_worst_compress(PAGE_SIZE)) { + /* + * seg_len shouldn't be larger than we have allocated + * for workspace->cbuf + */ + btrfs_err(fs_info, "unexpectedly large lzo segment len %u", + seg_len); + ret = -EIO; + goto out; + } + /* Copy the compressed segment payload into workspace */ copy_compressed_segment(cb, workspace->cbuf, seg_len, &cur_in); |