All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] siox: fix possible buffer overflow in device_add_store
@ 2018-02-14 14:25 Gavin Schenk
  2018-02-14 17:00 ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Gavin Schenk @ 2018-02-14 14:25 UTC (permalink / raw)
  To: linux-kernel, gregkh; +Cc: kernel, dcb314, Gavin Schenk

Width 20 given in format string is larger than destination
buffer 'type[20]', use %19s to prevent overflowing it.

Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX")
Cc: stable <stable@vger.kernel.org>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Gavin Schenk <g.schenk@eckelmann.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/siox/siox-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c
index fdfcdea25867..16590dfaafa4 100644
--- a/drivers/siox/siox-core.c
+++ b/drivers/siox/siox-core.c
@@ -594,7 +594,7 @@ static ssize_t device_add_store(struct device *dev,
 	size_t inbytes = 0, outbytes = 0;
 	u8 statustype = 0;
 
-	ret = sscanf(buf, "%20s %zu %zu %hhu", type, &inbytes,
+	ret = sscanf(buf, "%19s %zu %zu %hhu", type, &inbytes,
 		     &outbytes, &statustype);
 	if (ret != 3 && ret != 4)
 		return -EINVAL;
-- 
2.15.1


-- 
Eckelmann AG
Vorstand: Dipl.-Ing. Peter Frankenbach (Sprecher) Dipl.-Wi.-Ing. Philipp Eckelmann
Dr.-Ing. Marco Münchhof Dr.-Ing. Frank Uhlemann
Vorsitzender des Aufsichtsrats: Hubertus G. Krossa
Stv. Vorsitzender des Aufsichtsrats: Dr.-Ing. Gerd Eckelmann
Sitz der Gesellschaft: Berliner Str. 161, 65205 Wiesbaden, Amtsgericht Wiesbaden HRB 12636
http://www.eckelmann.de

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] siox: fix possible buffer overflow in device_add_store
  2018-02-14 14:25 [PATCH] siox: fix possible buffer overflow in device_add_store Gavin Schenk
@ 2018-02-14 17:00 ` Uwe Kleine-König
  2018-03-02 14:00   ` Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2018-02-14 17:00 UTC (permalink / raw)
  To: Gavin Schenk; +Cc: linux-kernel, gregkh, dcb314, kernel

Hello,

On Wed, Feb 14, 2018 at 03:25:02PM +0100, Gavin Schenk wrote:
> Width 20 given in format string is larger than destination
> buffer 'type[20]', use %19s to prevent overflowing it.
> 
> Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX")
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Gavin Schenk <g.schenk@eckelmann.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] siox: fix possible buffer overflow in device_add_store
  2018-02-14 17:00 ` Uwe Kleine-König
@ 2018-03-02 14:00   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2018-03-02 14:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Gavin Schenk, kernel, linux-kernel, dcb314

Hello Greg,

On Wed, Feb 14, 2018 at 06:00:21PM +0100, Uwe Kleine-König wrote:
> On Wed, Feb 14, 2018 at 03:25:02PM +0100, Gavin Schenk wrote:
> > Width 20 given in format string is larger than destination
> > buffer 'type[20]', use %19s to prevent overflowing it.
> > 
> > Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX")
> > Reported-by: David Binderman <dcb314@hotmail.com>
> > Signed-off-by: Gavin Schenk <g.schenk@eckelmann.de>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

is this patch still in your patch queue? The patch didn't appear in next
yet.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-02 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 14:25 [PATCH] siox: fix possible buffer overflow in device_add_store Gavin Schenk
2018-02-14 17:00 ` Uwe Kleine-König
2018-03-02 14:00   ` Uwe Kleine-König

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.