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-3777 (lts) #85

Merged
merged 6 commits into from
May 2, 2024

Conversation

kevinrich1337
Copy link
Contributor

No description provided.

Copy link

google-cla bot commented Feb 24, 2024

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.

pocs/linux/kernelctf/CVE-2023-3777_lts/docs/exploit.md Outdated Show resolved Hide resolved
- Create a rule in `Vulnerable` with an immediate expr referencing `Victim`.
- Trigger the vulnerability by flushing the rule. This results in the `Victim` having a reference count of -1.
- Create an immediate expr in `Base` that references to the Victim, making the `Victim`'s reference count 0, and destroy the `Victim`.
- Spray counter exprs (struct expr) to place it at `Victim`'s chain->name. At this time, the counter exprs are allocated in the `kmalloc-cg-16`.
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 the exact structure names, you are referring to struct nft_expr by saying struct expr, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I updated this to the exploit.md.

pocs/linux/kernelctf/CVE-2023-3777_lts/docs/exploit.md Outdated Show resolved Hide resolved
err(1, "mnl_socket_send");
}

usleep(100*1000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are you waiting here? What happens in the kernel you are waiting for? Can you make a comment about this? (Same for all usleep calls.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since free is called from destroy worker, it waits for worker to finish. I added comments to the exploit.c and removed unnecessary sleeps.

char * chain1_name = "chain1";
char * chain2_name = "chain2";
char * chain3_name = "chain3_12341234";
char * chain4_name = "chain4_1234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234123412341234";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please comment on this why you choose this long name. (It's 131 bytes, so you'd like to allocate in kmalloc-cg-192?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The long name is used to allocate object in kmalloc-cg-192. I added comment about this to exploit.c

@koczkatamas koczkatamas merged commit 997724c into google:master May 2, 2024
5 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.

3 participants