-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use cgroup_skb programs for payload inspection
Before this change, we were using LSM programs attached to `sock_recvmsg` and `sock_sendmsg` hooks for this purpose. We were using `iov_iter` to read the payload. Unfortunately, torvalds/linux@747b1f6 (which landed in kernel 6.4) broke the `iov_iter` API in completely backwards-incompatible way, which can't be handled by any of CO-RE helpers while using an `iov_iter` definition from any kernel. Initially, we aimed to handle this incompatibility by introducing a pre-6.4 compat header and trying to cast the types. That seemed to work, but unfortunately, verifiers in 5.x kernels are unhappy about this solution. Therefore, this change drops the idea of intercepting payloads with LSM all together and instead uses cgroup_skb for the same purpose. There is no way `__sk_buff` is going to introduce any breaking changes in regards to accessing the packet data.
- Loading branch information
1 parent
6ddc920
commit 81c3372
Showing
4 changed files
with
284 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.