33 Commits

Author SHA1 Message Date
Patrick Quist
f2634ef671 nvidia fix 2025-08-28 22:21:34 +02:00
Matt Godbolt
1c918c3366 Mg/cefs mount prop (#8033)
makes the root bindmount a "slave" which means it gets all host mount
point change notifications, needed for cefs automounting. Security
tradeoffs mentioned in compiler-explorer/nsjail#2
2025-08-14 17:09:07 -05:00
Matt Godbolt
56753543d7 Mount cefs into the jails (#8030)
This _maybe_ shows an issue - users could find _anything_ in cefs so we
need to make sure we don't ever put privileged stuff in cefs.
2025-08-14 10:11:33 -05:00
Matt Godbolt
7d4f77d84a Misc fixes for unbuffering (#7404)
- Wrap the executable in `stdbuf` higher up than in `executeDirect`
which means we run `stdbuf` _inside_ the jail instead of outside it when
running. This fixes jail/stdbuf interactions.
- Install `which` types to avoid a `no-ts`
- Ensure `stdbuf` et al is mapped in compilers-and-tools
- As a fly-by also unify the configuration of NVidia devices between
execution and compilation.
2025-02-18 15:17:15 -06:00
Matt Godbolt
6b04922347 Changes for newer NVidia drivers (#7362)
Mounts some newer `/dev` and `/sys` directories needed by the newer
NVidia drivers into the sandbox. Also make `/proc` read-write which is
needed as the driver writes to `/proc/self/task/tid/comm` to try and
change its name.

CC @rwarmstr

I don't believe there's a security risk in making `/proc` writeable,
though it's annoying that the NVidia process actually errors on the
inability to rename its own process name.
2025-02-03 10:55:45 -06:00
Matt Godbolt
a5aad3c48c Let user execution stdbuf (#7307)
Currently only maps in the stdbuf and the lib it needs. Tested locally
and paths confirmed to exist on prod boxes.

See #7239
2025-01-26 10:23:26 +02:00
Matt Godbolt
e18ada50fa Add support for QNX (#7234)
CC @doodspav
2024-12-19 16:32:13 -06:00
Chandler Carruth
af18032410 Attempt to add CPU sysfs entries to the jail. (#6748)
This allows running compilers that use these, for example ones that link
in TCMalloc. I'm just implementing the suggestion in #6734, it seems
reasonable and targeted. Hoping a PR lets a fix move forward here.

I've left this as mandatory given that `/proc` is mandatory. This might
still have an issue on more unusual Linux images, but I suspect not.

Not sure how to test this, wasn't clear how to just check the contents
of a file in the jail from the test suite examples I looked at. That
said, if you can point me to some example for how to do it, happy to add
one.

Fixes #6734
2024-08-03 13:35:57 -05:00
Patrick Quist
d92b473cbd Give access to alternatives (#6141) 2024-02-14 21:07:46 +01:00
Matt Godbolt
52a5729861 Support cgroupsv2 (#4373)
Backwards compatible with old cgroups, provided we have a recent enough nsjail
2023-11-24 17:35:43 -06:00
Matt Godbolt
b059bc7b4e Hide sonar in execution environment 2023-03-10 09:07:10 -06:00
Matt Godbolt
00ea739ab8 Rename files that confuse me every time (#4363) 2022-11-29 17:07:24 -06:00
Matt Godbolt
31cc95adfd Make the same NVidia magic devices available in compilation too. May help nvc++ compilation time as it will be able to detect the target GPU (#4361) 2022-11-29 07:16:23 -06:00
Patrick Quist
4f1bbcf526 .net - compileToBinary fix (#4353) 2022-11-28 23:13:01 +01:00
Matt Godbolt
a208c2fe2e Increase number of open files during compilation for .NET 2022-11-26 11:40:05 -06:00
Matt Godbolt
093ab95c0b Bump the amount of temp disk space available for NVidia c++ (#4333) 2022-11-23 08:27:26 -06:00
Patrick Quist
8d989c5660 Update execute.cfg (#4257) 2022-11-08 18:07:18 +01:00
partouf
8f4ede50eb fix nvidia devices not mandatory 2022-11-05 18:01:20 +01:00
partouf
197a1466d8 merge nvidia sandbox 2022-11-04 19:47:44 +01:00
partouf
be72c31ad9 add nvidia sandbox nsjail config 2022-08-30 18:01:53 +02:00
Jeremy Rifkin
ed1a4e6b27 LLVM Optimization Pass Viewer (#3769) 2022-07-01 01:53:02 +02:00
Patrick Quist
c28d535c1e Changes needed to make dotnet work with nsjail (#3307) 2022-02-01 08:39:55 +01:00
Mats Larsen
e2a8e7c8ce Support execution of programs for JVM compilers (#2745)
* Bare execution for Java programs
* Support execution for Kotlin
2021-07-06 08:11:32 -05:00
Austin Morton
052661d895 Increase nsjail compiler /tmp inode count
Fixes #2678
2021-05-21 14:21:49 -04:00
Matt Godbolt
33c3557c2b Mount the ld.so.conf directories in the jailed env. Fixes #2611 2021-04-26 17:57:01 -05:00
Matt Godbolt
03d8fcf977 More appropriate names for nobody/nogroup 2021-04-26 14:02:56 -05:00
Matt Godbolt
8a2cbebc70 Fix /dev/null jailing
* Remove unnecessary dir mount of `/dev` which somehow blocked
  write access to `/dev/null` (I tried mounting it read/write too
  but no luck).
* Adds group file
* Also adds a `notroot` fake user
2021-04-26 13:48:30 -05:00
Matt Godbolt
d461b8c43c Add support for nsjail compiler executions (#2569)
* Add support for nsjail compiler executions
* Enable nsjail for beta

Co-authored-by: partouf <partouf@gmail.com>
Co-authored-by: Austin Morton <austinpmorton@gmail.com>
2021-04-06 14:52:16 -05:00
Matt Godbolt
8fa4de0fec Bindmount /usr/share/zoneinfo and /etc/localtime
Fixes #2095
2020-07-23 22:23:18 -05:00
Matt Godbolt
51a6ab1032 Learn how to configure rlimits properly: Thanks @apmorton 2020-06-23 08:33:05 -05:00
Matt Godbolt
8c140c2f73 Remove rlimit_as (CC @apmorton); as best I can. Should fix #1703 2020-06-22 23:02:44 -05:00
Matt Godbolt
d3c9648a72 Address @apmorton observations about 32-bit issues with nsjail 2020-05-14 20:04:42 -05:00
Austin Morton
bbff26fbc3 Add sandbox support for nsjail 2020-02-18 10:56:34 -05:00