forked from qmonnet/rbpf
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for static syscalls (#296)
This adds support for static, relocation-less syscalls using the same mechanism as upstream BPF: - CALL_IMMs with src=0 are considered syscalls, where the .imm field is the murmur32 hash of the syscall name - CALL_IMMs with src=1 are considered bpf-to-bpf calls
- Loading branch information
1 parent
6abf946
commit 97488d2
Showing
12 changed files
with
237 additions
and
67 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
typedef unsigned long int uint64_t; | ||
typedef unsigned char uint8_t; | ||
|
||
// 1811268606 = murmur32("log"); | ||
static void (*log)(const char*, uint64_t) = (void *) 1811268606; | ||
|
||
extern uint64_t entrypoint(const uint8_t *input) { | ||
log("foo\n", 4); | ||
|
||
return 0; | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
typedef unsigned long int uint64_t; | ||
typedef unsigned char uint8_t; | ||
|
||
static void (*i_dont_exist)() = (void *) 42; | ||
|
||
extern uint64_t entrypoint(const uint8_t *input) { | ||
i_dont_exist(); | ||
|
||
return 0; | ||
} |
Binary file not shown.
Oops, something went wrong.