The branch main has been updated by markj:

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

commit 58c73727d6e49de1fc4f4bc90621146cae8db2bc
Author:     Mark Johnston <[email protected]>
AuthorDate: 2026-07-06 15:42:52 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2026-07-06 15:46:01 +0000

    vfs: Fix resource leaks in kern_symlinkat()
    
    Fixes:          2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris 
style extended attributes")
    Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                    and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
    Reviewed by:    rmacklem, kib
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D58053
---
 sys/kern/vfs_syscalls.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index ec952cac1d2e..59d0c9c40927 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1882,7 +1882,7 @@ restart:
        }
        if ((vn_irflag_read(nd.ni_dvp) & VIRF_NAMEDDIR) != 0) {
                error = EINVAL;
-               goto out;
+               goto out2;
        }
        VATTR_NULL(&vattr);
        vattr.va_mode = ACCESSPERMS &~ td->td_proc->p_pd->pd_cmask;
@@ -1894,9 +1894,7 @@ restart:
                goto out2;
 #endif
        error = VOP_SYMLINK(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr, syspath);
-#ifdef MAC
 out2:
-#endif
        VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true);
        vn_finished_write(mp);
        NDFREE_PNBUF(&nd);

Reply via email to