OpenBSD cvs log

created 2024-02-17T23:50:56Z
begin 2024-02-11T00:00:00Z
end 2024-02-12T00:00:00Z
path src/sys
commits 7

date 2024-02-11T01:27:45Z
author bluhm
files src/sys/netinet/in_pcb.c log diff annotate
src/sys/netinet/in_pcb.h log diff annotate
src/sys/netinet/ip_ipip.c log diff annotate
src/sys/netinet/ipsec_output.c log diff annotate
src/sys/netinet/tcp_input.c log diff annotate
src/sys/netinet/tcp_output.c log diff annotate
src/sys/netinet/tcp_subr.c log diff annotate
src/sys/netinet/tcp_usrreq.c log diff annotate
src/sys/netinet6/in6_pcb.c log diff annotate
src/sys/netinet6/ip6_divert.c log diff annotate
message Remove include netinet6/ip6_var.h from netinet/in_pcb.h.

OK mvs@

date 2024-02-11T06:40:46Z
author jmc
files src/sys/dev/pci/if_bge.c log diff annotate
message recue -> reduce (in comment); from andrius v

date 2024-02-11T08:40:37Z
author tb
files src/sys/lib/libz/zconf.h log diff annotate
message sync with src

date 2024-02-11T16:01:09Z
author kettenis
files src/sys/dev/fdt/rkpinctrl.c log diff annotate
message Fix potential out-of-bounds array access.

Found by smatch, reported by and ok jsg@

date 2024-02-11T18:14:26Z
author mvs
files src/sys/kern/uipc_socket.c log diff annotate
src/sys/kern/uipc_socket2.c log diff annotate
src/sys/netinet/ip_divert.c log diff annotate
src/sys/netinet/ip_mroute.c log diff annotate
src/sys/netinet/raw_ip.c log diff annotate
src/sys/netinet/udp_usrreq.c log diff annotate
message Use `sb_mtx' instead of `inp_mtx' in receive path for inet sockets.

In soreceve(), we only touch `so_rcv' socket buffer, which has it's own
`sb_mtx' mutex(9) for protection. So, we can avoid solock() in this
path - it's enough to hold `sb_mtx' in soreceive() and around
corresponding sbappend*(). But not right now :)

This time we use shared netlock for some inet sockets in the soreceive()
path. To protect `so_rcv' buffer we use `inp_mtx' mutex(9) and the
pru_lock() to acquire this mutex(9) in socket layer. But the `inp_mtx'
mutex belongs to the PCB. We initialize socket before PCB, tcp(4)
sockets could exist without PCB, so use `sb_mtx' mutex(9) to protect
sockbuf stuff.

This diff mechanically replaces `inp_mtx' by `sb_mtx' in the receive
path. Only for sockets which already use `inp_mtx'. All other sockets
left as is. They will be converted later.

Since the `sb_mtx' is optional, the new SB_MTXLOCK flag introduced. If
this flag is set on `sb_flags', the `sb_mtx' mutex(9) should be taken.
New sb_mtx_lock() and sb_mtx_unlock() was introduced to hide this check.
They are temporary and will be replaced by mtx_enter() when all this
area will be converted to `sb_mtx' mutex(9).

Also, the new sbmtxassertlocked() function introduced to throw
corresponding assertion for SB_MTXLOCK marked buffers. This time only
sbappendaddr() calls it. This function is also temporary and will be
replaced by MTX_ASSERT_LOCKED() later.

ok bluhm

date 2024-02-11T18:14:27Z
author mvs
files src/sys/netinet6/ip6_divert.c log diff annotate
src/sys/netinet6/ip6_mroute.c log diff annotate
src/sys/netinet6/raw_ip6.c log diff annotate
src/sys/sys/socketvar.h log diff annotate
message Use `sb_mtx' instead of `inp_mtx' in receive path for inet sockets.

In soreceve(), we only touch `so_rcv' socket buffer, which has it's own
`sb_mtx' mutex(9) for protection. So, we can avoid solock() in this
path - it's enough to hold `sb_mtx' in soreceive() and around
corresponding sbappend*(). But not right now :)

This time we use shared netlock for some inet sockets in the soreceive()
path. To protect `so_rcv' buffer we use `inp_mtx' mutex(9) and the
pru_lock() to acquire this mutex(9) in socket layer. But the `inp_mtx'
mutex belongs to the PCB. We initialize socket before PCB, tcp(4)
sockets could exist without PCB, so use `sb_mtx' mutex(9) to protect
sockbuf stuff.

This diff mechanically replaces `inp_mtx' by `sb_mtx' in the receive
path. Only for sockets which already use `inp_mtx'. All other sockets
left as is. They will be converted later.

Since the `sb_mtx' is optional, the new SB_MTXLOCK flag introduced. If
this flag is set on `sb_flags', the `sb_mtx' mutex(9) should be taken.
New sb_mtx_lock() and sb_mtx_unlock() was introduced to hide this check.
They are temporary and will be replaced by mtx_enter() when all this
area will be converted to `sb_mtx' mutex(9).

Also, the new sbmtxassertlocked() function introduced to throw
corresponding assertion for SB_MTXLOCK marked buffers. This time only
sbappendaddr() calls it. This function is also temporary and will be
replaced by MTX_ASSERT_LOCKED() later.

ok bluhm

date 2024-02-11T21:36:49Z
author mvs
files src/sys/kern/uipc_socket.c log diff annotate
message Release `sb_mtx' mutex(9) before sbunlock().

ok bluhm