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: <vkeh46iukvsensit3vrqxolz5vxvgs2bvbuprkmpznqvefm4wj@bdz4buh3r3cb>
Date: Mon, 17 Nov 2025 02:29:28 -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 v4 4/5] netconsole: resume previously
 deactivated target

Hello Andre,

Given you are going to respin this oen due to the NIPA errors, let me
get some nits I found.

On Sun, Nov 16, 2025 at 05:14:04PM +0000, Andre Carvalho wrote:

> +/* Attempts to resume logging to a deactivated target. */
> +static void maybe_resume_target(struct netconsole_target *nt,
> +				struct net_device *ndev)

nit: s/maybe_resume_target/resume_target/

> +{
> +	int ret;
> +
> +	ret = __netpoll_setup(&nt->np, ndev);
> +	if (ret) {
> +		/* netpoll fails setup once, do not try again. */
> +		nt->state = STATE_DISABLED;
> +		return;
> +	}
> +
> +	netdev_hold(ndev, &nt->np.dev_tracker, GFP_KERNEL);

In netpoll_setup(), it calls netdev_hold() first, and then
call __netpoll_setup(). Shouldn't net device be held before trying to to
setup netpoll()?

> +static bool deactivated_target_match(struct netconsole_target *nt,
> +				     struct net_device *ndev)
> +{
> +	if (nt->state != STATE_DEACTIVATED)
> +		return false;
> +
> +	if (bound_by_mac(nt))
> +		return !memcmp(nt->np.dev_mac, ndev->dev_addr, ETH_ALEN);
> +	return !strncmp(nt->np.dev_name, ndev->name, IFNAMSIZ);
> +}
> +
> +/* Process targets in resume_list and returns then to target_list */

s/then/them

> +static void process_resumable_targets(struct list_head *resume_list,
> +				      struct net_device *ndev)

nit: s/process_resumable_targets/netconsole_process_resumable_tagets/

The name is not the best, but it matches a similar function
(netconsole_process_cleanups_core())

> @@ -1475,6 +1537,11 @@ static int netconsole_netdev_event(struct notifier_block *this,
>  				stopped = true;
>  			}
>  		}
> +		if (event == NETDEV_UP && deactivated_target_match(nt, dev))
> +			/* maybe_resume_target is IRQ unsafe, remove target from
> +			 * target_list in order to resume it with IRQ enabled.
> +			 */
> +			list_move(&nt->list, &resume_list);
>  		netconsole_target_put(nt);
>  	}
>  	spin_unlock_irqrestore(&target_list_lock, flags);
> @@ -1498,6 +1565,8 @@ static int netconsole_netdev_event(struct notifier_block *this,
>  			dev->name, msg);
>  	}
>  
> +	process_resumable_targets(&resume_list, dev);

Nice, this new approach looks cleaner now.

--breno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ