The branch stable/15 has been updated by kib:

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

commit fff29fbbbd24055c680c3bf44ba3d045dcf9714e
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-05-30 22:11:45 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-06-13 00:58:32 +0000

    bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets
    
    (cherry picked from commit 12c590a9abd770f69da3bc0b8adb4955d79357c8)
---
 sys/kern/uipc_usrreq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 90c13f7e17c4..96cd22786558 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -616,8 +616,9 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr 
*nam, struct thread *td)
        buf[namelen] = 0;
 
 restart:
-       NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | NOCACHE,
-           UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_BINDAT));
+       NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | NOCACHE |
+           EMPTYPATH, UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights,
+           CAP_BINDAT));
 /* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */
        error = namei(&nd);
        if (error)
@@ -2924,7 +2925,7 @@ unp_connectat(int fd, struct socket *so, struct sockaddr 
*nam,
                sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
        else
                sa = NULL;
-       NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF,
+       NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | EMPTYPATH,
            UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_CONNECTAT));
        error = namei(&nd);
        if (error)

Reply via email to