All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Burla, Satananda" <Satananda.Burla@cavium.com>
To: "Chickles, Derek" <Derek.Chickles@cavium.com>,
	"Manlunas, Felix" <Felix.Manlunas@cavium.com>
Cc: "arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Chickles, Derek" <Derek.Chickles@cavium.com>,
	"Manlunas, Felix" <Felix.Manlunas@cavium.com>,
	"Vatsavayi, Raghu" <Raghu.Vatsavayi@cavium.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"Chang, Weilin" <Weilin.Chang@cavium.com>,
	"Kanneganti, Prasad" <Prasad.Kanneganti@cavium.com>
Subject: Re: [PATCH 13/22] liquidio: fix possible eeprom format string overflow
Date: Fri, 14 Jul 2017 15:40:09 -0700	[thread overview]
Message-ID: <20170714224009.2537mysgwab272xp@caviumnetworks.com> (raw)
In-Reply-To: <20170714.090408.1884235496293241466.davem@davemloft.net>

The 07/14/2017 09:04, David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.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

WARNING: multiple messages have this Message-ID (diff)
From: "Burla, Satananda" <Satananda.Burla@cavium.com>
To: "Chickles, Derek" <Derek.Chickles@cavium.com>,
	"Manlunas, Felix" <Felix.Manlunas@cavium.com>
Cc: "arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Chickles, Derek" <Derek.Chickles@cavium.com>,
	"Manlunas, Felix" <Felix.Manlunas@cavium.com>,
	"Vatsavayi, Raghu" <Raghu.Vatsavayi@cavium.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"Chang, Weilin" <Weilin.Chang@cavium.com>, "Kanneganti,
Subject: Re: [PATCH 13/22] liquidio: fix possible eeprom format string overflow
Date: Fri, 14 Jul 2017 15:40:09 -0700	[thread overview]
Message-ID: <20170714224009.2537mysgwab272xp@caviumnetworks.com> (raw)
In-Reply-To: <20170714.090408.1884235496293241466.davem@davemloft.net>

The 07/14/2017 09:04, David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.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

WARNING: multiple messages have this Message-ID (diff)
From: "Burla, Satananda" <Satananda.Burla@cavium.com>
Cc: "arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Chickles, Derek" <Derek.Chickles@cavium.com>,
	"Manlunas, Felix" <Felix.Manlunas@cavium.com>,
	"Vatsavayi, Raghu" <Raghu.Vatsavayi@cavium.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"Chang, Weilin" <Weilin.Chang@cavium.com>, Kanneganti,
Subject: Re: [PATCH 13/22] liquidio: fix possible eeprom format string overflow
Date: Fri, 14 Jul 2017 15:40:09 -0700	[thread overview]
Message-ID: <20170714224009.2537mysgwab272xp@caviumnetworks.com> (raw)
In-Reply-To: <20170714.090408.1884235496293241466.davem@davemloft.net>

The 07/14/2017 09:04, David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.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

  reply	other threads:[~2017-07-14 22:40 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 12:06 [PATCH 00/22] gcc-7 -Wformat-* warnings Arnd Bergmann
2017-07-14 12:06 ` [PATCH 01/22] kbuild: disable -Wformat-truncation warnings by default Arnd Bergmann
2017-07-14 12:06 ` [PATCH 02/22] scsi: megaraid: fix format-overflow warning Arnd Bergmann
2017-07-14 12:06 ` [PATCH 03/22] scsi: mpt3sas: fix format overflow warning Arnd Bergmann
2017-07-14 12:06   ` Arnd Bergmann
2017-07-14 12:06 ` [PATCH 04/22] scsi: fusion: fix string " Arnd Bergmann
2017-07-14 12:06   ` Arnd Bergmann
2017-07-17  9:17   ` David Laight
2017-07-17  9:17     ` David Laight
2017-07-17 12:00     ` Arnd Bergmann
2017-07-17 12:00       ` Arnd Bergmann
2017-07-17 12:00       ` Arnd Bergmann
2017-07-14 12:06 ` [PATCH 05/22] scsi: gdth: avoid buffer " Arnd Bergmann
2017-07-14 12:06 ` [PATCH 06/22] scsi: fnic: fix format string " Arnd Bergmann
2017-07-14 12:06 ` [PATCH 07/22] scsi: gdth: increase the procfs event buffer size Arnd Bergmann
2017-07-14 12:07 ` [PATCH 08/22] isdn: divert: fix sprintf buffer overflow warning Arnd Bergmann
2017-07-14 16:03   ` David Miller
2017-07-14 12:07 ` [PATCH 09/22] net: niu: fix format string overflow warning: Arnd Bergmann
2017-07-14 16:03   ` David Miller
2017-07-14 12:07 ` [PATCH 10/22] bnx2x: fix format overflow warning Arnd Bergmann
2017-07-14 16:03   ` David Miller
2017-07-14 12:07 ` [PATCH 11/22] net: thunder_bgx: avoid format string " Arnd Bergmann
2017-07-14 12:07   ` Arnd Bergmann
2017-07-14 12:07   ` Arnd Bergmann
2017-07-14 12:33   ` Robin Murphy
2017-07-14 12:33     ` Robin Murphy
2017-07-14 16:03   ` David Miller
2017-07-14 16:03     ` David Miller
2017-07-14 12:07 ` [PATCH 12/22] vmxnet3: avoid format strint " Arnd Bergmann
2017-07-14 16:04   ` David Miller
2017-07-14 12:07 ` [PATCH 13/22] liquidio: fix possible eeprom format string overflow Arnd Bergmann
2017-07-14 16:04   ` David Miller
2017-07-14 22:40     ` Burla, Satananda [this message]
2017-07-14 22:40       ` Burla, Satananda
2017-07-14 22:40       ` Burla, Satananda
2017-07-14 12:07 ` [PATCH 14/22] [media] usbvision-i2c: fix format overflow warning Arnd Bergmann
2017-07-17 12:53   ` Hans Verkuil
2017-07-17 12:57     ` Arnd Bergmann
2017-07-17 12:59       ` Hans Verkuil
2017-07-14 12:07 ` [PATCH 15/22] hwmon: applesmc: fix format string overflow Arnd Bergmann
2017-07-14 14:06   ` Guenter Roeck
2017-07-14 12:07 ` [PATCH 16/22] x86: intel-mid: fix a format string overflow warning Arnd Bergmann
2017-07-14 12:07 ` [PATCH 17/22] platform/x86: alienware-wmi: fix " Arnd Bergmann
2017-07-14 18:30   ` Mario.Limonciello
2017-07-14 18:30     ` Mario.Limonciello
2017-07-14 19:18   ` Andy Shevchenko
2017-07-14 19:37     ` Arnd Bergmann
2017-07-14 19:49       ` Andy Shevchenko
2017-07-14 12:07 ` [PATCH 18/22] gpio: acpi: fix string overflow for large pin numbers Arnd Bergmann
2017-07-14 12:52   ` Andy Shevchenko
2017-07-14 19:59     ` Arnd Bergmann
2017-07-14 19:59       ` Arnd Bergmann
2017-07-14 19:59       ` Arnd Bergmann
2017-07-14 12:07 ` [PATCH 19/22] block: DAC960: shut up format-overflow warning Arnd Bergmann
2017-07-14 14:04   ` Jens Axboe
2017-07-14 14:04     ` Jens Axboe
2017-07-14 12:07 ` [PATCH 20/22] sound: pci: avoid string overflow warnings Arnd Bergmann
2017-07-14 12:07   ` Arnd Bergmann
2017-07-14 12:28   ` Takashi Iwai
2017-07-14 12:28     ` Takashi Iwai
2017-07-18 11:52     ` Arnd Bergmann
2017-07-14 12:07 ` [PATCH 21/22] fscache: fix fscache_objlist_show format processing Arnd Bergmann
2017-09-04 18:29   ` Jérémy Lefaure
2017-07-14 12:07 ` [PATCH 22/22] IB/mlx4: fix sprintf format warning Arnd Bergmann
2017-07-14 13:48   ` Leon Romanovsky
2017-07-25  1:48 ` [PATCH 00/22] gcc-7 -Wformat-* warnings Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170714224009.2537mysgwab272xp@caviumnetworks.com \
    --to=satananda.burla@cavium.com \
    --cc=Derek.Chickles@cavium.com \
    --cc=Felix.Manlunas@cavium.com \
    --cc=Prasad.Kanneganti@cavium.com \
    --cc=Raghu.Vatsavayi@cavium.com \
    --cc=Weilin.Chang@cavium.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=martin.petersen@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.