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
F165336670: D58506.id182888.diff
Fri, Aug 7, 5:25 PM
F165328179: D58506.diff
Fri, Aug 7, 4:19 PM
F165319610: D58506.id182998.diff
Fri, Aug 7, 3:13 PM
Unknown Object (File)
Wed, Aug 5, 11:53 AM
Unknown Object (File)
Wed, Aug 5, 3:50 AM
Unknown Object (File)
Wed, Aug 5, 12:54 AM
Unknown Object (File)
Tue, Aug 4, 6:35 PM
Unknown Object (File)
Tue, Aug 4, 4:55 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