linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: mlxreg: Fix possible buffer overflow
@ 2019-09-21 22:02 Oleh Kravchenko
  2019-09-26 12:07 ` Pavel Machek
  0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2019-09-21 22:02 UTC (permalink / raw)
  To: linux-leds, jacek.anaszewski, pavel; +Cc: Oleh Kravchenko

Error was detected by PVS-Studio:
V512 A call of the 'sprintf' function will lead to overflow of
the buffer 'led_data->led_cdev_name'.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
---
 drivers/leds/leds-mlxreg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c
index cabe379071a7..82aea1cd0c12 100644
--- a/drivers/leds/leds-mlxreg.c
+++ b/drivers/leds/leds-mlxreg.c
@@ -228,8 +228,8 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
 			brightness = LED_OFF;
 			led_data->base_color = MLXREG_LED_GREEN_SOLID;
 		}
-		sprintf(led_data->led_cdev_name, "%s:%s", "mlxreg",
-			data->label);
+		snprintf(led_data->led_cdev_name, sizeof(led_data->led_cdev_name),
+			 "mlxreg:%s", data->label);
 		led_cdev->name = led_data->led_cdev_name;
 		led_cdev->brightness = brightness;
 		led_cdev->max_brightness = LED_ON;
-- 
2.21.0


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

* Re: [PATCH] leds: mlxreg: Fix possible buffer overflow
  2019-09-21 22:02 [PATCH] leds: mlxreg: Fix possible buffer overflow Oleh Kravchenko
@ 2019-09-26 12:07 ` Pavel Machek
  2019-10-13 17:33   ` Oleh Kravchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2019-09-26 12:07 UTC (permalink / raw)
  To: Oleh Kravchenko; +Cc: linux-leds, jacek.anaszewski

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Sun 2019-09-22 01:02:30, Oleh Kravchenko wrote:
> Error was detected by PVS-Studio:
> V512 A call of the 'sprintf' function will lead to overflow of
> the buffer 'led_data->led_cdev_name'.
> 
> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [PATCH] leds: mlxreg: Fix possible buffer overflow
  2019-09-26 12:07 ` Pavel Machek
@ 2019-10-13 17:33   ` Oleh Kravchenko
  2019-10-13 17:48     ` Jacek Anaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2019-10-13 17:33 UTC (permalink / raw)
  To: jacek.anaszewski; +Cc: Pavel Machek, linux-leds


[-- Attachment #1.1: Type: text/plain, Size: 445 bytes --]

Hello Jacek,
Could you please react on this patch?

26.09.19 15:07, Pavel Machek пише:
> On Sun 2019-09-22 01:02:30, Oleh Kravchenko wrote:
>> Error was detected by PVS-Studio:
>> V512 A call of the 'sprintf' function will lead to overflow of
>> the buffer 'led_data->led_cdev_name'.
>>
>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> 

-- 
Best regards,
Oleh Kravchenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] leds: mlxreg: Fix possible buffer overflow
  2019-10-13 17:33   ` Oleh Kravchenko
@ 2019-10-13 17:48     ` Jacek Anaszewski
  2019-10-13 18:00       ` Oleh Kravchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Jacek Anaszewski @ 2019-10-13 17:48 UTC (permalink / raw)
  To: Oleh Kravchenko; +Cc: Pavel Machek, linux-leds

Hi Oleh,

On 10/13/19 7:33 PM, Oleh Kravchenko wrote:
> Hello Jacek,
> Could you please react on this patch?

Sorry for dropping the ball on it. Either way, I can only give
my ack since I handed over LED git maintenance to Pavel.

Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

> 26.09.19 15:07, Pavel Machek пише:
>> On Sun 2019-09-22 01:02:30, Oleh Kravchenko wrote:
>>> Error was detected by PVS-Studio:
>>> V512 A call of the 'sprintf' function will lead to overflow of
>>> the buffer 'led_data->led_cdev_name'.
>>>
>>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
>>
>> Acked-by: Pavel Machek <pavel@ucw.cz>
>>
> 

-- 
Best regards,
Jacek Anaszewski

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

* Re: [PATCH] leds: mlxreg: Fix possible buffer overflow
  2019-10-13 17:48     ` Jacek Anaszewski
@ 2019-10-13 18:00       ` Oleh Kravchenko
  2019-10-14 18:57         ` Jacek Anaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2019-10-13 18:00 UTC (permalink / raw)
  To: Jacek Anaszewski; +Cc: Pavel Machek, linux-leds


[-- Attachment #1.1: Type: text/plain, Size: 915 bytes --]

Hello Jacek,

13.10.19 20:48, Jacek Anaszewski пише:
> Hi Oleh,
> 
> On 10/13/19 7:33 PM, Oleh Kravchenko wrote:
>> Hello Jacek,
>> Could you please react on this patch?
> 
> Sorry for dropping the ball on it. Either way, I can only give
> my ack since I handed over LED git maintenance to Pavel.

I hope you will be still involved in Linux kernel development.
Your code-reviews was good and very useful. 
 
> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

Thank you!

>> 26.09.19 15:07, Pavel Machek пише:
>>> On Sun 2019-09-22 01:02:30, Oleh Kravchenko wrote:
>>>> Error was detected by PVS-Studio:
>>>> V512 A call of the 'sprintf' function will lead to overflow of
>>>> the buffer 'led_data->led_cdev_name'.
>>>>
>>>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
>>>
>>> Acked-by: Pavel Machek <pavel@ucw.cz>
>>>
>>
> 
-- 
Best regards,
Oleh Kravchenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] leds: mlxreg: Fix possible buffer overflow
  2019-10-13 18:00       ` Oleh Kravchenko
@ 2019-10-14 18:57         ` Jacek Anaszewski
  0 siblings, 0 replies; 6+ messages in thread
From: Jacek Anaszewski @ 2019-10-14 18:57 UTC (permalink / raw)
  To: Oleh Kravchenko; +Cc: Pavel Machek, linux-leds

Hi Oleh,

On 10/13/19 8:00 PM, Oleh Kravchenko wrote:
> Hello Jacek,
> 
> 13.10.19 20:48, Jacek Anaszewski пише:
>> Hi Oleh,
>>
>> On 10/13/19 7:33 PM, Oleh Kravchenko wrote:
>>> Hello Jacek,
>>> Could you please react on this patch?
>>
>> Sorry for dropping the ball on it. Either way, I can only give
>> my ack since I handed over LED git maintenance to Pavel.
> 
> I hope you will be still involved in Linux kernel development.
> Your code-reviews was good and very useful. 

I'm glad you found them useful.

I may not be as active as I used to but I will be hanging
around...

>> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> 
> Thank you!

You're welcome.

>>> 26.09.19 15:07, Pavel Machek пише:
>>>> On Sun 2019-09-22 01:02:30, Oleh Kravchenko wrote:
>>>>> Error was detected by PVS-Studio:
>>>>> V512 A call of the 'sprintf' function will lead to overflow of
>>>>> the buffer 'led_data->led_cdev_name'.
>>>>>
>>>>> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
>>>>
>>>> Acked-by: Pavel Machek <pavel@ucw.cz>
>>>>
>>>
>>

-- 
Best regards,
Jacek Anaszewski

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

end of thread, other threads:[~2019-10-14 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-21 22:02 [PATCH] leds: mlxreg: Fix possible buffer overflow Oleh Kravchenko
2019-09-26 12:07 ` Pavel Machek
2019-10-13 17:33   ` Oleh Kravchenko
2019-10-13 17:48     ` Jacek Anaszewski
2019-10-13 18:00       ` Oleh Kravchenko
2019-10-14 18:57         ` Jacek Anaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).