Skip to content

test(iso1-memory): add cross cage memory isolation tests - #1313

Open
lionne99 wants to merge 2 commits into
Lind-Project:mainfrom
lionne99:cross-cage-isolation-tests
Open

test(iso1-memory): add cross cage memory isolation tests#1313
lionne99 wants to merge 2 commits into
Lind-Project:mainfrom
lionne99:cross-cage-isolation-tests

Conversation

@lionne99

Copy link
Copy Markdown
Contributor

Adds tests covering cross-cage memory isolation ISO-001.

Tests added:

  • cross_cage_fork_no_leak.c

    • verifies forked cages do not share writable memory
    • checks isolation across heap and mmap
  • cross_cage_syscall_efault.c

    • verifies invalid syscall buffers are rejected with EFAULT
  • cross_cage_wild_pointer.c

    • verifies out-of-bounds pointers cannot access memory outside the cage

All tests were tested locally.

@lionne99

Copy link
Copy Markdown
Contributor Author

@Yaxuan-w @vidyalakshmir for review

@Yaxuan-w

Copy link
Copy Markdown
Member

@Uk-jake Do you have any idea on why the results doesn't being published as comment here? Thanks

@Uk-jake

Uk-jake commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@Uk-jake Do you have any idea on why the results doesn't being published as comment here? Thanks

Not sure, but it might be because it's a PR from a fork. I'll take a look

-1, 0);

assert(invalid != MAP_FAILED);
assert(munmap(invalid, REGION_SIZE) == 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe using sth like:

unsigned char *invalid = mmap(NULL, REGION_SIZE, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);

(volatile unsigned char *)malloc(64);

if (ptr == NULL)
return 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup failure should return 0 to indicate this error is not intended

free((void *)ptr);

return 0;
} No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line


printf("cross_cage_syscall_efault test: PASS\n");
return 0;
} No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line


printf("cross_cage_fork_no_leak test: PASS\n");
return 0;
} No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we can merge this test into invalid_access_direct.c

@Yaxuan-w Yaxuan-w changed the title Add cross cage memory isolation tests test(iso1-memory): add cross cage memory isolation tests Aug 24, 2026
@lionne99
lionne99 requested a review from Yaxuan-w August 24, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants