-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support 32-bit ARM (aarch32) syscalls #2898
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
a69eab3
to
691603b
Compare
Checkpatch failure is on existing code:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, to be fair the first commit is tricky to review, the list code is a bit hard to read (apart from new syscall_list.go). Do we have tests that cover policies with list usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. Just a couple nits, aside from the typos @mtardy already pointed out. Pre-approving now.
syscall lists are used so that we can have a common place to define: syscall ids for the tracepoint hook filtering, and syscall function symbols for the enforcer. The previous implementation of i386 syscalls in these lists was using the fact that (most) of the i386 syscalls are implemented using functions prefixed by __ia32_sys. This, however, is not true for ARM where most system calls have the same implementation for aarch32 and aarch64 and their prefix is __arm64. This means that for arm, we cannot determine the ABI of a system call from its function. Morover, x86_64 has two 32-bit abis: i386 and x32, and we might, eventually, want to add supoprt the latter. This patch reworks the code of the syscall lists. In syscall lists, users can now use the abi/ prefix (e.g., i386/) to specify system calls under a specific ABI. The commits adds a new SyscallVal type which represents values in a system call list. For this type, we imlement the two required methods: - ID(): get the id of the system call to pass in BPF - Symbol(): get the symbol that corresponds to the implementation of the syscall Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
During a test failure, where loading a sensor failed, the next test would also fail because the base sensor existed already. Fix this by registering a cleanup function to unload the base sensor rogjt after we load it. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Rename some of the policies to better reflect the tests. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
refactor the enforcer tester so that it can accept more than two arguments. Also, allow for having different check functions for each command. Finally, pass the test context from where the check actually happens. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Requires arm-linux-gnuabihf-gcc cross-compiler. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Also, do a single apt-get update. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Also, don't constrain building i386 ids in amd64. This will be used later in tests. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
This commit adds support for 32-bit syscalls in arm64. The commit, using what was added in previous patches, adds support for an arm32 ABI. (Tecnically, I believe the ABI should have been named aarch32 ABI, but arm32 seems clearer) Most of the 32-bit system calls use the same function as their 64-bit counterparts. So for now we just add a __arm64 prefix to get the symbol. For cases where this does not work, users would have to add the specific symbol on their own. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
Previously, the 32-bit syscall enforcer tests were only done in amd64 because we did not supported 32-bit syscalls in arm64. This patch modifies these tests to also test arm64 32-bit calls. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
691603b
to
051f50e
Compare
Thanks for the reviews! |
This PR adds support for dealing with 32-bit ARM syscalls on arm64.
See patches.