-
Notifications
You must be signed in to change notification settings - Fork 449
feat(events): create access_remote_vm event #3551
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
Closed
AlonZivony
wants to merge
10
commits into
aquasecurity:main
from
AlonZivony:feature/proc-mem-operations
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
491ba04
feat(events): add probe relevance attribute
AlonZivony 0854a88
feat(ebpf): support 7 arguments saving for kretprobe
AlonZivony fd6e01a
feat(events): create access_remote_vm event
AlonZivony 789bd69
test(events): add e2e test to access_remote_vm
AlonZivony c9c8273
Test failing e2e tests
AlonZivony c5d50e8
Test defining arg7 only for x86
AlonZivony f3a4730
Test defining arg7 only for x86
AlonZivony 57e07ed
Use more unique names for macro vars and avoid warning during build
AlonZivony 65c6f4e
Support new versions
AlonZivony de5827f
Create an event for each VMA accessed
AlonZivony File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,34 @@ | ||
# access_remote_vm | ||
|
||
## Intro | ||
access_remote_vm - gain access to the virtual memory of a separate process through the use of the procfs mem file. | ||
|
||
## Description | ||
This event marks access attempt of a process to the virtual memory of another process using the procfs mem file associated with that specific process (/proc/<pid>/mem). | ||
It is a more elaborated event than the `security_file_open` of the mem file. | ||
|
||
## Arguments | ||
* `remote_pid`: `int`[K] - PID of the process the memory area belongs to. | ||
* `start_address`: `void *`[K] - Start address of the operation. | ||
* `gup_flags`: `unsigned int`[K] - Flags for get_user_pages operation. | ||
* `vm_flags`: `unsigned long`[K] - Virtual memory flags. | ||
* `mapped.path`: `const char*`[K] - Path of the mapped file, or the name of memory area if no file is mapped. | ||
* `mapped.device_id`: `dev_t`[K,OPT] - Device ID of the mapped file. | ||
* `mapped.inode_number`: `unsigned long`[K,OPT] - Inode number of the mapped file. | ||
* `mapped.ctime`: `unsigned long`[K,OPT] - Creation time of the mapped file. | ||
|
||
## Hooks | ||
### get_user_pages_remote | ||
#### Type | ||
kprobe + kretprobe | ||
#### Purpose | ||
The main function that implements the access to the virtual memory area of the other process. | ||
|
||
### generic_access_phys | ||
#### Type | ||
kprobe | ||
#### Purpose | ||
A fallback function, implementing the `access` method of the `vma_operations` struct for most of the vmas. It is used to access special memory areas. | ||
|
||
## Related Events | ||
`security_file_open`,`security_mmap_file`,`vfs_write`,`vfs_writev`,`vfs_read`,`vfs_readv` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.