Page MenuHomeFreeBSD

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

Authored by kib on Tue, Jul 28, 2:35 AM.
Tags
None
Referenced Files
F164432644: D58506.diff
Fri, Jul 31, 10:29 PM
F164368851: D58506.id182998.diff
Fri, Jul 31, 6:00 AM
F164364982: D58506.id182888.diff
Fri, Jul 31, 5:17 AM
Unknown Object (File)
Fri, Jul 31, 12:38 AM
Unknown Object (File)
Thu, Jul 30, 11:20 PM
Unknown Object (File)
Thu, Jul 30, 5:00 AM
Unknown Object (File)
Thu, Jul 30, 3:27 AM
Unknown Object (File)
Wed, Jul 29, 9:00 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.Tue, Jul 28, 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