-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
After upgrading to NixOS 20.09, some applications do not start when using linuxPackages_hardened, complaining about chrome-sandbox #97682
Comments
What does |
@8573 it's |
Setting { # ...
security.chromiumSuidSandbox.enable = true;
} resolves the problem for |
I don't think so. I've been using it since 2017: 8573/nixos-config@3694d1b.
Yes, unfortunately it seems that each Electron application needs a new NixOS module option to make its wrapped Chromium's SUID sandbox work. I'm afraid I'm not knowledgeable as to what might have changed that would have changed whether you would need to set this manually. I had thought that it might have been that you had Edit: I suggest putting a comma between "start" and "complaining" in the issue title. :-) cc @jonringer as release manager |
Hm, I'm not entirely sure, I'm able to start the applications without issues on master (which should include behaviors from 20.09). |
looking at electron/electron#23074 you may try |
A better solution might be to copy into one's NixOS configuration what |
Apologies, I posted too quickly; I see now that that code can't immediately be adapted for Electron applications, as it only SUID-ifies the sandbox program for Chromium specifically. Presumably each of the applications has some other sandbox program that would need to be added to However, looking at the reported error message, I see it mentions Alternatively, they perhaps could use the sandbox program in the Chromium package, so that
|
Different error messages refer to different $ geogebra
[3110:0911/080917.332908:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /nix/store/j4njggy230cw1bbmsixxswcjdq4pn9w0-electron-6.1.12/lib/electron/chrome-sandbox is owned by root and has mode 4755.
fish: “geogebra” terminated by signal SIGTRAP (Trace or breakpoint trap) $ skypeforlinux
[3143:0911/080940.935335:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /nix/store/pyvv5lzy5lv3pmm916c1f0jlpq4lwg3s-skypeforlinux-8.63.0.76/share/skypeforlinux/chrome-sandbox is owned by root and has mode 4755.
fish: “skypeforlinux” terminated by signal SIGTRAP (Trace or breakpoint trap)
```console
$ $ Discord
[3286:0911/081401.200537:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /nix/store/xc1mak2lk1y0g66nfrldslhhkfgxqm7k-discord-0.0.11/opt/Discord/chrome-sandbox is owned by root and has mode 4755.
fish: “Discord” terminated by signal SIGTRAP (Trace or breakpoint trap) |
This is likely a duplicate of #89599 (basically |
@primeos , thanks. Indeed, everything works with |
Oops, I overlooked that your kernel is hardened. In that case, if you prefer not to use |
Ran into this as part of my 20.03 -> 20.09 upgrade, running the 5.4-hardened kernel. Adding the error message here so this issue will be found in search results:
That workaround did get Chromium (as well as Atom, the only other Electron-based app I use) running:
|
@zackelan thanks! Could you give some explanation of what this option does? |
So, indeed, setting the option { # ...
boot.kernel.sysctl."kernel.unprivileged_userns_clone" = 1;
} solves the issue for me. Is it supposed to be done this way? |
packages in the nix store do not have any suid permissions. That's why |
@alexeymuranov wrote—
It enables unprivileged users to create user namespaces, which are a sandboxing feature in the Linux kernel that ironically are known for creating enough security vulnerabilities that Debian patches its kernels to disable this by default. The NixOS hardened kernel (which is this) seems to agree with Debian on this. Chromium has two main (mutually exclusive) sandboxing methods, one based on setuid and one based on unprivileged creation of user namespaces ("unprivileged user namespaces"). Apparently the Chromium developers find the setuid sandbox to be more of a maintenance burden and would like to drop it in favor of the user namespace sandbox, but that would mean dropping support for Debian, so I think continuing to use the setuid sandbox seems likely to be supported for a long time by the standards of FOSS (#89599 (comment)). @alexeymuranov wrote—
I would say the more proper NixOS thing to do is to use |
Hi @8573, wouldn't it be better to use the security.allowUserNamespaces option rather than Edit: Nvm, has no effect on this issue. |
@fabianhjr, that option defaults to |
@fabianhjr wrote—
If one chooses to use the unprivileged user namespace sandbox rather than |
I looks like all these electron apps are using binary distributions, so patching in an environmental variable so we can modify the chrome-sandbox path via wrapper wont be as simple as it is in chromium: # We want to be able to specify where the sandbox is via CHROME_DEVEL_SANDBOX
substituteInPlace sandbox/linux/suid/client/setuid_sandbox_host.cc \
--replace \
'return sandbox_binary;' \
'return base::FilePath(GetDevelSandboxPath());' |
I marked this as stale due to inactivity. → More info |
This is still a problem. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Is there consensus on a proper, systematic solution? |
I hate to say it, but I'm not sure there's a proper way to solve this without moving all these Electron apps to proper source-based builds ... which, like, we should be doing anyway, there are very good security reasons to, but there are also reasons it's hard and hasn't happened yet |
My solution for #89599 (which I realize I never got around to submitting to resolve that issue) might work for these Electron apps too. (I agree with IreneKnapp in preferring building the apps from source, but some might be available only pre-built, like Google Chrome.) |
oh hey. thanks @8573. indeed, that does seem like it should work for any of these. |
Describe the bug
After upgrading to NixOS 20.09 Alpha using
linuxPackages_hardened
,chromium
,skypeforlinux
,element-desktop
,Discord
,geogebra
do not start and produce the message:For example:
The problem happens when using
There is no problem when using
To Reproduce
Steps to reproduce the behavior:
/etc/nixos/configuration.nix
setchromium
orskypeforlinux
, orelement-desktop
, orDiscord
, orgeogebra
into user profile withnix-env -i
.Expected behavior
The application should start normally.
Additional context
No problem with
linuxPackages_5_4
instead oflinuxPackages_hardened
.Possibly related issues:
Notify maintainers
Metadata
The text was updated successfully, but these errors were encountered: