From: Arun Iyengar data_byte_offset comes from userspace and is only checked against 0; an offset past the slice locked up the SoC. Fail the job in that case. Fixes: 7678c5462680 ("media: cedrus: Fix decoding for some HEVC videos") Cc: stable@vger.kernel.org Signed-off-by: Arun Iyengar --- drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c index f10178106ba6..44539936b550 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c @@ -457,6 +457,9 @@ static int cedrus_h265_setup(struct cedrus_ctx *ctx, struct cedrus_run *run) num_entry_point_offsets != run->h265.entry_points_count) return -ERANGE; + if (slice_params->data_byte_offset > slice_bytes) + return -EINVAL; + log2_max_luma_coding_block_size = sps->log2_min_luma_coding_block_size_minus3 + 3 + sps->log2_diff_max_min_luma_coding_block_size; -- 2.55.0