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] [day] [month] [year] [list]
Date:   Wed, 20 Nov 2019 22:23:48 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     liuhangbin@...il.com
Cc:     netdev@...r.kernel.org, jbenc@...hat.com, eric.dumazet@...il.com
Subject: Re: [PATCHv2 net-next] tcp: warn if offset reach the maxlen limit
 when using snprintf

From: Hangbin Liu <liuhangbin@...il.com>
Date: Wed, 20 Nov 2019 16:38:08 +0800

> snprintf returns the number of chars that would be written, not number
> of chars that were actually written. As such, 'offs' may get larger than
> 'tbl.maxlen', causing the 'tbl.maxlen - offs' being < 0, and since the
> parameter is size_t, it would overflow.
> 
> Since using scnprintf may hide the limit error, while the buffer is still
> enough now, let's just add a WARN_ON_ONCE in case it reach the limit
> in future.
> 
> v2: Use WARN_ON_ONCE as Jiri and Eric suggested.
> 
> Suggested-by: Jiri Benc <jbenc@...hat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>

Applied.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ