Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-30 Thread Vivien Didelot
Hi Michal, David, On Thu, 30 May 2019 11:26:30 -0700 (PDT), David Miller wrote: > From: Michal Kubecek > Date: Thu, 30 May 2019 10:27:22 +0200 > > > I believe this should be handled by ethtool_get_regs(), either by > > returning an error or by only copying data up to original regs.len > > pass

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-30 Thread David Miller
From: Michal Kubecek Date: Thu, 30 May 2019 10:27:22 +0200 > I believe this should be handled by ethtool_get_regs(), either by > returning an error or by only copying data up to original regs.len > passed by userspace. The former seems more correct but broken userspace > software would suddenly s

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-30 Thread Michal Kubecek
On Thu, May 30, 2019 at 08:48:48AM +0200, Michal Kubecek wrote: > On Wed, May 29, 2019 at 10:17:44PM -0700, David Miller wrote: > > From: Vivien Didelot > > Date: Tue, 28 May 2019 16:58:48 -0400 > > > > > ethtool_get_regs() allocates a buffer of size reglen obtained from > > > ops->get_regs_len()

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-29 Thread Michal Kubecek
On Wed, May 29, 2019 at 10:17:44PM -0700, David Miller wrote: > From: Vivien Didelot > Date: Tue, 28 May 2019 16:58:48 -0400 > > > ethtool_get_regs() allocates a buffer of size reglen obtained from > > ops->get_regs_len(), thus only this value must be used when copying > > the buffer back to user

Re: [PATCH net-next] ethtool: copy reglen to userspace

2019-05-29 Thread David Miller
From: Vivien Didelot Date: Tue, 28 May 2019 16:58:48 -0400 > ethtool_get_regs() allocates a buffer of size reglen obtained from > ops->get_regs_len(), thus only this value must be used when copying > the buffer back to userspace. Also no need to check regbuf twice. > > Signed-off-by: Vivien Dide

[PATCH net-next] ethtool: copy reglen to userspace

2019-05-28 Thread Vivien Didelot
ethtool_get_regs() allocates a buffer of size reglen obtained from ops->get_regs_len(), thus only this value must be used when copying the buffer back to userspace. Also no need to check regbuf twice. Signed-off-by: Vivien Didelot --- net/core/ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1