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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXJAmyLusSP8Q8SvuMUKT9W5_nk0XoSW_TJY1kxzABWtxuMHg@mail.gmail.com>
Date: Wed, 27 Aug 2025 16:27:11 -0700
From: John Ousterhout <ouster@...stanford.edu>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, edumazet@...gle.com, horms@...nel.org, 
	kuba@...nel.org
Subject: Re: [PATCH net-next v15 05/15] net: homa: create homa_peer.h and homa_peer.c

On Tue, Aug 26, 2025 at 2:33 AM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On 8/18/25 10:55 PM, John Ousterhout wrote:
> > +/**
> > + * homa_peer_rcu_callback() - This function is invoked as the callback
> > + * for an invocation of call_rcu. It just marks a peertab to indicate that
> > + * it was invoked.
> > + * @head:    Contains information used to locate the peertab.
> > + */
> > +void homa_peer_rcu_callback(struct rcu_head *head)
> > +{
> > +     struct homa_peertab *peertab;
> > +
> > +     peertab = container_of(head, struct homa_peertab, rcu_head);
> > +     atomic_set(&peertab->call_rcu_pending, 0);
> > +}
>
> The free schema is quite convoluted and different from the usual RCU
> handling. Why don't you simply call_rcu() on the given peer once that
> the refcount reaches zero?

I have no idea why I implemented such a complicated mechanism. I've
switched to your (obvious, in retrospect) approach.

> > +/**
> > + * homa_dst_refresh() - This method is called when the dst for a peer is
> > + * obsolete; it releases that dst and creates a new one.
> > + * @peertab:  Table containing the peer.
> > + * @peer:     Peer whose dst is obsolete.
> > + * @hsk:      Socket that will be used to transmit data to the peer.
> > + */
> > +void homa_dst_refresh(struct homa_peertab *peertab, struct homa_peer *peer,
> > +                   struct homa_sock *hsk)
> > +{
> > +     struct dst_entry *dst;
> > +
> > +     dst = homa_peer_get_dst(peer, hsk);
> > +     if (IS_ERR(dst))
> > +             return;
> > +     dst_release(peer->dst);
> > +     peer->dst = dst;
>
> Why the above does not need any lock? Can multiple RPC race on the same
> peer concurrently?

Yep, that's a bug. I have refactored to use RCU appropriately.

For all of your comments not discussed explicitly above I have
implemented the changes you requested.

And sorry for my first attempt sending this message, which
accidentally used HTML mode.

-John-

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ