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: Wed, 15 Nov 2023 11:14:41 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Gal Pressman <gal@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, Simon Horman <horms@...nel.org>,
	Vlad Buslov <vladbu@...dia.com>
Subject: Re: [PATCH net v2] net: Fix undefined behavior in netdev name
 allocation

Tue, Nov 14, 2023 at 08:56:18AM CET, gal@...dia.com wrote:
>Cited commit removed the strscpy() call and kept the snprintf() only.
>
>It is common to use 'dev->name' as the format string before a netdev is
>registered, this results in 'res' and 'name' pointers being equal.
>According to POSIX, if copying takes place between objects that overlap
>as a result of a call to sprintf() or snprintf(), the results are
>undefined.
>
>Add back the strscpy() and use 'buf' as an intermediate buffer.
>
>Fixes: 7ad17b04dc7b ("net: trust the bitmap in __dev_alloc_name()")
>Cc: Jakub Kicinski <kuba@...nel.org>
>Reviewed-by: Vlad Buslov <vladbu@...dia.com>
>Signed-off-by: Gal Pressman <gal@...dia.com>
>Reviewed-by: Jakub Kicinski <kuba@...nel.org>


Reviewed-by: Jiri Pirko <jiri@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ