]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
do_execve(): lock vnode when needed.
authorkib <kib@FreeBSD.org>
Fri, 8 Feb 2019 04:06:48 +0000 (04:06 +0000)
committerkib <kib@FreeBSD.org>
Fri, 8 Feb 2019 04:06:48 +0000 (04:06 +0000)
commitca4620a43122cfede1130c0df9f7007e3b88979a
treefed5ed9c51639db1326f25ed540c1a46874f5609
parentbed97535845204f6338bc4812b59fb29277078be
do_execve(): lock vnode when needed.

Code after exec_fail_dealloc label expects that the image vnode is
locked if present.  When copyout() of the strings or auxv vectors fails,
goto to the error handling did not relocked the vnode as required.

The copyout() can be made failing e.g. by creating an ELF image with
PT_GNU_STACK segment disabling the write.

Reported by: Jonathan Stuart <n0t.jcs@gmail.com> (found by fuzzing)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
sys/kern/kern_exec.c