mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3979] KMail profile in 0.9.64.4 has multiple fatal errors #2488
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#2488
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 @creideiki on GitHub (Feb 12, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3979
Bug and expected behavior
Gentoo has been lagging a bit with updates, so I did not test any version between 0.9.64 and 0.9.64.4. In 0.9.64, KMail (and Akonadi) ran without issues using the default profile. In 0.9.64.4, the application does not run at all. It seems the refactoring of the profile done in
5532fbdb97introduced several errors.First, there are syntax errors. Several
mkdirlines have file names containing asterisks. This gives the following error:I am not sure what they intend to do, but whatever it is it's not working. Especially confusing is the line
Yes, Akonadi creates a directory in
/tmp, but its name is random and seems to have been created usingmkstemp(3)or similar. I'm not sure how Firejail is supposed to be able to pre-create it.Removing the asterisks makes Firejail at least accept the profile syntactically and try to run the program.
At startup, Firejail now prints the following warning:
This seems like it would be a problem for saving e-mail attachments.
The next error comes when KMail tries to start Akonadi, which tries to start PostgreSQL. This fails with the following error:
I am not sure why it is in Swedish, when I have set
LC_MESSAGES=POSIX, but that's a different problem. The actual error is that PostgreSQL needs access to/usr/share/postgresql-13/in order to run. Adding the following line tokmail.profilefixes that:The next problem is this message on the console:
Which may have something to do with the profile creating a directory with that name:
when it's supposed to be a file:
There are several similar lines in the profile creating directories with names that are supposed to be files. Commenting them all out makes KMail start:
And now it actually reads mail. However, the error message
still appears. I have not tried to change any settings to see what would happen, since I don't want it to corrupt my working production configuration. Neither have I tried running GnuPG.
Finally, when exiting KMail, it crashes with a SIGSEGV:
I tried restoring an older
kmail.profile, from commit319f2dc8d6, and it has none of the above problems.Given the multitude of problems with commit
5532fbdb97, I'd suggest reverting it until it can be fixed.Environment
Compile time support:
- AppArmor support is disabled
- AppImage support is enabled
- chroot support is enabled
- D-BUS proxy support is enabled
- file and directory whitelisting support is enabled
- file transfer support is enabled
- firetunnel support is disabled
- networking support is enabled
- overlayfs support is disabled
- private-home support is enabled
- private-cache and tmpfs as user enabled
- SELinux support is disabled
- user namespace support is enabled
- X11 sandboxing support is enabled
Checklist
https://github.com/netblue30/firejail/issues/1139)--profile=PROFILENAMEis used to set the right profile.LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAMto get english error-messages.browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.debug output
@kmk3 commented on GitHub (Feb 12, 2021):
That's a pretty bad one. Related to that, I have been working on a profile
linter, to catch things such as what commit
deae31301("use ${DOWNLOADS} inlutris.profile (#3955)") fixes, and now I've created another script to catch
this specific semantic error. It boils down to this:
Before commit
bb9107e2a("Revert "Merge pull request #3607 fromkortewegdevries/wemail""), it correctly detects those akonadi entries:
And after that commit, it fortunately doesn't find anything.
LC_MESSAGESappears to be intended only for prompts. From POSIX.1‐2017Section 8.2 Internationalization
Variables:
I would suggest trying with
LC_ALL=CorLC_ALL=POSIXinstead.That's bad as well. I have caught some of these on an adjacent PR here:
And I suppose that there's unfortunately no way to automatically detect those
without prior knowledge of the paths, but it might be worth it to add some
sanity checks to
pull_request_template.md, such as:@rusty-snake Thoughts on that?
@rusty-snake commented on GitHub (Feb 13, 2021):
Heuristic:
${HOME}/.config/*rcshould havemkfileIf we add checks for an option (mkfile) that is used by 32 out of 1112 profiles, we should add checks for the remaining 1080 cases too. Is to say: No, just compare on how many PRs we added "add it to firecfg.config" and on how many "this should be mkfile".
@kmk3 commented on GitHub (Feb 13, 2021):
That sounds good. To add to that, for heuristics I think it would probably
make sense to emit a warning (rather than error), just in case there's
something like
${HOME}/.config/arc/config.If you consider
mkdiras well, there's quite a bit more:To be clear, the sanity checks would imply checking for both of these errors:
What do you mean? Are you saying that it's not worth it because not many
profiles are affected?
I don't understand; do you mean that only profiles that are listed on or added
to firecfg.config should be validated? Or that this isn't a big enough of a
problem to warrant the checks?
To clarify, I didn't mean that performing the checks should be mandatory; they
would primarily serve as a reminder of something to be aware of when creating a
PR. Like the checkslist on
bug_report.md, which is usually not fullycompleted by the issue reporters.
@rusty-snake commented on GitHub (Feb 13, 2021):
I mean that the wrong usage of mkdir/mkfile is a very rare mistake in profile PRs (nearly very mk* is a mkdir) in contrast to missing update of firecfg.config or similar which is remarked on a lot PRs. It's not worth to add it except we add a list with more then 50 reminders. Meaning if we add such reminders it makes no sense to me to add reminders for rare mistakes rather then common mistakes. Sure, we can add the rare and the common one, however then we have this long list of reminders.
@kmk3 commented on GitHub (Feb 14, 2021):
I see; that makes sense. Casting aside the template idea and to expand a bit
on the rationale: the main thing that worries me with mkdir/mkfile is that the
errors can be rather subtle (especially if e.g.: a file does not match
*rc),such that likely only people who use the program/profile would notice, which
might not include any the reviewers.
Also, it's a little far-fetched, but it might still be useful to later add a
file elsewhere with the 50+ reminders. I probably couldn't name half of that,
so it would be interesting to see the known pitfalls. Maybe we could also
enumerate and refer to them like CWEs when reviewing PRs, which would
enable counting how often each one happens.
@rusty-snake commented on GitHub (Feb 14, 2021):
This would also have a documenting nature, like "foo is know to break bar" where it's not obviously (nobar breaks bar). And it could be used to document the interaction (complementary and contradictory) of commands, so that situations like https://github.com/netblue30/firejail/issues/3877#issuecomment-761596394 where I know that it works this way but can not tell you way it works this way, are better to understand.
@rusty-snake commented on GitHub (Mar 8, 2021):
Do we want to keep this open until someone tested and fixed those hardening changed or should we close?
@rusty-snake commented on GitHub (May 12, 2021):
I'm closing here due to inactivity.