https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282393

--- Comment #2 from commit-h...@freebsd.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=bfd03046d18776ea70785ca1ef36dfc60822de3b

commit bfd03046d18776ea70785ca1ef36dfc60822de3b
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2024-11-03 14:39:32 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2024-11-03 16:46:53 +0000

    unix: Add support for atomically setting the socket mode

    With this patch, it is possible to call fchmod() on a unix socket prior
    to binding it to the filesystem namespace, so that the mode is set
    atomically.  Without this, one has to call chmod() after bind(), leaving
    a window where threads can connect to the socket with the default mode.
    After bind(), fchmod() reverts to failing with EINVAL.

    This interface is copied from Linux.

    The behaviour of fstat() is unmodified, i.e., it continues to return the
    mode as set by soo_stat().

    PR:             282393
    Reviewed by:    kib
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D47361

 lib/libsys/chmod.2          |  9 ++++++++-
 share/man/man4/unix.4       | 12 +++++++++++-
 sys/kern/sys_socket.c       | 17 ++++++++++++++++-
 sys/kern/uipc_usrreq.c      | 29 ++++++++++++++++++++++++++++-
 sys/sys/protosw.h           |  5 +++++
 sys/sys/unpcb.h             |  1 +
 tests/sys/kern/unix_dgram.c | 41 ++++++++++++++++++++++++++++++++++++++++-
 7 files changed, 109 insertions(+), 5 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to