siox: fix possible buffer overflow in device_add_store
PATCH 1/1 siox: fix possible buffer overflow in device_add_store
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 <[email protected]>
Reported-by David Binderman <[email protected]>
Signed-off-by Gavin Schenk <[email protected]>
Reviewed-by Uwe Kleine-König <[email protected]>
--- drivers/siox/siox-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/siox/siox-core.c +1 -1
@@ -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 ;
Signature · 11 lines
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
Hello,
Quoted 6 lines · 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")Reported-by David Binderman <[email protected]>Signed-off-by Gavin Schenk <[email protected]>
Reviewed-by Uwe Kleine-König <[email protected]>
Thanks
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |
Hello Greg,
Quoted 8 lines · Uwe Kleine-König
Quoted 6 lines · 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")Reported-by David Binderman <[email protected]>Signed-off-by Gavin Schenk <[email protected]>Reviewed-by Uwe Kleine-König <[email protected]>
is this patch still in your patch queue? The patch didn't appear in next yet.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |