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-next>] [day] [month] [year] [list]
Message-Id: <20250826145347.1309654-1-jackzxcui1989@163.com>
Date: Tue, 26 Aug 2025 22:53:47 +0800
From: Xin Zhao <jackzxcui1989@....com>
To: willemdebruijn.kernel@...il.com,
	edumazet@...gle.com,
	ferenc@...es.dev
Cc: davem@...emloft.net,
	kuba@...nel.org,
	pabeni@...hat.com,
	horms@...nel.org,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v7] net: af_packet: Use hrtimer to do the retire operation

On Tue, 2025-08-25 at 20:54 +0800, Willem wrote:

> > I understand that the additional in_scheduled variable is meant to prevent
> > multiple calls to hrtimer_start. However, based on the current logic
> > implementation, the only scenario that would cancel the hrtimer is after calling
> > prb_shutdown_retire_blk_timer. Therefore, once we have called hrtimer_start in
> > prb_setup_retire_blk_timer, we don't need to worry about the hrtimer stopping,
> > and we don't need to execute hrtimer_start again or check if the hrtimer is in
> > an active state. We can simply update the timeout in the callback.
> 
> The hrtimer is also canceled when the callback returns
> HRTIMER_NORESTART.

In prb_retire_rx_blk_timer_expired function, the only way to return HRTIMER_NORESTART
is that the pkc->delete_blk_timer is NOT 0.
The delete_blk_timer is only set to 1 in prb_shutdown_retire_blk_timer which is called
by packet_set_ring.
In my understanding, once packet_set_ring is called and prb_shutdown_retire_blk_timer
is executed, the only way to make this af_packet work again is to call packet_set_ring
again to execute prb_setup_retire_blk_timer. At that point, hrtimer_start will be
called again. Therefore, I feel that there is no need to perform the check in
_prb_refresh_rx_retire_blk_timer. Only let prb_setup_retire_blk_timer to hrtimer_start,
is that right?


Thanks
Xin Zhao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ