lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFE535E@AcuExch.aculab.com> Date: Thu, 4 May 2017 09:31:20 +0000 From: David Laight <David.Laight@...LAB.COM> To: 'Gavin Shan' <gwshan@...ux.vnet.ibm.com>, Stephen Hemminger <stephen@...workplumber.org> CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "joe@...ches.com" <joe@...ches.com>, "kubakici@...pl" <kubakici@...pl>, "f.fainelli@...il.com" <f.fainelli@...il.com>, "davem@...emloft.net" <davem@...emloft.net> Subject: RE: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology From: Gavin Shan > Sent: 04 May 2017 07:16 > On Wed, May 03, 2017 at 10:19:44PM -0700, Stephen Hemminger wrote: > >On Wed, 3 May 2017 14:44:35 +1000 > >Gavin Shan <gwshan@...ux.vnet.ibm.com> wrote: ... > >> +{ > >> + struct ethtool_ncsi_channels *enc; > >> + short nr_channels; > >Should be __u16 or unsigned not short. > > > > Nope, It's for signed number. User expects to get number of available > channels when negative number is passed in. When it's positive, it's > going to get the channels' information. Why 16 bits? You are just making life hard for the compiler and possibly generating random padding. I guess the user is expected to pass -1 first to get the number of channels, then allocate an appropriate sized array and call again specifying the number of channels? What happens if the number of channels changes between the two requests? I'd also suggest passing the size of each entry (in at least one direction). That way additional channel information can be added. David
Powered by blists - more mailing lists