Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Eric Dumazet
On Tue, 2016-08-23 at 14:41 +0100, Luis Henriques wrote: > From: Avijit Kanti Das > > memset() the structure ethtool_wolinfo that has padded bytes > but the padded bytes have not been zeroed out. > > Change-Id: If3fd2d872a1b1ab9521d937b86a29fc468a8bbfe > Signed-off-by: Avijit Kanti Das > --- >

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Ben Hutchings
On Tue, 2016-08-23 at 07:21 -0700, Eric Dumazet wrote: > On Tue, 2016-08-23 at 14:41 +0100, Luis Henriques wrote: > > > > > > From: Avijit Kanti Das > > > > memset() the structure ethtool_wolinfo that has padded bytes > > but the padded bytes have not been zeroed out. > > > > Change-Id: If3fd2d

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Vegard Nossum
On 23 August 2016 at 17:05, Joe Perches wrote: > On Tue, 2016-08-23 at 07:21 -0700, Eric Dumazet wrote: >> On Tue, 2016-08-23 at 14:41 +0100, Luis Henriques wrote: >> > From: Avijit Kanti Das >> > >> > memset() the structure ethtool_wolinfo that has padded bytes >> > but the padded bytes have not

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Edward Cree
On 23/08/16 16:36, Eric Dumazet wrote: > On Tue, 2016-08-23 at 08:05 -0700, Joe Perches wrote: > >> A compiler does not have a standards based requirement to >> initialize arbitrary padding bytes. >> >> I believe gcc always does zero all padding anyway. > Even if the current standards are lazy (are

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Andrey Ryabinin
2016-08-23 18:36 GMT+03:00 Eric Dumazet : > On Tue, 2016-08-23 at 08:05 -0700, Joe Perches wrote: > >> A compiler does not have a standards based requirement to >> initialize arbitrary padding bytes. >> >> I believe gcc always does zero all padding anyway. > > I would not worry for kernel code, bec

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Joe Perches
On Tue, 2016-08-23 at 19:27 +0400, Loganaden Velvindron wrote: > Better be safe than sorry. Better still would be to create a tool via something like coccinelle that could be run on the entire kernel than submit a single patch for a construct that likely occurs dozens of times in the kernel source

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Eric Dumazet
On Tue, 2016-08-23 at 08:05 -0700, Joe Perches wrote: > A compiler does not have a standards based requirement to > initialize arbitrary padding bytes. > > I believe gcc always does zero all padding anyway. I would not worry for kernel code, because the amount of scrutiny there will be enough to

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Joe Perches
On Tue, 2016-08-23 at 07:21 -0700, Eric Dumazet wrote: > On Tue, 2016-08-23 at 14:41 +0100, Luis Henriques wrote: > > From: Avijit Kanti Das > > > > memset() the structure ethtool_wolinfo that has padded bytes > > but the padded bytes have not been zeroed out. [] > > diff --git a/net/core/ethtool

Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol()

2016-08-23 Thread Joe Perches
On Tue, 2016-08-23 at 14:41 +0100, Luis Henriques wrote: > From: Avijit Kanti Das > > memset() the structure ethtool_wolinfo that has padded bytes > but the padded bytes have not been zeroed out. I expect there are more of these in the kernel tree. While this patch is strictly true and the beha