Subject: Re: [PATCH net-next v9 5/6] netconsole: resume previously deactivated target

From: Andre Carvalho <[email-masked]>
Date: Mon, 5 Jan 2026 00:29:29 +0000

On Sun, Jan 04, 2026 at 06:41:15PM +0000, Andre Carvalho wrote:
> +static void process_resume_target(struct work_struct *work)
> +{
> +	struct netconsole_target *nt =
> +		container_of(work, struct netconsole_target, resume_wq);
> +	unsigned long flags;
> +
> +	mutex_lock(&dynamic_netconsole_mutex);

This ended up causing build failures in CI as it needs to be guarded by
ifdef for CONFIG_NETCONSOLE_DYNAMIC. Unfortunately, this was always set on my
local tests - will fix that as well.

Sorry for the noise in the CI. Will fix this in v10.

> @@ -1945,6 +2022,7 @@ static struct netconsole_target *alloc_param_target(char *target_config,
>  /* Cleanup netpoll for given target (from boot/module param) and free it */
>  static void free_param_target(struct netconsole_target *nt)
>  {
> +	cancel_work_sync(&nt->resume_wq);
>  	netpoll_cleanup(&nt->np);

Will also address the AI Review[1], which seems to indicate a potential use-after-free
when a dynamic target gets removes (and disabled) while resume_wq has some pending
work. I think this might be a true positive and I'll see if also canceling the work
on netconsole_target_release() makes sense.

[1] https://netdev-ai.bots.linux.dev/ai-review.html?id=ca5cba91-a1a6-4240-bf10-e4da9c5bc58a

-- 
Andre Carvalho