this adds support for an optional exec paths list to the
security.mac.do.rules sysctl which allows for a whitelist
/blacklist for paths allowed to be exec'ed by userland
supervisors such as mdo
Signed-off-by: polyduekes <polyduekes@proton.me>
Differential D58012
MAC/do: add exec whitelist/blacklist support for mac_do consumers Authored by polyduekes_proton.me on Jul 2 2026, 9:04 PM. Tags None Referenced Files
Subscribers
Details
Diff Detail
Event TimelineComment Actions I like the idea presented here, it goes further than some initial thoughts I had. It looks like it could be made to work. However, the implications of this new feature appear not to have been explored thoroughly, and more work remains for the change here to be consistent. In particular, the following points must be taken into account:
Please also see the inline comments. Finally, you're internally using the same name for fields in support of this feature as for the existing "exec paths". I'm aware you're proposing to rename the existing "exec paths" feature in the next revision (D58013). Technically, we could still change the name, as that feature has not been merged into a release yet (and I've refrained to merge it into the upcoming 14.5). That said, I'm wary of changing the name now: That work was announced under that name for a while now, it has already been merged into 15 (end of june), and, although I was initially seduced by the idea, it's still unclear to me if "supported_bins" is any better. I wonder if we instead should use "exec list" for this feature, as there's the ability to do a blacklist instead of a whitelist. Ideas? Speaking of which, I don't think a blacklist actually has any value. Any executable that is readable with the initial credentials could simply be copied elsewhere. Any executable that is readable by the target credentials could be copied by application of cp (if not ruled out; and anyway that part could be cirmcumvented as described in the previous sentence). Any thoughts on this topic?
Comment Actions use a separate osd slot lifecycle Comment Actions I have fixed that using any-match and multi passes for both whitelist and blacklist but perhaps all-match for blacklist would be better,can you please provide your thoughts on this?
if the module is unloaded before a exec(),it's hook is deregistered so mac_do_vnode_check_exec doesn't run and there's nothing to deny the exec, so exec would be allowed in that case
I am extremely sorry for doing that, i will make changes asap and switch to using a second per-thread slot as you suggested
Thanks i have responded to them appropriately,Please do check
i think "supported_bins" indeed sounds better but as you say i think it's not a good decision to change it now after it has been merged into 15(i was not aware of that at that time) so i agree with going with "exec list" but it has high chances to confuse an user about the difference between "exec paths" and "exec list",perhaps the manpage can be amended to note the distinction for clarity?
currently that is correct ,as the code currently is there is very little gain from a blacklist but the reason i added it is because i am planning to extend this feature in future to use mac_veriexec to check the hash alongside the path of whatever is to be exec'd but doing that in practice would require some things to change such as building and shipping the mac_veriexec module by default(it's currently disabled by default) as such i have kept the mac_veriexec additions on hold for now and instead using it the way it is currently as a temperory resort
Comment Actions Have received notifications that you made updates. I'm mostly AFK until end of August, so please expect slow responses or no response at all until that point. Thanks for your patience. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||