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]
Date:   Fri, 15 Nov 2019 10:54:55 +0100
From:   Jiri Benc <jbenc@...hat.com>
To:     Hangbin Liu <liuhangbin@...il.com>
Cc:     Eric Dumazet <eric.dumazet@...il.com>, netdev@...r.kernel.org,
        Eric Dumazet <edumazet@...gle.com>,
        "David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH net] tcp: switch snprintf to scnprintf

On Fri, 15 Nov 2019 10:41:06 +0800, Hangbin Liu wrote:
> > We need to properly size the output buffers before using them,
> > we can not afford truncating silently the output.
> 
> Yes, I agree. Just as I said, the buffer is still enough, while scnprintf
> is just a safer usage compired with snprintf.

So maybe keep snprintf but add WARN_ON and bail out of the loop if the
buffer size was reached?

	if (WARN_ON(offs >= maxlen))
		break;

 Jiri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ