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)
Thu, Mar 28, 11:48 AM
Unknown Object (File)
Jan 13 2024, 2:13 AM
Unknown Object (File)
Dec 26 2023, 2:21 PM
Unknown Object (File)
Dec 23 2023, 12:23 AM
Unknown Object (File)
Dec 15 2023, 2:22 AM
Unknown Object (File)
Nov 28 2023, 8:23 PM
Unknown Object (File)
Nov 8 2023, 11:02 PM
Unknown Object (File)
Nov 7 2023, 5:22 PM
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.