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

Run the isolate_check_environment script on startup #85

Open
minhnhatnoe opened this issue May 15, 2023 · 4 comments
Open

Run the isolate_check_environment script on startup #85

minhnhatnoe opened this issue May 15, 2023 · 4 comments
Labels
cat:admin Related to the admin panel cat:user Related to the User UI enhancement New feature or request priority:medium Medium priority: Mostly for next minor
Milestone

Comments

@minhnhatnoe
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Many users of the isolate sandbox are not aware of the isolate_check_environment script. This script checks for system settings that may introduce variability between different judging attempts. The script also asks the user to turn off swap or turn on swap accounting, which is essential to measuring the memory limits.

Describe the solution you'd like

Even if the user is not using isolate, this script is still needed to ensure consistency. I suggest running this script every time kjudge is started on a linux machine.

Since we are not sure of the script's location on the user's machine, it can probably be embedded into the executable.

@minhnhatnoe minhnhatnoe added the enhancement New feature or request label May 15, 2023
@natsukagami
Copy link
Owner

Aside: urge the container user to disable swap inside the container: https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details

@natsukagami
Copy link
Owner

Note that disabling ASLR is a security risk, and you usually don't want to turn this off. Sure it increases the consistency of the judging process, but also makes another attack vector possible, as you cannot disable it on a per-container level.

@natsukagami natsukagami added cat:user Related to the User UI cat:admin Related to the admin panel priority:medium Medium priority: Mostly for next minor labels May 15, 2023
@natsukagami natsukagami added this to the v1.0.0 milestone May 27, 2023
@minhnhatnoe
Copy link
Contributor Author

Aside: urge the container user to disable swap inside the container: https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details

I think the solution for this would be providing a docker-compose.yml file.

@minhnhatnoe
Copy link
Contributor Author

Note that disabling ASLR is a security risk, and you usually don't want to turn this off. Sure it increases the consistency of the judging process, but also makes another attack vector possible, as you cannot disable it on a per-container level.

I think there is no "clean" way to do it for containers. But if the user runs the executable directly, then I think we can use the -R flag of setarch? From what I have read, this command applies the property to the process and all of its subprocesses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:admin Related to the admin panel cat:user Related to the User UI enhancement New feature or request priority:medium Medium priority: Mostly for next minor
Projects
None yet
Development

No branches or pull requests

2 participants