[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABXRUiSUzuf+Ki1Pj9oUkgZC0ELkA4N1aZpwBrZ7Gu3nyGwPMQ@mail.gmail.com>
Date:   Sat, 30 Mar 2019 15:05:11 +0800
From:   Fuqian Huang <huangfq.daxian@...il.com>
To:     gregkh@...uxfoundation.org, jslaby@...e.com,
        linux-kernel@...r.kernel.org
Subject: a kernel address leak via copy_to_user in drivers/tty/rocket.c
Hi, recently I found that there is a kernel address leaks to user
space via copy_to_user in
drivers/tty/rocket.c:1287 (linux-5.0.5)
static int rp_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned
long arg) {
  ...
  case RCKP_GET_STRUCT:
      if (copy_to_user(argp, info, sizeof(struct r_port))
  ...
}
The `info` is a struct r_port. and the field `r_port.port.ops` is an
constant pointer,
and it points to a constant object `rocket_port_ops` during the initialization.
(function init_r_port) (drivers/tty/rocket.c:633)
patch suggestion:
set the pointer field to null before the copy to user call.
Powered by blists - more mailing lists
 
