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-6931_mitigation #141

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Sechack06
Copy link

No description provided.

Copy link

google-cla bot commented Nov 29, 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.

@koczkatamas koczkatamas force-pushed the master branch 3 times, most recently from 933028d to c111d81 Compare March 3, 2025 14:31
@koczkatamas koczkatamas force-pushed the master branch 13 times, most recently from 76d6b57 to bf0d68f Compare March 13, 2025 15:39
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.

Hey,

This is just a quick code quality review. We're planning to review the submissions more deeply (actually understanding what the exploit does) in two weeks.

In general, the code in its current form does not match the requirements to be reviewed or accepted. Please follow our (draft) style guide to fix your code: https://google.github.io/security-research/kernelctf/style_guide. Also make sure you are meeting the documentation requirements of the rules.

I've left a few explicit comments too, but it's not enough to only fix those.

Thanks for the submission and PR!

};

struct read_format {
__u64 value; // 카운터 값
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 English in the code. See more details here.

}

void spray(){
char *fname = "/tmp/zzlol";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please refactor and/or rewrite your code and make it clearer what you are building here following our style guide.

pe1.exclude_hv = 1;
event = perf_event_open(&pe1, 0, -1, group_leader, 0);
if (event == -1) {
perror("asdf");
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 descriptive error messages, what went wrong.

pid_t parent_pid;
parent_pid = getpid();
pid_t child_pid = fork();
if(fork < 0) puts("fail");
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 more descriptive error messages, what went wrong e.g. sibling fork failed.

}
}
kill(parent_pid, SIGUSR1);
sleep(999999);
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 here what you are waiting for (which kernel function). See more details here.

}
}
kill(parent_pid, SIGUSR1);
sleep(999999);
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 here what you are waiting for (which kernel function). See more details here.

sleep(999999);
}
pause();
for(int i = 0; i < (0x10000/0x10+0x2000/0x10)-2000; i++){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please explain this iteration count and calculation in more details.

struct xattr_return *xret = read_xattr("/tmp/zzlol", name);

printf("[+] xattr size: 0x%lx\n", xret->size);
uint64_t kpage = ((uint64_t *)xret->value)[0x7fc];
Copy link
Collaborator

Choose a reason for hiding this comment

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

perror("setxattr");
}

memset(y, 'y', 0x40);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please explain in more details what you are building here. Follow the recommendations from our style guide.

puts("[+] Spraying xattr");
spray();
char *fname = "/tmp/zzlol";
char *z = "zzlol1994";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix this code following the style guide.

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