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: <Y1wqe2ybxxCtIhvL@pop-os.localdomain>
Date:   Fri, 28 Oct 2022 12:16:11 -0700
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Jakub Sitnicki <jakub@...udflare.com>
Cc:     Cong Wang <cong.wang@...edance.com>, sdf@...gle.com,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        John Fastabend <john.fastabend@...il.com>
Subject: Re: [Patch bpf] sock_map: convert cancel_work_sync() to cancel_work()

On Mon, Oct 24, 2022 at 03:33:13PM +0200, Jakub Sitnicki wrote:
> On Tue, Oct 18, 2022 at 11:13 AM -07, sdf@...gle.com wrote:
> > On 10/17, Cong Wang wrote:
> >> From: Cong Wang <cong.wang@...edance.com>
> >
> >> Technically we don't need lock the sock in the psock work, but we
> >> need to prevent this work running in parallel with sock_map_close().
> >
> >> With this, we no longer need to wait for the psock->work synchronously,
> >> because when we reach here, either this work is still pending, or
> >> blocking on the lock_sock(), or it is completed. We only need to cancel
> >> the first case asynchronously, and we need to bail out the second case
> >> quickly by checking SK_PSOCK_TX_ENABLED bit.
> >
> >> Fixes: 799aa7f98d53 ("skmsg: Avoid lock_sock() in sk_psock_backlog()")
> >> Reported-by: Stanislav Fomichev <sdf@...gle.com>
> >> Cc: John Fastabend <john.fastabend@...il.com>
> >> Cc: Jakub Sitnicki <jakub@...udflare.com>
> >> Signed-off-by: Cong Wang <cong.wang@...edance.com>
> >
> > This seems to remove the splat for me:
> >
> > Tested-by: Stanislav Fomichev <sdf@...gle.com>
> >
> > The patch looks good, but I'll leave the review to Jakub/John.
> 
> I can't poke any holes in it either.
> 
> However, it is harder for me to follow than the initial idea [1].
> So I'm wondering if there was anything wrong with it?

It caused a warning in sk_stream_kill_queues() when I actually tested
it (after posting).

> 
> This seems like a step back when comes to simplifying locking in
> sk_psock_backlog() that was done in 799aa7f98d53.

Kinda, but it is still true that this sock lock is not for sk_socket
(merely for closing this race condition).

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ