Summary: | mdo: failed to call initgroups: Operation not permitted | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Jose Luis Duran <jlduran> | ||||
Component: | kern | Assignee: | Olivier Certner <olce> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | bapt, emaste, olce | ||||
Priority: | --- | ||||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Jose Luis Duran
![]() ![]() Created attachment 254060 [details]
WIP: Not thoroughly tested
- mac_do: Allow a gid-only rule to any
- mac_do: Avoid locking around vn_fullpath()
- mac_do: check if freebuf is non-NULL before freeing
This is my weekly progress on this bug. I would like to test it further, and familiarize with the code a bit more before submitting it for review.
Posting it here just in case it is of any help.
Tests:
As 'root' issue:
# kldload mac_do
# sysctl security.mac.do.rules=gid=0:any [1]
# sysctl security.mac.do.rules=gid=1001:any [2]
A user 'freebsd' already exists with a GID 1001 and belongs to 'wheel':
$ mdo pkg upgrade [1] [2]
Updating FreeBSD repository catalogue...
...
Hello Jose, There are several code and conceptual problems in the current implementation of mac_do(4), and I would advise not to use it in a production setup yet. I have been working on a full revamp of it. Prerequisite commits (about general infrastructure changes) are already under review, and the bulk of if (changes in mac_do(4)) proper will soon follow (an earlier version can be globally seen at https://github.com/freebsd/freebsd-src/compare/main...OlCe2:freebsd-src:oc-mac_do). As you can see there, the format of the rules specification in `security.mac.do.rules` has been changed. Thanks and regards. (In reply to Olivier Certner from comment #2) Thank you for sharing this information. I'll be glad if you can test, or even review, the changes in their final form. If you are OK, I can add you to the upcoming reviews. In any case, I intend to update the GitHub series above next (still working with reviewers on the prerequisite ones), and will post an update here so that interested people can test. (In reply to Olivier Certner from comment #4) Yes, I am installing this branch as we speak. Thank you! This bug can be closed as FIXED by review D47304. (In reply to Olivier Certner from comment #4) (In reply to Jose Luis Duran from comment #5) Hi Jose, I have added you as a subscriber to differential revisions concerning the revamped mac_do(4). If you have some time and interest, please review what you can. If you find it more convenient, the full series of commits (including some prerequisites mostly reviewed and some not really related commits) is also available at my GitHub (https://github.com/freebsd/freebsd-src/compare/main...OlCe2:freebsd-src:oc-mac_do; the 'oc-mac_do' branch has been updated). I've just noticed that you added yourself to D47633 (the "umbrella" revision), great. If, on the other hand, you're annoyed to have been added as a subscriber to all incremental changes, don't hesitate to say so and I'll remove these subscriptions. (In reply to Olivier Certner from comment #7) No problem at all. Thank you! I'll take a look. |