From 4dea39b253bb57c34249b6a0828d5137fb8fc1a9 Mon Sep 17 00:00:00 2001 From: Seungchul Kim Date: Fri, 23 Mar 2018 17:00:40 +0900 Subject: [PATCH] [COMMON] media: smfc: fix security problem The security problem has been reported in smfc driver. If user sends a special ioctl command, smfc driver can cause a kernel panic. So it is modified to avoid kernel panic. Change-Id: I7b5c4e295e8190cf0fb50d3c4b951a74470101ad Signed-off-by: Seungchul Kim --- drivers/media/platform/exynos/smfc/smfc-v4l2-ioctls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos/smfc/smfc-v4l2-ioctls.c b/drivers/media/platform/exynos/smfc/smfc-v4l2-ioctls.c index 0c4bc5b02ca0..1d1720fd3fb9 100644 --- a/drivers/media/platform/exynos/smfc/smfc-v4l2-ioctls.c +++ b/drivers/media/platform/exynos/smfc/smfc-v4l2-ioctls.c @@ -796,7 +796,11 @@ static bool smfc_v4l2_init_fmt(const struct smfc_ctx *ctx, const struct smfc_image_format *smfc_fmt, __u32 type, struct v4l2_pix_format *pix) { - BUG_ON(V4L2_TYPE_IS_MULTIPLANAR(pix->pixelformat)); + if (V4L2_TYPE_IS_MULTIPLANAR(pix->pixelformat)) { + dev_err(ctx->smfc->dev, + "Multi-planar format is not permitted.\n"); + return false; + } if (!smfc_check_capable_of_decompression(ctx->smfc, smfc_fmt, type)) return false; -- 2.20.1