[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170714224009.2537mysgwab272xp@caviumnetworks.com>
Date: Fri, 14 Jul 2017 15:40:09 -0700
From: "Burla, Satananda" <Satananda.Burla@...ium.com>
To: "Chickles, Derek" <Derek.Chickles@...ium.com>,
"Manlunas, Felix" <Felix.Manlunas@...ium.com>
Cc: "arnd@...db.de" <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Chickles, Derek" <Derek.Chickles@...ium.com>,
"Manlunas, Felix" <Felix.Manlunas@...ium.com>,
"Vatsavayi, Raghu" <Raghu.Vatsavayi@...ium.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"linux@...ck-us.net" <linux@...ck-us.net>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"Chang, Weilin" <Weilin.Chang@...ium.com>,
"Kanneganti, Prasad" <Prasad.Kanneganti@...ium.com>
Subject: Re: [PATCH 13/22] liquidio: fix possible eeprom format string
overflow
The 07/14/2017 09:04, David Miller wrote:
> From: Arnd Bergmann <arnd@...db.de>
> Date: Fri, 14 Jul 2017 14:07:05 +0200
>
> > gcc reports that the temporary buffer for computing the
> > string length may be too small here:
> >
> > drivers/net/ethernet/cavium/liquidio/lio_ethtool.c: In function
> 'lio_get_eeprom_len':
> > /drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:345:21: error: 'sprintf'
> may write a terminating nul past the end of the destination [-Werror=
> format-overflow=]
> > len = sprintf(buf, "boardname:%s serialnum:%s maj:%lld min:%lld\n",
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:345:6: note: 'sprintf'
> output between 35 and 167 bytes into a destination of size 128
> > len = sprintf(buf, "boardname:%s serialnum:%s maj:%lld min:%lld\n",
> >
> > This extends it to 192 bytes, which is certainly enough. As far
> > as I could tell, there are no other constraints that require a specific
> > maximum size.
> >
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
>
> Applied.
I had raised a bug for this earlier and attached a patch as well.
http://cabugzilla1.caveonetworks.com/octeon_bugzilla/show_bug.cgi?id=26421
--
Regards
Satanand
Powered by blists - more mailing lists