Skip to content
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

Porting VMMAP to RawPOSIX #56

Merged
merged 81 commits into from
Feb 12, 2025
Merged
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
d9a3ba8
Changes from vmmap alice rawposix
ChinmayShringi Nov 25, 2024
5b13d4c
fix: revert removed lines
ChinmayShringi Nov 25, 2024
70fa146
fix: formatting
ChinmayShringi Nov 25, 2024
5a3ebbb
fix: rm new line
ChinmayShringi Nov 25, 2024
ef9e7ad
feat: new constants folder
ChinmayShringi Nov 25, 2024
a19b268
Merge pull request #57 from Lind-Project/feat-constants-fs
rennergade Nov 26, 2024
38d8a32
feat: update from raw-posix
ChinmayShringi Dec 4, 2024
bd567d7
fix: rm commented import
ChinmayShringi Dec 4, 2024
4114b0f
Merge branch 'main' into vmmap-alice
ChinmayShringi Dec 4, 2024
5190179
refactor: rm commented imports
ChinmayShringi Dec 4, 2024
7a39e8a
refactor: rm comments
ChinmayShringi Dec 4, 2024
b430229
feat: add check_and_convert_addr
ChinmayShringi Dec 9, 2024
4189fcf
feat: update cage in syscall
ChinmayShringi Dec 10, 2024
a6502f6
feat: added check addr convert comment
ChinmayShringi Dec 10, 2024
63879ba
feat: add comments
ChinmayShringi Dec 10, 2024
aaf64ab
Merge branch 'main' into vmmap-alice
Yaxuan-w Dec 16, 2024
23e500e
feat: build fixes
ChinmayShringi Dec 21, 2024
d9e67e1
feat: fixed build errors
ChinmayShringi Dec 21, 2024
d072008
feat: removed pendingsigset
ChinmayShringi Dec 21, 2024
ee7fd89
integrate mmap into pthread
qianxichen233 Dec 26, 2024
6172411
Merge branch 'fix-pthread' into mmap-impl
qianxichen233 Dec 26, 2024
d126835
Syscall security nacl alignment (#70)
ChinmayShringi Dec 28, 2024
aeb0ed0
fix: remove comments
ChinmayShringi Dec 29, 2024
eb9338a
fix: rm security
ChinmayShringi Dec 29, 2024
7ff9858
fix: rm todo
ChinmayShringi Dec 29, 2024
29d1d1d
revert: err panic
ChinmayShringi Dec 29, 2024
a244d12
fix: revert todo
ChinmayShringi Dec 29, 2024
f184378
fix: rm nacl comments
ChinmayShringi Dec 29, 2024
d3eeed3
fix: removed nacl
ChinmayShringi Dec 29, 2024
668dbc7
rm: space
ChinmayShringi Dec 29, 2024
67c1a5c
fix: rm interface:cage
ChinmayShringi Dec 29, 2024
5b70b4d
implement program break/integrate with glibc/implement file backed mmap
qianxichen233 Dec 29, 2024
2bfddcc
Merge branch 'fix-pthread' into mmap-impl
qianxichen233 Dec 29, 2024
c5b75a6
fix: rm interface
ChinmayShringi Dec 29, 2024
5dab647
feat: added address check
ChinmayShringi Dec 29, 2024
e86a5d6
feat: removed warnings
ChinmayShringi Dec 29, 2024
85e5e3e
revert: fxstat error
ChinmayShringi Dec 29, 2024
3d725af
Revert "feat: removed warnings"
ChinmayShringi Dec 29, 2024
b391388
rm: duplicate comment
ChinmayShringi Dec 30, 2024
c3ed5e0
Merge branch 'main' into vmmap-alice
qianxichen233 Dec 30, 2024
153836f
Merge branch 'main' into mmap-impl
qianxichen233 Dec 30, 2024
8381c85
Merge branch 'vmmap-alice' into mmap-impl
qianxichen233 Dec 30, 2024
27adcc3
clean up
qianxichen233 Dec 30, 2024
b9d6000
update comment
qianxichen233 Dec 30, 2024
9cdecd4
added test file for mmap and sbrk
qianxichen233 Dec 30, 2024
851ce5f
fixed incorrect handle of 32bit address
qianxichen233 Jan 3, 2025
1a23771
added some memory tests
qianxichen233 Jan 3, 2025
c617d91
Merge pull request #74 from Lind-Project/mmap-impl
rennergade Jan 5, 2025
a180b42
revert: max bound check
ChinmayShringi Jan 5, 2025
33d8184
Merge branch 'vmmap-alice' into syscall-security-nacl-alignment-squash
ChinmayShringi Jan 5, 2025
1ed0144
Merge pull request #71 from Lind-Project/syscall-security-nacl-alignm…
rennergade Jan 6, 2025
ac43ab3
fix: build errors return type
ChinmayShringi Jan 8, 2025
6b66c06
fix: resolved PR commets
ChinmayShringi Jan 8, 2025
61d75eb
fix: test case errors
ChinmayShringi Jan 9, 2025
6ba2660
feat: rm UDSOCK_CAPACITY from const
ChinmayShringi Jan 9, 2025
05f9fc7
fixed initial memory size
qianxichen233 Jan 10, 2025
0df98fa
Merge branch 'main' into vmmap-alice
ChinmayShringi Jan 14, 2025
1b7a811
fix: fixed build errors
ChinmayShringi Jan 15, 2025
64eb5fb
revert: removed check-and-convert-addr-ext function
ChinmayShringi Jan 23, 2025
606b1c9
feat: updated mmap test cases
ChinmayShringi Jan 27, 2025
3b3bb96
Merge pull request #91 from Lind-Project/revert-check-and-convert-add…
rennergade Jan 27, 2025
d32d07a
feat: update dispatcher mmap syscall
ChinmayShringi Jan 27, 2025
c91b4d5
feat: update dispatcher cage interface
ChinmayShringi Jan 27, 2025
379d504
feat: removed explicit flags
ChinmayShringi Jan 27, 2025
32c2526
feat: removed start_address
ChinmayShringi Jan 29, 2025
b804442
feat: added new line
ChinmayShringi Feb 4, 2025
816be2d
feat: added comment formatting
ChinmayShringi Feb 4, 2025
03e8868
clean up start address
qianxichen233 Feb 4, 2025
2739ee5
fix: remove comment headers
ChinmayShringi Feb 4, 2025
85614e0
Merge branch 'main' into vmmap-alice
qianxichen233 Feb 6, 2025
1fda11f
updated address checking for new syscalls (readlink/readlinkat/clock_…
qianxichen233 Feb 6, 2025
51d7f24
fix: remove unused constants
ChinmayShringi Feb 10, 2025
788dd54
rm: fs constatns
ChinmayShringi Feb 10, 2025
194743a
feat: add root
ChinmayShringi Feb 10, 2025
b3fa91a
rm: socket obj
ChinmayShringi Feb 10, 2025
89c83d3
Merge branch 'main' into vmmap-alice
ChinmayShringi Feb 10, 2025
8d1e3e2
feat: updated constant
ChinmayShringi Feb 11, 2025
ef31fb9
feat: added source before constants
ChinmayShringi Feb 11, 2025
3746f49
fix: removed hostname and blocktime
ChinmayShringi Feb 11, 2025
1f22d50
delete getifaddrs
qianxichen233 Feb 12, 2025
9fdc582
updated some comments
qianxichen233 Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added some memory tests
qianxichen233 committed Jan 3, 2025
commit 1a23771006374ec89c31b5d2450976e37917687e
2 changes: 1 addition & 1 deletion src/wasmtime/crates/wasmtime/src/runtime/vm/mmap.rs
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ impl Mmap {
assert!(start <= self.len() - len);

// lind-wasm: mmap prot is managed by rawposix
// self.sys.make_accessible(start, len)
// so we are skipping wasmtime's sys mmap here
Ok(())
}

13 changes: 13 additions & 0 deletions tests/unit-tests/memory_tests/deterministic/malloc_large.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

int main() {
// try with extremely large malloc
char *buf = malloc(0x10000000);

*buf = 42;
printf("%p: %d\n", buf, *buf);

return 0;
}
74 changes: 74 additions & 0 deletions tests/unit-tests/memory_tests/deterministic/mmap_complicated.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

int main() {
// Define the size of the shared memory
size_t mem_size = 1024;

// Create shared memory region using mmap
char *shared_mem = (char*)mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (shared_mem == MAP_FAILED) {
perror("mmap");
exit(EXIT_FAILURE);
}

// Fork a child process
pid_t pid = fork();
if (pid < 0) {
perror("fork");
munmap(shared_mem, mem_size);
exit(EXIT_FAILURE);
}

if (pid == 0) {
// Child process
printf("Child: Writing to shared memory.\n");
const char *child_message = "Hello from the child process!";
strncpy(shared_mem, child_message, mem_size);

// Sleep to simulate some work
sleep(2);

printf("Child: Reading from shared memory: '%s'\n", shared_mem);

// Unmap shared memory in the child
if (munmap(shared_mem, mem_size) != 0) {
perror("munmap in child");
exit(EXIT_FAILURE);
}

printf("Child: Exiting.\n");
} else {
// Parent process
printf("Parent: Waiting for child to write.\n");

// Sleep to simulate waiting for the child
sleep(1);

printf("Parent: Reading from shared memory: '%s'\n", shared_mem);

const char *parent_message = "Hello from the parent process!";
strncpy(shared_mem, parent_message, mem_size);

// Wait for the child to finish
wait(NULL);

printf("Parent: Reading modified shared memory: '%s'\n", shared_mem);

// Unmap shared memory in the parent
if (munmap(shared_mem, mem_size) != 0) {
perror("munmap in parent");
exit(EXIT_FAILURE);
}

printf("Parent: Exiting.\n");
}

return 0;
}