Page MenuHomeFreeBSD

Modify sv_onexec hook to return error.
ClosedPublic

Authored by dchagin on Jun 26 2021, 10:19 AM.
Tags
None
Referenced Files
F132268483: D30911.id91391.diff
Wed, Oct 15, 8:43 AM
Unknown Object (File)
Tue, Oct 14, 10:16 PM
Unknown Object (File)
Tue, Oct 14, 10:16 PM
Unknown Object (File)
Tue, Oct 14, 10:16 PM
Unknown Object (File)
Tue, Oct 14, 1:08 PM
Unknown Object (File)
Sun, Sep 28, 10:48 AM
Unknown Object (File)
Thu, Sep 25, 9:53 PM
Unknown Object (File)
Tue, Sep 23, 11:08 PM
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