Re: [PATCH net] ethtool: fix potential userspace buffer overflow

2019-06-03 Thread Michal Kubecek
On Mon, Jun 03, 2019 at 01:42:19PM -0400, Vivien Didelot wrote: > Hi Michal, > > On Mon, 3 Jun 2019 19:15:12 +0200, Michal Kubecek wrote: > > On Fri, May 31, 2019 at 07:12:21PM -0400, Vivien Didelot wrote: > > > ethtool_get_regs() allocates a buffer of size ops->get_regs_len(), > > > and pass it

Re: [PATCH net] ethtool: fix potential userspace buffer overflow

2019-06-03 Thread Vivien Didelot
Hi Michal, On Mon, 3 Jun 2019 19:15:12 +0200, Michal Kubecek wrote: > On Fri, May 31, 2019 at 07:12:21PM -0400, Vivien Didelot wrote: > > ethtool_get_regs() allocates a buffer of size ops->get_regs_len(), > > and pass it to the kernel driver via ops->get_regs() for filling. > > > > There is no r

Re: [PATCH net] ethtool: fix potential userspace buffer overflow

2019-06-03 Thread Michal Kubecek
On Fri, May 31, 2019 at 07:12:21PM -0400, Vivien Didelot wrote: > ethtool_get_regs() allocates a buffer of size ops->get_regs_len(), > and pass it to the kernel driver via ops->get_regs() for filling. > > There is no restriction about what the kernel drivers can or cannot do > with the open ethtoo

[PATCH net] ethtool: fix potential userspace buffer overflow

2019-05-31 Thread Vivien Didelot
ethtool_get_regs() allocates a buffer of size ops->get_regs_len(), and pass it to the kernel driver via ops->get_regs() for filling. There is no restriction about what the kernel drivers can or cannot do with the open ethtool_regs structure. They usually set regs->version and ignore regs->len or s