[PATCH] tty: serial: samsung: Fix potential buffer overflow in clkname

Krzysztof Kozlowski krzk at kernel.org
Tue Apr 1 05:52:06 PDT 2025


On 01/04/2025 13:24, shao.mingyin at zte.com.cn wrote:
> From: Peng Jiang <jiang.peng9 at zte.com.cn>
> 
> Compiling the kernel with gcc12.3 W=1 produces a warning:
> /drivers/tty/serial/samsung_tty.c: In function
> 's3c24xx_serial_set_termios':
> 
> /drivers/tty/serial/samsung_tty.c:1392:48:
> warning: '%d' directive writing between 1 and 3 bytes
> into a region of size 2 [-Wformat-overflow=]
>  1392 |  sprintf(clkname, "clk_uart_baud%d", cnt);

Same comments as with other patches, not possible, IMO. Plus this patch
looks actually worse - commit msg is hardly readable.

Best regards,
Krzysztof



More information about the linux-arm-kernel mailing list