-
Notifications
You must be signed in to change notification settings - Fork 349
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
Commits on Sep 19, 2024
-
restructure i386 syscalls code in syscall lists
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c386ebe - Browse repository at this point
Copy the full SHA c386ebeView commit details -
SyscallVal: add some simple tests
Signed-off-by: Kornilios Kourtis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dc3ce82 - Browse repository at this point
Copy the full SHA dc3ce82View commit details -
observer_test_helper: properly clenup base sensor
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 323a835 - Browse repository at this point
Copy the full SHA 323a835View commit details -
misc: rename dup test policies
Rename some of the policies to better reflect the tests. Signed-off-by: Kornilios Kourtis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3b3ca88 - Browse repository at this point
Copy the full SHA 3b3ca88View commit details -
testEnforcer: refactor test helper
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cdb798c - Browse repository at this point
Copy the full SHA cdb798cView commit details -
tester-progs: build enforcer-tester-32 for ARM
Requires arm-linux-gnuabihf-gcc cross-compiler. Signed-off-by: Kornilios Kourtis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b82a158 - Browse repository at this point
Copy the full SHA b82a158View commit details -
gh: install gcc for 32-bit ARM
Also, do a single apt-get update. Signed-off-by: Kornilios Kourtis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for af52ce5 - Browse repository at this point
Copy the full SHA af52ce5View commit details -
syscallinfo: add ARM32 syscall ids
Also, don't constrain building i386 ids in amd64. This will be used later in tests. Signed-off-by: Kornilios Kourtis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8bba71f - Browse repository at this point
Copy the full SHA 8bba71fView commit details -
arm64: support 32-bit syscalls
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fd94b63 - Browse repository at this point
Copy the full SHA fd94b63View commit details -
enforcer_tests: test arm32 syscalls
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 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 051f50e - Browse repository at this point
Copy the full SHA 051f50eView commit details