aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2021-08-08 17:00:07 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2021-08-08 17:00:07 +0200
commit225e2d46b64d84aa08959036a1a6d03f1a22ef56 (patch)
treec13e96254758a9776867b91d35e07c8cbca4e2d6 /src/main.rs
parenteda0273c1b36b4959e5c61e3d209029e1d8de088 (diff)
downloadvdso-proxy-poc-225e2d46b64d84aa08959036a1a6d03f1a22ef56.tar.gz
vdso-proxy-poc-225e2d46b64d84aa08959036a1a6d03f1a22ef56.zip
cargo fmt + fix comments
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 400b2d7..b82abdc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-use goblin::elf::{Elf, program_header::PT_LOAD};
+use goblin::elf::{program_header::PT_LOAD, Elf};
use std::convert::TryFrom;
use vdso_proxy_poc::{Error, JmpPad, MapEntry, Mmap, VirtAddr};
@@ -113,7 +113,7 @@ fn main() -> Result<(), Error> {
};
// As an example, install a trampoline for the `__vdso_gettimeofday` symbol. The trampoline is
- // installed in the _old_ vdso pages, where the user code from the checkpoint image links to,
+ // installed in the _old_ vdso pages, where the user code from the checkpoint image binds to,
// and forwards the calls into the _new_ vdso pages.
let pad = JmpPad::to(orig_sym_addr);
// SAFETY: copy_sym_addr is a valid virtual address as we got it from the symbol lookup.
@@ -125,8 +125,7 @@ fn main() -> Result<(), Error> {
};
unsafe {
- // Mimic a call to `__vdso_gettimeofday` from user code which is still linked to the _old_
- // vdso.
+ // Mimic a call to `__vdso_gettimeofday` from user code which binds to the _old_ vdso.
// SAFETY: copy_sym_addr is a valid virtual address pointing to the `__vdso_gettimeofday`
// function.