Lines 332-341
Link Here
|
332 |
} |
332 |
} |
333 |
|
333 |
|
334 |
static inline int |
334 |
static inline int |
335 |
do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm) |
335 |
_do_unimap_ioctl(int cmd, int con, struct unimapdesc *user_ud,int perm) |
336 |
{ |
336 |
{ |
337 |
struct unimapdesc tmp; |
337 |
struct unimapdesc tmp; |
338 |
int i = 0; |
338 |
int i = 0; |
|
|
339 |
|
340 |
if (!vc_cons_allocated(con)) /* impossible? */ |
341 |
return -ENOIOCTLCMD; |
339 |
|
342 |
|
340 |
if (copy_from_user(&tmp, user_ud, sizeof tmp)) |
343 |
if (copy_from_user(&tmp, user_ud, sizeof tmp)) |
341 |
return -EFAULT; |
344 |
return -EFAULT; |
Lines 348-360
Link Here
|
348 |
case PIO_UNIMAP: |
351 |
case PIO_UNIMAP: |
349 |
if (!perm) |
352 |
if (!perm) |
350 |
return -EPERM; |
353 |
return -EPERM; |
351 |
return con_set_unimap(fg_console, tmp.entry_ct, tmp.entries); |
354 |
return con_set_unimap(con, tmp.entry_ct, tmp.entries); |
352 |
case GIO_UNIMAP: |
355 |
case GIO_UNIMAP: |
353 |
return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); |
356 |
return con_get_unimap(con, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries); |
354 |
} |
357 |
} |
355 |
return 0; |
358 |
return 0; |
356 |
} |
359 |
} |
357 |
|
360 |
|
|
|
361 |
static inline int |
362 |
do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm) |
363 |
{ |
364 |
return _do_unimap_ioctl(cmd, fg_console, user_ud, perm); |
365 |
} |
366 |
|
358 |
/* |
367 |
/* |
359 |
* We handle the console-specific ioctl's here. We allow the |
368 |
* We handle the console-specific ioctl's here. We allow the |
360 |
* capability to modify any console, not just the fg_console. |
369 |
* capability to modify any console, not just the fg_console. |
Lines 972-978
Link Here
|
972 |
|
981 |
|
973 |
case PIO_UNIMAP: |
982 |
case PIO_UNIMAP: |
974 |
case GIO_UNIMAP: |
983 |
case GIO_UNIMAP: |
975 |
return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm); |
984 |
return _do_unimap_ioctl(cmd, console, (struct unimapdesc *)arg, perm); |
976 |
|
985 |
|
977 |
case VT_LOCKSWITCH: |
986 |
case VT_LOCKSWITCH: |
978 |
if (!capable(CAP_SYS_TTY_CONFIG)) |
987 |
if (!capable(CAP_SYS_TTY_CONFIG)) |