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)
Mon, Oct 6, 1:23 AM
Unknown Object (File)
Thu, Oct 2, 4:23 PM
Unknown Object (File)
Wed, Sep 17, 1:19 AM
Unknown Object (File)
Tue, Sep 16, 1:22 AM
Unknown Object (File)
Sep 13 2025, 10:38 PM
Unknown Object (File)
Sep 13 2025, 4:28 AM
Unknown Object (File)
Sep 13 2025, 2:44 AM
Unknown Object (File)
Sep 13 2025, 12:58 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.