HomeFreeBSD

sockets: on shutdown(2) do sorflush() only in case of generic sockbuf

Description

sockets: on shutdown(2) do sorflush() only in case of generic sockbuf

This is a quick plug to fix panic with Netlink which has protocol specific
buffers. Note that PF_UNIX/SOCK_DGRAM, which also has its own buffers,
avoids the panic due to being SOCK_DGRAM. A correct but more complicated
fix that needs to be done is to merge pr_shutdown, pr_flush and dom_dispose
into one protocol method that may call sorflush for generic sockets or do
their own stuff for protocol which has own buffers.

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D43367
Reported-by: syzbot+a58e1615881c01a51653@syzkaller.appspotmail.com

Details

Provenance
glebiusAuthored on Jan 9 2024, 1:20 AM
Reviewer
tuexen
Differential Revision
D43367: sockets: on shutdown(2) do sorflush() only in case of generic sockbuf
Parents
rGaf9f4ac57ade: netlink: just return EOPNOTSUPP on shutdown(2)
Branches
Unknown
Tags
Unknown