lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202504020933293306VVVuy_8HVKbwBOL2PFjW@zte.com.cn>
Date: Wed, 2 Apr 2025 09:33:29 +0800 (CST)
From: <jiang.peng9@....com.cn>
To: <krzk@...nel.org>
Cc: <shao.mingyin@....com.cn>, <alim.akhtar@...sung.com>,
        <yang.yang29@....com.cn>, <xu.xin16@....com.cn>,
        <ye.xingchen@....com.cn>, <gregkh@...uxfoundation.org>,
        <jirislaby@...nel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-samsung-soc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-serial@...r.kernel.org>
Subject: Re: [PATCH] tty: serial: samsung: Fix potential buffer overflow in clkname

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

Hi Krzysztof,
Thank you for your feedback. Let me briefly re-explain the change:
The issue:
When building with W=1, we get a format-overflow warning because "clk_uart_baud%d" could write 15-17 bytes (14 chars + 1-3 digits) into a 15-byte buffer.
The fix:
Increased clkname buffer size from 15 to 18 chars
(original 14 chars + 3 digits + null = 18)
Replaced sprintf() with snprintf() for safety
This keeps the pattern consistent while eliminating the warning. Tested with CONFIG_SERIAL_SAMSUNG=y builds.
Would you prefer any adjustments to this approach?

Best regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ