git: 59bbde390ebd - stable/14 - inotify: Fix a namei path buffer leak

Mark Johnston <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7353dd.44977.302dd005__203.867971298166$1785943253$gmane$org@gitrepo.freebsd.org>
The branch stable/14 has been updated by markj:

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

commit 59bbde390ebdec2fb55c3f02ef694815930339e3
Author:     Mark Johnston <[email protected]>
AuthorDate: 2025-08-14 16:03:00 +0000
Commit:     Mark Johnston <[email protected]>
CommitDate: 2026-08-05 15:15:16 +0000

    inotify: Fix a namei path buffer leak
    
    Reviewed by:    kib
    Fixes:          f1f230439fa4 ("vfs: Initial revision of inotify")
    Differential Revision:  https://reviews.freebsd.org/D51900
    
    (cherry picked from commit e5a2e77352440f23ef8988a934753fd2fba8b821)
---
 sys/kern/vfs_inotify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c
index 9ff15205c823..f2754f7e815e 100644
--- a/sys/kern/vfs_inotify.c
+++ b/sys/kern/vfs_inotify.c
@@ -798,6 +798,7 @@ vn_inotify_add_watch(struct vnode *vp, struct inotify_softc *sc, uint32_t mask,
 			vn_lock(vp, LK_SHARED | LK_RETRY);
 			if (error != 0)
 				break;
+			NDFREE_PNBUF(&nd);
 			vn_irflag_set_cond(nd.ni_vp, VIRF_INOTIFY_PARENT);
 			vrele(nd.ni_vp);
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.