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]
Message-ID: <szx2wszdd3k3ze5hufynb7tgl54732lsv4ymphnb6om6m37yqh@s774ngir5kie>
Date: Tue, 2 Dec 2025 02:51:19 -0800
From: Breno Leitao <leitao@...ian.org>
To: Andre Carvalho <asantostc@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>, 
	Simon Horman <horms@...nel.org>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next v8 4/5] netconsole: resume previously
 deactivated target

On Mon, Dec 01, 2025 at 10:06:24PM +0000, Andre Carvalho wrote:
> On Mon, Dec 01, 2025 at 03:35:04AM -0800, Breno Leitao wrote:
> > might hit a similar problem to the one fixed by e5235eb6cfe0  ("net:
> > netpoll: initialize work queue before error checks")
> > 
> > The code path would be:
> >   * alloc_param_target()
> > 	  * alloc_and_init()
> > 		  * kzalloc() fails and return NULL.
> > 		  * resume_wq() is still not initialized
> >   fail:
> > 	* free_param_target()
> > 		* cancel_work_sync(&nt->resume_wq); and resume_wq is not
> > 		  initialized
> 
> Checking this a bit now and I'm not sure if we have the same problem. On 
> alloc_param_target() the cleanup is simply kfree(nt).
> 
> free_param_target() is only called as part of netconsole module setup/cleanup but
> only for targets that were succesfully added to the target list (so are guaranteed
> to have resume_wq initialised) before we hit the error.
> 
> Let me know if I'm missing something!

You are not, fail: code only iterates over the targets in the list. If
kzalloc() fails above, it will not be included in the list, thus,
free_param_target() will not be called.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ