Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4941b7c6 authored by Terence Ho's avatar Terence Ho
Browse files

msm: camera: validate num_streams in stream_cfg_cmd before using it



stream_cfg_cmd->num_streams is from userspace,
need to check it against MSM_ISP_STATS_MAX before using it.

CRs-Fixed: 2029867
Change-Id: I02a71b983947981806470454654d712bcc732077
Signed-off-by: default avatarTerence Ho <terenceh@codeaurora.org>
parent e539a094
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -850,6 +850,12 @@ int msm_isp_cfg_stats_stream(struct vfe_device *vfe_dev, void *arg)
	if (vfe_dev->stats_data.num_active_stream == 0)
		vfe_dev->hw_info->vfe_ops.stats_ops.cfg_ub(vfe_dev);

	if (stream_cfg_cmd->num_streams > MSM_ISP_STATS_MAX) {
		pr_err("%s invalid num_streams %d\n", __func__,
			stream_cfg_cmd->num_streams);
		return -EINVAL;
	}

	if (stream_cfg_cmd->enable) {
		msm_isp_stats_update_cgc_override(vfe_dev, stream_cfg_cmd);