Oct 9 2024
This will end up being a port.
Sep 1 2023
Aug 31 2023
sys/contrib is good for this, but sys/gnu might be even better since it is GPL'd.
Jul 26 2023
Jul 17 2023
ld: error: undefined symbol: arp_ifinit
this issue is fixed in latest code in a commit last week https://github.com/freebsd/freebsd-src/commit/5684c8783b64e33f0dab058126b36776adcc8e82
Jul 16 2023
Can you please point to correct kernel config to be used?
updated the variable declaration and scope considering NO-INET, NO-INET6, NO-IP.
Jul 15 2023
- ident GENERIC + include LINT-NOINET + include LINT-NOINET6 + include LINT-NOIP + ident MYKERNEL
Someone should do (at least) an amd64 universe build for this to make sure the NO-INET NO-INET6 NO-IP (do we still have that) builds are surviving.
LGTM, but as I don't have a src bit I can't commit this. Anybody else willing to do that?
Jul 8 2023
Melifaro's point about avoiding parsing in the kernel is a good one. What do you think could be improved here?
- Implemented recommended changes
- Made style changes
- modifed the rules_check function to traverse the list in reverse order and stop when first applicable rule (matching IP address) is found. Since, rules defined later determine have higer priority, checking last matching rule is enough.
Jul 6 2023
If you're going to change format, why not use tree, as it feels natural for sysctl. One existing example would be dev.pcm.<number> so following that, we could have security.mac.ipacl.<jid>.<rule> and .family and .address (or maybe .range) as leafs. It is not set in stone that it has to be like that, but given it's sysctl, it feels more natural to me, so please give it a thought. Also, as it is about jail, it would also feel more natural to have this tunables under security.jail.<jid>
The @ character is visually quite large and makes it hard to scan and read for a human.
Jul 3 2023
Manual page LGTM now, will rereview once the source code is finalized.
Jul 2 2023
Overall is a really nice addition and I'd love to have it in base. I have one concern on the rule import/export implementation - happy to discuss this further & left a couple of non-critical comments on the code.
Thank you for working on this!
Jul 1 2023
- rebased the code on top of latest src changes
- made changes to man page as suggested in comments
Jun 19 2023
Hi,
thanks for the comments.
I'll test my patch and wil apply the suggested changes in man page.
Thanks
Jun 16 2023
Some nits in the manual page, which can probably be fixed in a follow-up commit (with .Dd bumped) if the code still works.
Jun 14 2023
Jan 21 2021
This appears to have been accepted but not merged - it would be great to have it get into 13.0 if there's still time
Sep 12 2020
Sep 11 2020
Audit support for regular lookup starts with AUDIT_ARG_UPATH1_VP/AUDIT_ARG_UPATH2_VP without any vnodes locked. Later on visited vnodes get added with AUDIT_ARG_VNODE1/AUDIT_ARG_VNODE2 which only performs VOP_GETATTR (i.e. does *NOT* resolve any paths). Your code should follow the same scheme.
Sep 10 2020
I feel vfs_cache.c changes for making vn_fullpath_global work for optionally locked vnode are causing the trouble. Though I'm not sure what's the problem. I request Mateusz Guzik, @mjg to have a look at my vfs_cache.c changes. I would be grateful for your time.
Sep 7 2020
The new code looks better. But grrr, there are two big problems:
- It doesn't compile due to some recent changes on head. I suggest the following:
- Remove the <rpc/rpc.h>, <sys/mount.h>, and <fs/nfs/*> includes from audit.h. In addition to fixing the compile failure, it's generally not recommended to include headers from other headers. Sometimes it's necessary, but it also causes header pollution, and slow build times. Instead of including those files, just forward declare struct nfsrv_descript; and struct kaudit_record;.
- Add `<netinet/in.h>, <rpc/rpc.h>, <fs/nfs/nfsdport.h>, <fs/nfs/nfsproto.h>, and <fs/nfs/nfs.h> to audit_bsm_db.c
- Add <rpc/rpc.h>, <fs/nfs/nfsport.h>, <fs/nfs/nfsproto.h>, and <fs/nfs/nfs.h> to audit.c
- merge vn_fullpath_any and vn_vptocnp with their locked counterpart to work for optionally locked vnodes.
Sep 6 2020
Aug 31 2020
I created a new review - D26243. Sorry for the trouble.
It was earlier being reviewed on D25869. But due to change of base revision, It was showing changes which were not mine. So, I created a new review here.
Aug 30 2020
It looks like your most recent change rebased the base revision. That makes it very hard to see which changes are from you and which aren't. Could you please either un-rebase it or, if that's not possible, open a new review?
Using two completely separate functions reduces the scope of error. Also prevent any mutation to the current code path for not locked vnodes, while allowing it to work for locked vnodes.
Aug 28 2020
- updated sys/kern/vfs_cache.c to reduce code duplication with vn_fullpath_dir
- some trivial changes
Aug 20 2020
Regarding code duplication in vn_fullpath_dir_locked:
I modified vn_fullpath_dir(and removed vn_fullpath_dir_locked) for optionally locked vnode here in git commit: https://github.com/shivankgarg98/freebsd/commit/418c1c2a6de9989fe7a541f6111ee2c3f2786c7b
It works fine NFSv4=3 case but somehow breaks nfsrvd_open to result in an error.{and hence can't open/create a regular file from client}.
Using two completely separate functions reduces the scope of error. Also prevent any mutation to the current code path for not locked vnodes, while allowing it to work for locked vnodes.
follow-up on suggested changes.
Aug 19 2020
This is a much better locking strategy. However, there's a lot of duplicated code. Could you maybe combine the _locked with the original functions, so there wouldn't be so much duplication?
Aug 4 2020
removing unlocking/relocking implementation for vnode for auditing path, instead, define separate functions in vfs_cache.c for locked vnode as argument.