From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: mchehab@kernel.org
Cc: linux-media@vger.kernel.org
Subject: [PATCH 2/4] staging: atomisp: Fix atomisp_overlay32 compat handling
Date: Thu, 4 Jun 2020 19:16:19 +0300 [thread overview]
Message-ID: <20200604161621.9282-3-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20200604161621.9282-1-sakari.ailus@linux.intel.com>
The struct atomisp_overlay contains overlay_start_x and overlay_start_y
fields. Instead of copying the value of the overlay_start_x field between
the two structs, the value of the overlay_start_y field of the compat
struct was copied to the overlay_start_x field of the 64-bit kernel struct
in get operation and back in put. The overlay_start_x field value was not
copied from or to the user space struct.
Fix this so that the value of overlay_start_x is copied to overlay_start_x
and the value of overlay_start_y is copied to overlay_start_y.
Also do copy blend_overlay_perc_u field only once.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c b/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
index 3079043f1fac0..1853d907260db 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
@@ -399,7 +399,8 @@ static int get_atomisp_overlay32(struct atomisp_overlay *kp,
get_user(kp->blend_overlay_perc_u, &up->blend_overlay_perc_u) ||
get_user(kp->blend_overlay_perc_v, &up->blend_overlay_perc_v) ||
get_user(kp->blend_overlay_perc_u, &up->blend_overlay_perc_u) ||
- get_user(kp->overlay_start_x, &up->overlay_start_y))
+ get_user(kp->overlay_start_x, &up->overlay_start_x) ||
+ get_user(kp->overlay_start_y, &up->overlay_start_y))
return -EFAULT;
kp->frame = (void __force *)compat_ptr(frame);
@@ -423,7 +424,8 @@ static int put_atomisp_overlay32(struct atomisp_overlay *kp,
put_user(kp->blend_overlay_perc_u, &up->blend_overlay_perc_u) ||
put_user(kp->blend_overlay_perc_v, &up->blend_overlay_perc_v) ||
put_user(kp->blend_overlay_perc_u, &up->blend_overlay_perc_u) ||
- put_user(kp->overlay_start_x, &up->overlay_start_y))
+ put_user(kp->overlay_start_x, &up->overlay_start_x)
+ put_user(kp->overlay_start_y, &up->overlay_start_y))
return -EFAULT;
return 0;
--
2.20.1
next prev parent reply other threads:[~2020-06-04 16:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 16:16 [PATCH 0/4] atomisp set_fs() fix Sakari Ailus
2020-06-04 16:16 ` [PATCH 1/4] staging: atomisp: There's no struct atomisp_dvs2_coefficients Sakari Ailus
2020-06-04 16:16 ` Sakari Ailus [this message]
2020-06-04 16:16 ` [PATCH 3/4] staging: atomisp: Fix compat IOCTL handling Sakari Ailus
2020-06-04 16:16 ` [PATCH 4/4] staging: atomisp: Check return value from compat_alloc_user_space Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200604161621.9282-3-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.