Page MenuHomeFreeBSD

Do not leak oldvmspace if image activation failed
ClosedPublic

Authored by kib on Sep 22 2020, 9:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 7, 10:11 PM
Unknown Object (File)
Wed, Nov 5, 12:04 AM
Unknown Object (File)
Tue, Nov 4, 9:49 AM
Unknown Object (File)
Thu, Oct 23, 11:43 PM
Unknown Object (File)
Sat, Oct 18, 2:01 AM
Unknown Object (File)
Sat, Oct 18, 2:01 AM
Unknown Object (File)
Sat, Oct 18, 2:01 AM
Unknown Object (File)
Sat, Oct 18, 2:01 AM
Subscribers

Details

Summary

and current address space is already destroyed, so kern_execve() terminates the process.

While there, clean up some internals of post_execve() inlined in init_main.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Sep 22 2020, 9:41 PM
sys/kern/kern_exec.c
981 ↗(On Diff #77376)

Why is it necessary to do this here? There is one caller where failure == true and in that case the following exit1() call handles it, if I understand correctly.

sys/kern/kern_exec.c
981 ↗(On Diff #77376)

I suspect that exit1() really does not handle it. exit1() does thread_single(SINGLE_EXIT) which silently overrides previous single-threading mode, because p_singlethread == curthread.

I can move drop failure case from exec_cleanup(), leaving only the handling of TDP_EXECVMSPC there, if you prefer it this way.

sys/kern/kern_exec.c
981 ↗(On Diff #77376)

Hmm, it is always compatible. I will update the patch in half a hour.

Previous single-threading mode is always SINGLE_BOUNDARY, if any. Drop code in exec_cleanup() that duplicates exit1().

This revision is now accepted and ready to land.Sep 23 2020, 4:14 PM
This revision was automatically updated to reflect the committed changes.