Re: ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-06 Thread Theo de Raadt
Alexander Bluhm wrote: > During configuration there is usually some kind of lock, it happens > rarely, and bugs are hard to trigger, especially on amd64 which > guarantees some consistency. That's why it works. > > > Some times ago, I privately pointed this and proposed to modify if_flags > > a

Re: ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-06 Thread Alexander Bluhm
On Fri, Oct 06, 2023 at 04:17:34PM +0300, Vitaliy Makkoveev wrote: > On Fri, Oct 06, 2023 at 02:50:21PM +0200, Alexander Bluhm wrote: > > On Fri, Oct 06, 2023 at 12:45:54PM +0300, Vitaliy Makkoveev wrote: > > > On Thu, Oct 05, 2023 at 10:42:25PM +1000, David Gwynne wrote: > > > > > On 5 Oct 2023, a

Re: ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-06 Thread Vitaliy Makkoveev
On Fri, Oct 06, 2023 at 02:50:21PM +0200, Alexander Bluhm wrote: > On Fri, Oct 06, 2023 at 12:45:54PM +0300, Vitaliy Makkoveev wrote: > > On Thu, Oct 05, 2023 at 10:42:25PM +1000, David Gwynne wrote: > > > > On 5 Oct 2023, at 21:50, Vitaliy Makkoveev wrote: > > > > > > > > I don't like this unloc

Re: ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-06 Thread Alexander Bluhm
On Fri, Oct 06, 2023 at 12:45:54PM +0300, Vitaliy Makkoveev wrote: > On Thu, Oct 05, 2023 at 10:42:25PM +1000, David Gwynne wrote: > > > On 5 Oct 2023, at 21:50, Vitaliy Makkoveev wrote: > > > > > > I don't like this unlocked if_flags check we have in ifq_start_task(). > > > Guess READ_ONCE() is

Re: ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-06 Thread Vitaliy Makkoveev
Thanks for attention at this. But now I don't like this diff. It silently drops stuck packets, so `ph_cookie' linked data could leak. Obviously wg_peer_destroy() and wg_qstart() should be fixed in different way. On Thu, Oct 05, 2023 at 10:42:25PM +1000, David Gwynne wrote: > > > > On 5 Oct 2023,

Re: ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-05 Thread David Gwynne
> On 5 Oct 2023, at 21:50, Vitaliy Makkoveev wrote: > > Otherwise `if_snd' could still contain packets. If any of them has > associated data with bumped reference counter, the corresponding > refcnt_finalize() will sleep forever. I don't think we need to > transmit these packets when interface

ifq_start_task(): purge queue before exit when IFF_RUNNING flag is not set

2023-10-05 Thread Vitaliy Makkoveev
Otherwise `if_snd' could still contain packets. If any of them has associated data with bumped reference counter, the corresponding refcnt_finalize() will sleep forever. I don't think we need to transmit these packets when interface became running again. I don't like this unlocked if_flags check w