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

Add kernelCTF CVE-2023-3609 #48

Merged
merged 12 commits into from
Jan 12, 2024
Merged

Conversation

d4em0n
Copy link
Contributor

@d4em0n d4em0n commented Sep 8, 2023

No description provided.

@google-cla
Copy link

google-cla bot commented Sep 8, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@koczkatamas koczkatamas force-pushed the master branch 2 times, most recently from d8211d8 to 22b1cba Compare October 20, 2023 09:30
@d4em0n
Copy link
Contributor Author

d4em0n commented Nov 14, 2023

@koczkatamas we fix the comments already

Copy link
Collaborator

@koczkatamas koczkatamas left a comment

Choose a reason for hiding this comment

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

See the requested changes below.

0x0000000100000000, 0x0001000000010010,
0x0000000000000000};

size_t payment[] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a comment on how did you get these values.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also using a variable name like ctnetlink_filter_payload would increase readability.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And mentioned that the purpose of this is to spray a kmalloc-128 structure ctnetlink_filter while setting 0x60 offset via CTA_MARK and CTA_MARK_MASK to 0xfffffe000003df58 which the address of CPU#1 cpu_entry_area's entry_stack_page (stack address).

char *core = (void *)mmap((void *)0xa00000, 0x2000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED | MAP_ANON, -1, 0);
strcpy(core, "|/proc/%P/fd/666"); // put payload string into known address which will used by ebpf shellcode

int sp = socket(0x10ul, 3ul, 0xc); // later use this socket to spray struct ctnetlink_filter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use known constant values instead of 0x10, 3, 0xc or comment the meaning of these values.

@koczkatamas koczkatamas merged commit 3e65ad5 into google:master Jan 12, 2024
7 checks passed
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.

2 participants