Index | Thread | Search

From:
Vitaliy Makkoveev <mvs@openbsd.org>
Subject:
Re: Don't take solock() in soreceive() for SOCK_RAW inet sockets
To:
Alexander Bluhm <bluhm@openbsd.org>
Cc:
tech@openbsd.org
Date:
Tue, 16 Apr 2024 00:40:04 +0300

Download raw body.

Thread
  • Alexander Bluhm:

    Don't take solock() in soreceive() for SOCK_RAW inet sockets

  • On Mon, Apr 15, 2024 at 08:52:44PM +0200, Alexander Bluhm wrote:
    > 
    > Running UDP in parallel on top still has assertion warnings.
    > I think is is a step into the right direction.
    > 
    
    Parallel udp(4) input means that somove() executed with shared netlock
    too. So, the spliced peer `sosp' could also have concurrent sosend()
    threads. We need to use `sb_mtx' not only in soreceive(), but also in
    sosend() path. So, the somove() should take both `sb_mtx' on so->so_rcv
    and sosp->so_snd buffers...
    
    I want to convert soreceive() to the new locking scheme and clean out
    current locking mess before start sosend() reworking. tcp(4) sockets are
    connection oriented, but `sb_mtx' could be used to serialize connection
    related SS_ flags. The rest sockets are trivial to convert.
    
    
    
  • Alexander Bluhm:

    Don't take solock() in soreceive() for SOCK_RAW inet sockets