Skip to content

Commit d8bad91

Browse files
Dan Carpenterbzolnier
authored andcommitted
fbdev: sbuslib: use checked version of put_user()
I'm not sure why the code assumes that only the first put_user() needs an access_ok() check. I have made all the put_user() and get_user() calls checked. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Philippe Ombredanne <pombredanne@nexb.com> Cc: Mathieu Malaterre <malat@debian.org> Cc: Peter Malone <peter.malone@gmail.com>, Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
1 parent 5c63e40 commit d8bad91

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/video/fbdev/sbuslib.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
106106
struct fbtype __user *f = (struct fbtype __user *) arg;
107107

108108
if (put_user(type, &f->fb_type) ||
109-
__put_user(info->var.yres, &f->fb_height) ||
110-
__put_user(info->var.xres, &f->fb_width) ||
111-
__put_user(fb_depth, &f->fb_depth) ||
112-
__put_user(0, &f->fb_cmsize) ||
113-
__put_user(fb_size, &f->fb_cmsize))
109+
put_user(info->var.yres, &f->fb_height) ||
110+
put_user(info->var.xres, &f->fb_width) ||
111+
put_user(fb_depth, &f->fb_depth) ||
112+
put_user(0, &f->fb_cmsize) ||
113+
put_user(fb_size, &f->fb_cmsize))
114114
return -EFAULT;
115115
return 0;
116116
}
@@ -125,10 +125,10 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
125125
unsigned int index, count, i;
126126

127127
if (get_user(index, &c->index) ||
128-
__get_user(count, &c->count) ||
129-
__get_user(ured, &c->red) ||
130-
__get_user(ugreen, &c->green) ||
131-
__get_user(ublue, &c->blue))
128+
get_user(count, &c->count) ||
129+
get_user(ured, &c->red) ||
130+
get_user(ugreen, &c->green) ||
131+
get_user(ublue, &c->blue))
132132
return -EFAULT;
133133

134134
cmap.len = 1;
@@ -165,10 +165,10 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
165165
u8 red, green, blue;
166166

167167
if (get_user(index, &c->index) ||
168-
__get_user(count, &c->count) ||
169-
__get_user(ured, &c->red) ||
170-
__get_user(ugreen, &c->green) ||
171-
__get_user(ublue, &c->blue))
168+
get_user(count, &c->count) ||
169+
get_user(ured, &c->red) ||
170+
get_user(ugreen, &c->green) ||
171+
get_user(ublue, &c->blue))
172172
return -EFAULT;
173173

174174
if (index + count > cmap->len)

0 commit comments

Comments
 (0)