Page MenuHomeFreeBSD

kern_execve(): avoid storing non-VDIR into p_textdvp
ClosedPublic

Authored by kib on Jul 28 2026, 2:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 11, 1:14 PM
Unknown Object (File)
Thu, Sep 10, 6:23 PM
Unknown Object (File)
Mon, Sep 7, 9:23 PM
Unknown Object (File)
Sun, Sep 6, 11:08 PM
Unknown Object (File)
Sat, Sep 5, 2:14 PM
Unknown Object (File)
Sat, Sep 5, 11:06 AM
Unknown Object (File)
Sat, Sep 5, 2:30 AM
Unknown Object (File)
Thu, Sep 3, 3:51 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Looks good to me. I have started a full stress2 test, just in case ..

09:54 /usr/src/tools/test/stress2/misc $ ./filemount_panic.sh
  PID COMM                OSREL PATH
67825 cover             1600019 /tmp/tmp.kEEk4GCRkj.renamed/cover
09:54 /usr/src/tools/test/stress2/misc $ ./filemount_panic2.sh 
mounted /bin/sleep over /tmp/filemount.VWEd7r/cover
querying kern.proc.pathname for pid 28160
pathname = /tmp/filemount.VWEd7r.renamed/cover
09:56 /usr/src/tools/test/stress2/misc $ uname -a
FreeBSD mercat1.netperf.freebsd.org 16.0-CURRENT FreeBSD 16.0-CURRENT #1 ufs-n287721-3b23d05c7781: Tue Jul 28 08:09:01 CEST 2026     pho@mercat1.netperf.freebsd.org:/var/tmp/deviant3/sys/amd64/compile/PHO amd64
09:56 /usr/src/tools/test/stress2/misc $
sys/kern/kern_exec.c
571

I think some comment explaining what this block does would be welcome.

589

vn_vptocnp() will drop the ref on dvp1 before returning an error, so I think this vrele() is wrong.

kib marked 2 inline comments as done.

Add comment.
Drop vrele().

sys/kern/kern_exec.c
579
580
613

Is it okay to pass a NULL newtextdvp here?

kib marked 3 inline comments as done.

Grammar.
Guard vn_fullpath_hardlink() against NULL newtextdvp == NULL.

This revision is now accepted and ready to land.Jul 28 2026, 10:44 PM

I’m late to the party but this covers every issue I’ve run into except one dumb one that I’m not sure should live in vfs to begin with