mirror of
https://github.com/commaai/agnos-kernel-sdm845.git
synced 2026-06-08 11:24:51 +08:00
Merge "msm: camera: Fix arbitrary kernel write"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
bca5c15c77
@@ -575,15 +575,13 @@ static long msm_buf_mngr_subdev_ioctl(struct v4l2_subdev *sd,
|
||||
k_ioctl = *ptr;
|
||||
switch (k_ioctl.id) {
|
||||
case MSM_CAMERA_BUF_MNGR_IOCTL_ID_GET_BUF_BY_IDX: {
|
||||
struct msm_buf_mngr_info buf_info, *tmp = NULL;
|
||||
|
||||
if (k_ioctl.size != sizeof(struct msm_buf_mngr_info))
|
||||
return -EINVAL;
|
||||
if (!k_ioctl.ioctl_ptr)
|
||||
return -EINVAL;
|
||||
#ifndef CONFIG_COMPAT
|
||||
{
|
||||
struct msm_buf_mngr_info buf_info, *tmp = NULL;
|
||||
|
||||
if (!is_compat_task()) {
|
||||
MSM_CAM_GET_IOCTL_ARG_PTR(&tmp,
|
||||
&k_ioctl.ioctl_ptr, sizeof(tmp));
|
||||
if (copy_from_user(&buf_info, tmp,
|
||||
@@ -592,7 +590,7 @@ static long msm_buf_mngr_subdev_ioctl(struct v4l2_subdev *sd,
|
||||
}
|
||||
k_ioctl.ioctl_ptr = (uintptr_t)&buf_info;
|
||||
}
|
||||
#endif
|
||||
|
||||
argp = &k_ioctl;
|
||||
rc = msm_cam_buf_mgr_ops(cmd, argp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user