Commit 29973f8a authored by Fuqian Huang's avatar Fuqian Huang Committed by Greg Kroah-Hartman

tty: rocket: Remove RCPK_GET_STRUCT ioctl

If the cmd is RCPK_GET_STRUCT, copy_to_user will copy
info to user space. As info->port.ops is the address of
a constant object rocket_port_ops (assigned in init_r_port),
a kernel address leakage happens.

Remove the RCPK_GET_STRUCT ioctl.
Signed-off-by: default avatarFuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8daa89e0
...@@ -1283,10 +1283,6 @@ static int rp_ioctl(struct tty_struct *tty, ...@@ -1283,10 +1283,6 @@ static int rp_ioctl(struct tty_struct *tty,
return -ENXIO; return -ENXIO;
switch (cmd) { switch (cmd) {
case RCKP_GET_STRUCT:
if (copy_to_user(argp, info, sizeof (struct r_port)))
ret = -EFAULT;
break;
case RCKP_GET_CONFIG: case RCKP_GET_CONFIG:
ret = get_config(info, argp); ret = get_config(info, argp);
break; break;
......
...@@ -71,7 +71,6 @@ struct rocket_version { ...@@ -71,7 +71,6 @@ struct rocket_version {
/* /*
* Rocketport ioctls -- "RP" * Rocketport ioctls -- "RP"
*/ */
#define RCKP_GET_STRUCT 0x00525001
#define RCKP_GET_CONFIG 0x00525002 #define RCKP_GET_CONFIG 0x00525002
#define RCKP_SET_CONFIG 0x00525003 #define RCKP_SET_CONFIG 0x00525003
#define RCKP_GET_PORTS 0x00525004 #define RCKP_GET_PORTS 0x00525004
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment