mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #6015] vscodium: nodejs extension fails to execute a command correctly #3159
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#3159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SjoerdV on GitHub (Sep 20, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/6015
Description
When firejail is managing Visual Studio Code (code OR codium) sandbox
firejail /usr/bin/codium . --no-sandbox --unity-launchThe 'AsciiDoc' extension (NODEJS) fails to export an .adoc file to PDF. I imagine a lot of extensions execute external programs from within the vscode sandbox, so this might be a more generic issue.
Steps to Reproduce
/home/user/.vscode-oss/extensions/asciidoctor.asciidoctor-vscode-3.1.5/dist/src/commands/exportAsPDF.js/usr/local/bin/asciidoctor-pdfsymlinked to/var/lib/gems/2.7.0/gems/asciidoctor-pdf-2.3.9/bin/asciidoctor-pdfA lot of paths are involved but I
noblacklisted them all. Also the executing of the.rbfile needs an.sofile loaded, this might complicate thingsExpected behavior
The pdf file should be saved correctly
Actual behavior
eror occured (see above)
Behavior without a profile
What changed calling
LC_ALL=C firejail --noprofile /path/to/programin aterminal?
Same error!
What changed calling
/path/to/programin aterminal?
Error goes away and PDF is saved correctly
Additional context
AppArmor is disabled for the
codeorcodiumapp, so that is not an issue.I have tried a lot of
code.localignorestatements, but it did not helpI tried
--buildto build my own profile, but it only added a bunch ofwhiteliststatements that I don't want.I tried
syscalls.shbut my journal did not detect a single syscallEnvironment
Checklist
/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
Output of
LC_ALL=C firejail /path/to/programOutput of
LC_ALL=C firejail --debug /path/to/programOutput of
firejail /path/to/program@ghost commented on GitHub (Sep 20, 2023):
Thanks for your detailed reporting. The complexities involved here sure don't make it easy to come up with a quick one-liner fix. So please bare with me in the following.
I noticed that your debug log shows
Mounting noexec /var, which might explain why the symlinked asciidoctor-pdf under /var/lib borks (steps 2 & 3 from your STR). When--noprofilealso fails, that points me in the direction of troubles caused by anoexecsomewhere down the line. Which IMO is also the reason why extra noblacklisting doesn't help in this context.I'd try the below first (not exactly sure what nodejs might expect from the sandbox):
Also, instead of using
--noprofile, try using noprofile.profile. The latter creates the weakest possible sandbox and is only another debug tool. If I'm at all having eyes on your issue I'd expect that to work due to thewritable-var. Would be interesting if you could post output from@SjoerdV commented on GitHub (Sep 20, 2023):
hi @glitsj16 thanks for your swift reply. The results are as follows:
adding
... has no effect
Output of
firejail --profile=noprofile.profile /path/to/programNow the extension works as expected indeed! But this is nearly the same as running without a sandbox, I guess.
What bugs me is that it seems there are no 'file not found' or 'can not execute' errors here, but a rather vague 'failed to map segment from shared object' error. Seems like something 'in memory' process is being blocked...
Hope you have any more ideas ;-)
@ghost commented on GitHub (Sep 20, 2023):
Correct. You'll need to
integrate(some of the) noprofile.profile options into yourcode.localto keep a reasonably tight sandbox. My guess is thewritable-varoption probably will suffice, but some of the other ones might be needed too. Experiment and I'm pretty confident you'll have this working soon.@SjoerdV commented on GitHub (Sep 20, 2023):
That's a great pointer, thanks! adding
writable-vardid the trick. Thanks again!EDIT: my
code.localfile already hadwritable-run-user