ssrg-vt / dynacut Goto Github PK
View Code? Open in Web Editor NEWDynaCut: Dynamic and Adaptive Code Customization with Process Rewriting.
License: MIT License
DynaCut: Dynamic and Adaptive Code Customization with Process Rewriting.
License: MIT License
It is a one-click process to disable the PUT and DELETE methods in the CRIU image. Here is the todo list:
int3
instruction to the PUT/DELETE method of the lighttpd.In this README, it's not clear what is the signal restorer address and how to find it. Is it possible to script everything?
Is it possible to only specify the libhandler.so
with its path as one parameter. Something like: -sighandler /home/abhijit/criu-dump/elf_loader/libhandler.so
sudo ~/SSRG/PopSnapshot/criu_modified/crit/crit ash -d . -dl /home/abhijit/criu-dump/elf_loader -name libhandler.so -ha 0x7f0000001139 -ra 0x7f5ace2c3210 -vsa 0x7f0000000000
LLVM stack map format:
https://llvm.org/docs/StackMaps.html#stack-map-format
Task: Remove the lighttpd PUT or POST feature by rewriting the CRIU image.
nop
or int3
Expect to see:
tmpfs
RAM disk.Commit: 9355387
BUG 1: Directory need '/'
❯ ./criu_modified/crit/crit addvma -d simple.checkpoint.deedbeef -sa 0x1000 -ea 2000 -rs 1
Traceback (most recent call last):
File "./criu_modified/crit/crit", line 6, in <module>
cli.main()
File "/home/xiaoguang/git_repo/github/PopSnapshot/criu_modified/crit/pycriu/cli.py", line 418, in main
opts["func"](opts)
File "/home/xiaoguang/git_repo/github/PopSnapshot/criu_modified/crit/pycriu/cli.py", line 55, in addvma
pycriu.add_vmas.add_vma_regions(start_address, end_address, nr_pages, directory)
File "/home/xiaoguang/git_repo/github/PopSnapshot/criu_modified/crit/pycriu/add_vmas.py", line 83, in add_vma_regions
with open(str(filepath + pgmap_file[0]), mode='rb') as f:
IOError: [Errno 2] No such file or directory: 'simple.checkpoint.deedbeefpagemap-19652.img'
BUG 2: Not handling empty parameter case. I have no idea how to use the option addvma
until I looked into the code.
❯ ./criu_modified/crit/crit addvma
Traceback (most recent call last):
File "./criu_modified/crit/crit", line 6, in <module>
cli.main()
File "/home/xiaoguang/git_repo/github/PopSnapshot/criu_modified/crit/pycriu/cli.py", line 418, in main
opts["func"](opts)
File "/home/xiaoguang/git_repo/github/PopSnapshot/criu_modified/crit/pycriu/cli.py", line 55, in addvma
pycriu.add_vmas.add_vma_regions(start_address, end_address, nr_pages, directory)
File "/home/xiaoguang/git_repo/github/PopSnapshot/criu_modified/crit/pycriu/add_vmas.py", line 83, in add_vma_regions
with open(str(filepath + pgmap_file[0]), mode='rb') as f:
IndexError: list index out of range
❯ ./criu_modified/crit/crit
usage: crit [-h] {decode,encode,info,x,show,addvma} ...
crit: error: too few arguments
❯ ./criu_modified/crit/crit info
usage: crit info [-h] in
crit info: error: too few arguments
We can use the tracer from the razor project. In that project, the tracer records a list of basic blocks that are executed (a CFG). Maybe we can extend it to find the initialization CFG and remove it.
We need a (python) tool similar to crit to edit the CRIU saved files. With that tool we can have the following capabilities:
pages.img
and update the value in pages.img
.pages.img
and reassemble the code into the raw data. Using capstone or dynamorio.Currently, the naming of crit feature cutting is unclear. Rename it as ./crit edit insert {sighandler,int3} ...
Injecting a new signal handler, with a new put
libc call got error.
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
void trap_handler(int sig)
{
printf("--- Printing ---\n");
printf("The signal is: %d\n", sig);
exit(1);
}
When updating the rewriting process (-ha
), the kernel captured the int3
not the signal handler.
❯ ./criu_modified/crit/crit ash -d ./my_dump -dl /home/xiaoguang/works/proc-edit/PopSnapshot/tests/handler_example \
-name sighandler.so -ha 0x7f0000001159 -ra 0x7f5ace2c3210 -vsa 0x7f0000000000
The json file is also updated:
❯ cat my_test1/plt-file.json
{
"entries":[
{
"name": "puts",
"libc_offset": "0x875a0",
"plt_address": "0x4018"
},
{
"name": "printf",
"libc_offset":"0x64e10",
"plt_address":"0x4020"
},
{
"name": "exit",
"libc_offset":"0x49bc0",
"plt_address":"0x4028"
}
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.