Page MenuHomeFreeBSD

Modify sv_onexec hook to return error.
ClosedPublic

Authored by dchagin on Jun 26 2021, 10:19 AM.
Tags
None
Referenced Files
F146016109: D30911.diff
Fri, Feb 27, 1:40 AM
Unknown Object (File)
Sun, Feb 8, 6:39 AM
Unknown Object (File)
Sun, Feb 8, 5:15 AM
Unknown Object (File)
Sat, Feb 7, 5:33 PM
Unknown Object (File)
Fri, Jan 30, 10:28 PM
Unknown Object (File)
Dec 28 2025, 7:42 PM
Unknown Object (File)
Dec 25 2025, 8:41 PM
Unknown Object (File)
Dec 9 2025, 4:32 AM
Subscribers

Details

Summary

Temporary add stubs to the Linux emulation layer which calls the existing hook.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/kern_exec.c
1167

At this point, error is KERN_SUCCESS, which is some Mach error code. We never assume that it has zero value. Please replace this fragment by e.g. the following

return (sv->sv_onexec != NULL ? sv->sv_onexec(p, imgp) : 0);

fixed, i missied that KERN_SUCCESS != 0

KERN_SUCCESS is 0, but it is undesirable to depend on that.

This revision is now accepted and ready to land.Jun 26 2021, 1:57 PM