Bellow is leaking recipe tested under GNU/kFreeBSD.
I would expect it leaks vnodes also under plain FreeBSD.


I confirm it is reproducible on plain FreeBSD. Looks like a security
issue, as a normal user can create a local DoS in a few dozen of
seconds.

I already posted the following patch in private.

Thanks, I confirm it fixes the problem, at least the testcase posted by
Petr.

diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c
index 5cfbc71..e9dac77 100644
--- a/sys/kern/tty_pts.c
+++ b/sys/kern/tty_pts.c
@@ -575,6 +575,9 @@ ptsdev_close(struct file *fp, struct thread *td)
        tty_lock(tp);
        tty_rel_gone(tp);

+       if (fp->f_vnode != NULL)
+               return (vnops.fo_close(fp, td));
+
        return (0);
 }



It fixes also our original issue with testsuite of gcc-4.3 under 8.0-RELEASE.

Many thanks for this patch and for your guidance during this bug hunt.

Petr
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to