ioi / isolate

Sandbox for securely executing untrusted programs
Other
1.05k stars 157 forks source link

Cannot set memory.limit_in_bytes to 102404096 #105

Closed mraron closed 2 years ago

mraron commented 2 years ago

After I initialize a cgroups isolate box if I execute the following command:

$ isolate --cg --cg-timing -b 500  --mem=1000000 --cg-mem=100003 --run -- ./a.out <<< "2 5"

It executes correctly, but if I set the --cg-mem parameter any higher it wont, printing the following error:

Cannot set /sys/fs/cgroup/memory/box-500/memory.limit_in_bytes to 102404096
: Invalid argument

I (not so) recently upgraded from ubuntu 20.10 to 21.04 (so 5.11 kernel) I haven't really used isolate since so I'm assuming the upgrade caused this issue, because commands like this ran fine in the old version. I also tested it right now on a server with 5.4 kernel and it didn't complain either. Has anyone experienced something like this?

mraron commented 2 years ago

It definitely seems like it has to do something with the kernel because when I boot with a 4.13 kernel it works fine.

aswinashok44 commented 2 years ago

I also ran into the same issue, I have opened a PR to fix it. Here it is: https://github.com/ioi/isolate/pull/109 You can find more details in the PR description

gollux commented 2 years ago

Hopefully solved, see the PR.

mraron commented 2 years ago

Yes it's solved, closing the issue.