Commit graph

10465 commits

Author SHA1 Message Date
Kelvin M. Klann
ab4a126b65 RELNOTES: add modif and profile items
Relates to #6815 #6816 #6823 #6824 #6825 #6827 #6828.
2025-07-16 16:46:53 -03:00
Kelvin M. Klann
174d83fba3
profiles: keepassxc: add x11 group to private-etc (#6828)
It is a GUI program and without it the program does not start due to a
dbus error[1]:

    $ firejail keepassxc
    Reading profile /etc/firejail/keepassxc.profile
    [...]
    firejail version 0.9.74
    [...]
    Child process initialized in 698.63 ms
    dbus[23]: D-Bus library appears to be incorrectly set up: see the manual page for dbus-uuidgen to correct this issue. (Failed to open "/var/lib/dbus/machine-id": No such file or directory; Failed to open "/etc/machine-id": No such file or directory)
      D-Bus not built with -rdynamic so unable to print a backtrace

    Parent is shutting down, bye...

This issue is also mentioned in src/include/etc_groups.h:

    // @x11
    static char *etc_group_x11[] = {
        // [...]
        "machine-id", // QT dbus lib is crashing without it!
        // [...]
        NULL
    };

This amends commit 5d0822c52 ("private-etc: big profile changes",
2023-02-05).

Fixes #6827.

Relates to #6400.

[1] https://github.com/netblue30/firejail/issues/6827#issue-3228990975

Reported-by: @Rosika2
2025-07-16 19:31:55 +00:00
Kelvin M. Klann
d568444a37
modif: improve error messages in sandbox.c/sbox.c (#6825)
Relates to #6822.
2025-07-14 18:46:31 +00:00
Kelvin M. Klann
2a66c14ee3
modif: improve new network namespace error message (#6824)
Clarify that `--net` should be used to create a new network namespace
before using a firejail command that needs to be executed inside a
(firejail) network namespace.

Example:

    $ firejail --netfilter.print=10000
    Switching to pid 10001, the first child process inside the sandbox
    Error: the sandbox doesn't use a new network namespace (see --net)

Reported-by: @osevan

Relates to #6820.
2025-07-14 18:44:04 +00:00
Kelvin M. Klann
0ee91adec3
profiles: kate: fix network access (#6823)
And add a comment about it.

Fixes #6815.

Reported-by: @madbehaviorus
Suggested-by: @madbehaviorus
2025-07-14 18:43:12 +00:00
exponentialmatrix
34b0c428b3
profiles: makedeb: allow dpkg (#6816)
It is used to determine the architecture and distro.
2025-07-12 05:36:46 +00:00
Kelvin M. Klann
9bd74d5fbc RELNOTES: add modif, bugfix and docs items
Relates to #4545 #6804 #6805 #6806 #6807 #6808.
2025-07-10 16:28:00 -03:00
Kelvin M. Klann
ddac8be302
docs: fix man formatting of landlock.enforce (#6807)
Remove the `.PP` macro to avoid removing the indentation from the
preceding `.TP` in firejail-profile.5.in.

This also makes it more consistent with the description of
`landlock.enforce` in firejail.1.in.

This amends commit 760f50f78 ("landlock: move commands into profile and
add landlock.enforce", 2023-11-17) / PR #6125.

Relates to #6078.
2025-07-10 17:15:03 +00:00
Kelvin M. Klann
a31f741652
bugfix: fix "Not enforcing Landlock" message always being printed (#6806)
Even when Landlock is in fact being enforced.

Also, mention the `landlock.enforce` command in the message.

This amends commit 760f50f78 ("landlock: move commands into profile and
add landlock.enforce", 2023-11-17) / PR #6125.

Relates to #6078 #6796.

Reported-by: @osevan
2025-07-10 17:14:31 +00:00
Kelvin M. Klann
e0bf7b8aa4
docs: clarify --private bug in man pages (#6805)
Make it clearer that the bug affects firejail commands and not shell
commands like `mkdir(1p)` [1].

This amends commit 94368a343 ("docs: mention inconsistent homedir bug
involving --private=dir", 2022-03-14) / PR #5052.

Relates to #903.

[1] https://github.com/netblue30/firejail/issues/903#issuecomment-3044544685

Reported-by: @giddie
2025-07-10 17:14:00 +00:00
Kelvin M. Klann
652c3e43dc fcopy: improve comments in check()
Add a few more issue references.

Relates to #1243 #1531 #6804 #6808.
2025-07-10 14:11:45 -03:00
Kelvin M. Klann
3991303b9a
bugfix: fcopy: allow /etc/resolv.conf owned by systemd-resolve (#6808)
Apparently /etc/resolv.conf may be a regular file (instead of a symlink
to /run/systemd/resolve/resolv.conf) and owned by the "systemd-resolve"
user at the same time.

This is a follow-up to #6804.

Fixes #4545.

Relates to #1531.
2025-07-10 17:08:24 +00:00
Kelvin M. Klann
66bf4bbe85
modif: fcopy: try normal case first instead of last in check() (#6804)
Check if the file ownership matches before checking the exceptions.

Relates to #1531 #6801 #6803.
2025-07-09 04:06:02 +00:00
Kelvin M. Klann
1344489486 RELNOTES: add modif, bugfix and profile items
Relates to #6791 #6797 #6801 #6803.
2025-07-07 15:55:26 -03:00
dependabot[bot]
4505abf1b8 build(deps): bump step-security/harden-runner from 2.12.0 to 2.12.2
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.12.0 to 2.12.2.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](0634a2670c...6c439dc8bd)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.12.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-07 18:52:03 +00:00
Kelvin M. Klann
d54f798737
bugfix: fcopy: add /usr/share + "runner:root" exception to fix CI (#6803)
The following CI jobs started failing since the GitHub Actions runner
image for ubuntu-22.04 was (automatically) upgraded from version
20250615.1.0[1] to 20250622.1.0[2]:

* test-fs
* test-environment
* test-network

Most/all fail with the same fcopy error message for the same path,
presumably due to using `private-etc`, as `localtime` is in the default
private-etc group (see the full log below):

    Error fcopy: invalid ownership for /etc/localtime -> /usr/share/zoneinfo/Etc/UTC (type=- uid=1001 name=runner)
    Error: failed to run /run/firejail/lib/fcopy, exiting...

In at least the newer runner image, `/usr/share/zoneinfo/Etc/UTC` is
owned by `runner:root` instead of the usual `root:root`, so add an
exception in fcopy to allow it.

From a run of the `test-fs` job for commit 1f92779d2 ("modif: improve
fcopy error messages in check() (#6801)", 2025-07-07) [3]:

    make -C test private-etc
    make[1]: Entering directory '/home/runner/work/firejail/firejail/test'
    cd private-etc && ./private-etc.sh 2>&1 | tee private-etc.log
    TESTING: private-etc (test/private-etc/private-etc.exp)
    spawn /bin/bash
    firejail --private-etc=passwd,group,resolv.conf,X11
    runner@pkrvmdyo8zrnvmk:~/work/firejail/firejail/test/private-etc$
    <firejail --private-etc=passwd,group,resolv.conf,X11
    Reading profile /etc/firejail/default.profile
    Reading profile /etc/firejail/disable-common.inc
    Reading profile /etc/firejail/disable-programs.inc
    Reading profile /etc/firejail/landlock-common.inc

    ** Note: you can use --noprofile to disable default.profile **

    firejail version 0.9.75

    Parent pid 4511, child pid 4512
    Error fcopy: invalid ownership for /etc/localtime -> /usr/share/zoneinfo/Etc/UTC (type=- uid=1001 name=runner)
    Error: failed to run /run/firejail/lib/fcopy, exiting...
    Error: proc 4511 cannot sync with peer: unexpected EOF
    Peer 4512 unexpectedly exited with status 1
    runner@pkrvmdyo8zrnvmk:~/work/firejail/firejail/test/private-etc$ TESTING ERROR 1

Fixes #6797.

Relates to #6801.

[1] https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20250615.1
[2] https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20250622.1
[3] https://github.com/netblue30/firejail/actions/runs/16122142799/job/45490345354
2025-07-07 18:45:24 +00:00
Kelvin M. Klann
1f92779d27
modif: improve fcopy error messages in check() (#6801)
Changes:

* Remove "file" from "invalid ownership" error message (`src` can also
  be a directory)
* Print more error messages
* Include the source path, realpath, file type and uid/username of the
  file owner where applicable

Relates to #6797.
2025-07-07 16:09:59 +00:00
dependabot[bot]
9bc9b8af4e build(deps): bump github/codeql-action from 3.28.18 to 3.29.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.18 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ff0a06e83c...181d5eefc2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 12:53:01 +00:00
Kelvin M. Klann
326a3102a4 profiles: fix private-opt comment misc in profile.template
This amends commit b66da99f9 ("profiles: finish converting private-opt
to whitelist (#6785)", 2025-06-22).
2025-06-26 07:17:50 -03:00
Kelvin M. Klann
cba764fa08
profiles: replace hosts.conf with host.conf in private-etc (#6791)
`hosts.conf` was added in #3849 and is only used in 3 profiles, while
all other profiles use `host.conf` (which is documented in
`host.conf(5)`):

    $ git grep -E 'private-etc .*,host\.conf(,|$| +#)' -- etc | wc -l
    64
    $ git grep -E 'private-etc .*,hosts\.conf(,|$| +#)' -- etc | wc -l
    3

Considering that and as discussed with @bbhtt (the author of #3849),
`hosts.conf` is likely a typo of `host.conf`[1].

Commands used to search and replace:

    $ git grep -IElz 'private-etc .*,hosts\.conf(,|$| +#)' -- etc |
      xargs -0 \
      perl -pi -e 's/(private-etc .*,)hosts\.conf(,|$| +#)/$1host.conf$2/'

Related commits:

* a8a8e33bc ("Add whitelisting to mutt; improve geary, new profile for
  neomutt", 2020-12-28) /
  PR #3849
* 144aee26f ("Improve whitelisting and dbus of Sylpheed and Claws-mail",
  2020-12-31) /
  PR #3849

Kind of relates to #6400.

[1] https://github.com/netblue30/firejail/pull/3849#issuecomment-3001532350
2025-06-26 09:53:45 +00:00
Kelvin M. Klann
e029ed47e1 RELNOTES: add feature, modif and profile items
Relates to #6747 #6761 #6773 #6775 #6777 #6779 #6780 #6783 #6784 #6785.
2025-06-23 06:05:05 -03:00
jlimor-kl
7471a24b8f
feature: use non-blocking flock calls (#6761)
As reported by @hlein in #6729, if a firejailed process is `^Z`'d at the
wrong time during startup, other firejail processes will be unable to
proceed because they'll wait forever for an flock on
`/run/firejail/firejail-run.lock`.

This builds upon commit f4b8c6dbb ("bugfix: fix potential deadlock with
flock + SIGTSTP (#6750)", 2025-05-21) to add a busy wait while
attempting to acquire a lock. This allows the application to bail out if
it fails to acquire a lock after a given timeout.

Behavior after this patch (we use SIGSTOP, as that cannot be
caught/ignored):

    $ firejail --debug id & P=$!;sleep 0.00001;kill -STOP $P
    [1] 14411
    Looking for kernel processes
    Found kthreadd process, we are not running in a sandbox
    pid=14411: locking /run/firejail/firejail-run.lock ...
    pid=14411: locked /run/firejail/firejail-run.lock

    [1]+  Stopped                 firejail --debug id
    $ firejail --debug ls
    Looking for kernel processes
    Found kthreadd process, we are not running in a sandbox
    pid=14413: locking /run/firejail/firejail-run.lock ...
    pid=14413: sleeping 500us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 1000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 2000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 4000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 8000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 16000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 32000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 64000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 128000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 256000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    pid=14413: sleeping 500000us while trying to lock /run/firejail/firejail-run.lock
    Error: timeout occurred while trying to lock /run/firejail/firejail-run.lock
    Error: ../../src/firejail/preproc.c:112: preproc_lock_file: flock: Resource temporarily unavailable

Enhances commit f4b8c6dbb ("bugfix: fix potential deadlock with flock +
SIGTSTP (#6750)", 2025-05-21).

Suggested-by: @hlein
Co-authored-by: @kmk3
2025-06-22 05:08:10 +00:00
Kelvin M. Klann
b66da99f9a
profiles: finish converting private-opt to whitelist (#6785)
Changes:

* Convert all private-opt entries (other than `private-opt none`) to
  whitelist entries
* Remove remaining commented private-opt entries and related comments
  (for profiles that also have a corresponding whitelist entry)
* Enable `whitelist /opt/basilisk` in basilisk.profile (similarly to
  mullvad-browser.profile and palemoon.profile)
* Update private-opt comment in etc/templates/profile.template

Most private-opt entries were converted into whitelist entries on commit
175905530 ("profiles: exchange private-opt with a whitelist (#6021)",
2023-10-18), while some of them were left alone due to the program size
being deemed small enough as not to break file-copy-limit in
firejail.config.

For the sake of simplicity and clarity (and to avoid potential issues
with program install sizes increasing over time), convert those
private-opt entries into whitelist entries as well (note that users can
still enable private-opt in the corresponding .local profile).

Also, some commented private-opt entries remain (with a note about
potential issues with private-opt).

Since commit 175905530 also documented the drawbacks of private-opt in
firejail.1, it should be fine to remove the commented entries and
related comments (note that in all of the profiles containing such
comments, there is already an equivalent whitelist entry).

Related commits:

* f3f739c5d ("microsoft-edge.profile: rewrite profile for stable
  channel", 2022-08-11) /
  PR #5709
* 121e043df ("microsoft-edge-{dev,beta}: replaced private-opt by
  whitelist #5307", 2022-08-11) /
  PR #5709
* 2cb40fbec ("microsoft-edge fixes (#5697)", 2023-03-14)
* 58732a654 ("Add profiles for jami and postman (#5691)", 2023-03-15)
* 175905530 ("profiles: exchange private-opt with a whitelist (#6021)",
  2023-10-18)
2025-06-22 05:07:18 +00:00
Kelvin M. Klann
937ad13b9e
profiles: firecfg: disable foliate (#6784)
It seems unable to open ebooks on Arch (even with `--noprofile` and
`--profile=noprofile`), likely due due to webkitgtk / bwrap.

Error log[1]:

    $ firejail --profile=noprofile /usr/bin/foliate
    Reading profile /etc/firejail/noprofile.profile
    firejail version 0.9.74

    Parent pid 16189, child pid 16190
    Warning: cannot open source file /usr/lib/firejail/seccomp.debug32, file not copied
    Base filesystem installed in 0.01 ms
    Child process initialized in 12.32 ms
    MESA-INTEL: warning: ../mesa-25.1.3/src/intel/vulkan_hasvk/anv_formats.c:759: FINISHME: support YUV colorspace with DRM format modifiers
    MESA-INTEL: warning: ../mesa-25.1.3/src/intel/vulkan_hasvk/anv_formats.c:790: FINISHME: support more multi-planar formats with DRM modifiers
    bwrap: Can't mount proc on /newroot/proc: Operation not permitted

    ** (com.github.johnfactotum.Foliate:3): ERROR **: 23:16:32.030: Failed to fully launch dbus-proxy: Child process exited with code 1

Relates to #3647 #6782.

[1] https://github.com/netblue30/firejail/issues/6782#issuecomment-2982568811

Reported-by: @rsramkis
2025-06-19 12:16:55 +00:00
Kelvin M. Klann
02ad655df4
profiles: use private-etc groups in more profiles (#6783)
For simplicity and to make diffs more readable.

Use them in the remaining profiles that have `private-etc` enabled but
are not currently using private-etc groups.

Note: All of the profiles in question were created between 0.9.72 and
0.9.74 (which is when private-etc groups were introduced).

Command used to search for relevant profiles:

    $ git grep '^private-etc .*alternatives' -- etc

Misc: The changes were made somewhat manually.

This is a follow-up to #6779.

Relates to #5691 #5706 #5707 #5710 #6007 #6400.
2025-06-18 05:49:26 +00:00
Alpha
05d3145266
profiles: ani-cli: add mpv to private-etc for plugins access (#6779)
Allow ani-cli to access /etc/mpv for mpv plugins/themes/scripts access.

mpv playing under ani-cli cannot use plugins.
Example: Unable to use mpv-mpris plugin when playing anime using
ani-cli.

This patch just adds mpv to private-etc for plugin access.
The profile imports mpv.profile later so all that magic is taken care
of.

Note that in mpv.profile, there is no private-etc definition, but it is
defined in ani-cli.profile.

That's why it is broken.
2025-06-17 05:14:27 +00:00
Kelvin M. Klann
348f657f5a
profiles: ripperx/sound-juicer: fix profile name typos (#6780)
They are currently named as "mpv".

This amends commit 5dbdf657b ("new profiles: ripperx, sound-juicer",
2020-03-19).

Misc: This was noticed on #6779.
2025-06-17 05:08:27 +00:00
Alpha
7a8adf1fdb
profiles: chafa: quiet output (#6777)
When using chafa as an image viewer for other apps, it litters the
output with firejail (debug/output) messages.

Use `quiet` so that the image is displayed cleanly.
2025-06-14 02:51:37 +00:00
Kelvin M. Klann
facaa03df9
profiles: wusc: add /usr/share/xkeyboard-config-2 (#6775)
With xkeyboard-config 2.45, many programs fail to start, such as:
Firefox, Thunderbird, Gajim, KeepassXC, GoldenDict, and Zathura.
Example[1]:

    Reading profile /etc/firejail/zathura.profile
    [...]
    Reading profile /etc/firejail/whitelist-usr-share-common.inc
    Reading profile /etc/firejail/whitelist-var-common.inc
    firejail version 0.9.75

    [...]
    Child process initialized in 197.83 ms
    xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb
    xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb

    Parent is shutting down, bye...

It seems that in xkeyboard-config 2.45 the path was changed from:

* /usr/share/X11/xkb

To:

* /usr/share/xkeyboard-config-2

With the former now being a symlink to the latter and with the goal of
using a versioning scheme for the directories, in order to introduce new
file formats with breaking changes while keeping backwards compatibility
in the current file format[2] [3].

Fixes #6773.

Thanks to @oddfellow for finding the root cause and the relevant commit.

[1] https://github.com/netblue30/firejail/issues/6773#issue-3130459006
[2] https://github.com/netblue30/firejail/issues/6773#issuecomment-2956384127
[3] fd1d8d2d4f

Reported-by: @myrslint
Reported-by: @aminvakil
Reported-by: @oddfellow
Reported-by: @reagentoo
2025-06-11 23:18:06 +00:00
Kelvin M. Klann
87183d605c
modif: improve "Failed mount" error messages in util.c (#6747)
Include the relevant mount path(s).

Example:

Before:

    $ firejail --debug --noprofile --blacklist=/run true
    [...]
    Disable /run
    Disable /sys/fs
    Failed mount: No such file or directory
    Error: ../../src/firejail/fs.c:148: disable_file: disable file: No such file or directory
    Error: proc 12345 cannot sync with peer: unexpected EOF
    Peer 12345 unexpectedly exited with status 1

After:

    $ firejail --debug --noprofile --blacklist=/run true
    [...]
    Disable /run
    Disable /sys/fs
    Failed to mount /run/firejail/firejail.ro.dir on /sys/fs: No such file or directory
    Error: ../../src/firejail/fs.c:148: disable_file: disable file: No such file or directory
    Error: proc 12345 cannot sync with peer: unexpected EOF
    Peer 12345 unexpectedly exited with status 1

This helps clarify that it is not possible to blacklist /run, as
firejail uses files inside /run/firejail in order to set up the sandbox.

In the above example, when processing the first blacklist, firejail
bind-mounts /run/firejail/firejail.ro.dir (a directory with no
read/write/execute permissions) on top of /run, rendering /run/firejail
inaccessible.  When attempting to process the next blacklist (for
/sys/fs), firejail is unable to access /run/firejail, so it fails to
bind mount /run/firejail/firejail.ro.dir on top of /sys/fs and aborts.

Relates to #6711 #6740.
2025-06-04 22:41:37 +00:00
dependabot[bot]
8fb210bb7c build(deps): bump github/codeql-action from 3.28.16 to 3.28.18
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.28.18.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](28deaeda66...ff0a06e83c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-01 20:37:57 +00:00
Kelvin M. Klann
4cb5932088 RELNOTES: add bugfix and profile items
Relates to #6729 #6734 #6750 #6751 #6755 #6758 #6759 #6762 #6763.
2025-05-31 09:43:41 -03:00
Kelvin M. Klann
cb7ae18f23
profiles: wine: allow python to fix Epic Games Launcher (#6763)
As reported by @kolAflash[1]:

> ### Description
>
> If `~/.cache/gstreamer-1.0/` is empty, `/usr/lib/python3*` is needed
> to initialize it.
>
> Wine needs gstreamer for example in the case of
> EpicGamesLauncherInstaller.msi[2] (2025-05-29).
>
> ### Steps to Reproduce
>
> 1. Copy `EpicInstaller-18.5.0.msi` to `~/.wine/drive_c/`.
> 2. Run:
>
>     firejail --profile=wine --whitelist="${HOME}"/.wine \
>       wine msiexec /i 'C:\\EpicInstaller-18.5.0.msi' /q
>
>     firejail --profile=wine --whitelist="${HOME}"/.wine \
>       wine 'C:\\Program Files (x86)\\Epic Games\\Launcher\\Portal\\Binaries\\Win32\\EpicGamesLauncher.exe'
>
> ### Expected behavior
>
> Epic Games Launcher login screen should show up.
>
> ### Actual behavior
>
> Epic Games Launcher is stuck loading the login screen.
>
> ### Additional context
>
> Workaround: Add `--noblacklist=/usr/lib/python3*`.

> - Name/version of the relevant program(s)/package(s):
> `gstreamer-1.26.1` by Debian-13, Wine-Devel-10.8 from
> https://gitlab.winehq.org/wine/wine/-/wikis/Debian-Ubuntu

Note: Python is already allowed on lutris.profile and steam.profile.

Fixes #6762.

[1] https://github.com/netblue30/firejail/issues/6762#issue-3101581116
[2] https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi

Reported-by: @kolAflash
Suggested-by: @kolAflash
2025-05-31 12:38:00 +00:00
Kelvin M. Klann
072c15b8bf
profiles: rssguard: allow lua (#6759)
Error log[1]:

    $ firejail rssguard
    Reading profile /etc/firejail/rssguard.profile
    [...]
    rssguard: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: Permission denied

Fixes #6758.

[1] https://github.com/netblue30/firejail/issues/6758#issue-3088510624

Reported-by: @1eof
2025-05-26 13:41:37 +00:00
Kelvin M. Klann
763229f553
profiles: firecfg: disable checksum programs (#6755)
As reported by @hlein[1]:

> A number of packages can't compile on Gentoo when various `*sum` tools
> are firejailed; they'll die like:
>
>     ...
>     -- Installing: /var/tmp/portage/dev-libs/protobuf-30.2/image/usr/lib64/cmake/protobuf/protobuf-options.cmake
>     Error: too many arguments: argc (166) >= MAX_ARGS (128)
>      * ERROR: dev-libs/protobuf-30.2::gentoo failed (install phase):
>     ...
>      * The specific snippet of code:
>      *       cksum=$(_multilib_header_cksum) || die;
>
> Same for various others.
>
> `_multilib_header_cksum` is defined in `eclass/multilib-build.eclass`
> and it does a `find ... -exec chksum {} +` - behaves similar to `xargs`.
> `chksum` is wrapped by `firecfg` by default.
>
> So this points out anything that uses `find ... -exec ... {} +` or
> `xargs` and runs a firejail'ed process is prone to failure. When bulding
> a couple hundred packages, these all failed this way:
>
>     # find /var/tmp/portage/ -name build.log | xargs egrep -l MAX_ARGS |
>       cut -d/ -f5,6 | uniq
>     dev-libs/icu-77.1
>     dev-libs/boost-1.88.0-r1
>     dev-libs/protobuf-30.2
>     media-video/ffmpeg-7.1.1-r1
>     app-crypt/rpm-sequoia-1.8.0
>     media-libs/opencv-4.11.0
>     app-misc/binwalk-3.1.0-r1
>     llvm-core/clang-19.1.7
>     llvm-core/llvm-20.1.5
>     x11-libs/wxGTK-3.2.8
>
> The largest of which being:
>
>     # find /var/tmp/portage/ -name build.log | xargs egrep MAX_ARGS |
>       cut -d\( -f2 | cut -d\) -f1 | sort -rn | head -n1
>     1438

Command used to search and replace:

    $ perl -pi -e 's/^[^#]+sum/#$& # breaks with too many arguments (see #4633)/' \
      src/firecfg/firecfg.config

Related commits:

* f7e232c1b ("Add profile for checksum tools", 2021-03-08) /
  PR #4069
* 713249c98 ("sha256sum: add nvm support comment", 2022-03-20) /
  PR #5058
* 7176e6324 ("private-etc: libreoffice, audacity, forzen-bubble,
  transmission, md5sum/sha512sum, more sysutils testing, fix
  electron-hardened.inc.profile", 2023-02-08)
* 028d236b8 ("profiles: firecfg: fix sha384sum & add b2sum/cksum
  (#6578)", 2024-12-26)
* afce4679b ("New profile: b3sum (blake3) (#6577)", 2024-12-26)

Relates to #4633.

[1] https://github.com/netblue30/firejail/issues/4633#issuecomment-2889232775

Reported-by: @hlein
2025-05-23 11:28:14 +00:00
jlimor-kl
f4b8c6dbb9
bugfix: fix potential deadlock with flock + SIGTSTP (#6750)
As reported by @hlein in #6729, if a firejailed process is `^Z`'d at the
wrong time during startup, other firejail processes will be unable to
proceed because they'll wait forever for an flock on
`/run/firejail/firejail-run.lock`.

This fixes that by installing a signal handler to catch SIGTSTP (Ctrl-Z)
before acquiring locks. The handler increments a flag to allow for
re-sending the SIGTSTP signal after locks have been released.

Deadlock Reproducer:

Note: The length of the sleep should be adjusted until the debug output
resembles the output below:

    $ firejail --debug id & P=$!;sleep 0.0005;kill -TSTP $P
    [1] 16130
    Looking for kernel processes
    Found kthreadd process, we are not running in a sandbox
    pid=16130: locking /run/firejail/firejail-run.lock ...
    pid=16130: locked /run/firejail/firejail-run.lock

    [1]+  Stopped                 firejail --debug id

Further calls to firejail will hang due to the stopped process holding
the firejail-run lock.

    $ firejail id
    ^C

With this commit:

    $ firejail --debug id & P=$!;sleep 0.0005;kill -TSTP $P
    [1] 16504
    Looking for kernel processes
    Found kthreadd process, we are not running in a sandbox
    pid=16504: locking /run/firejail/firejail-run.lock ...
    pid=16504: locked /run/firejail/firejail-run.lock
    pid=16504: caught SIGTSTP while locks are held
    pid=16504: unlocking /run/firejail/firejail-run.lock ...
    pid=16504: unlocked /run/firejail/firejail-run.lock
    pid=16504: resending caught SIGTSTP

    [1]+  Stopped                 firejail --debug id

Due to the locks being properly released before the process is stopped,
new firejail processes will not hang while acquiring the lock.

Fixes #6729.

Reported-by: @hlein
2025-05-21 10:18:55 +00:00
Fidel Ramos
b84e2591a8
New profile: ansel (#6751)
This adds support for Ansel, a Darktable fork:
https://github.com/aurelienpierreeng/ansel/

The profile is based on darktable.profile. I have personally tested it
and it works.
2025-05-19 19:36:52 +00:00
Antonio Russo
977eac3ba4
bugfix: add missing selinux relabeling for /dev paths (#6734)
Some objects are created in fs_dev but not labeled.  This patch ensures
that those objects are properly labeled.

Signed-off-by: Antonio Enrico Russo <aerusso@aerusso.net>
2025-05-15 14:04:10 +00:00
Kelvin M. Klann
0d8973638c RELNOTES: add build and profile items
Relates to #6732 #6735 #6736 #6737 #6738.
2025-05-06 06:12:46 -03:00
Kelvin M. Klann
2fa577efd9
build: replace _SYSCONFDIR_ with @sysconfdir@ (#6737)
For consistency, use the conventional autoconf variable name (see also
config.mk.in).

Commands used to search and replace:

    $ git grep -Ilz '_SYSCONFDIR_' | xargs -0 \
      perl -pi -e 's/_SYSCONFDIR_/\@sysconfdir\@/'

Added on commit a37ffc337 ("Add first version of zsh completion",
2021-01-02) / PR #3864.
2025-05-06 09:11:26 +00:00
matthew-sharp
a7b441c4f1
profiles: discord-common: add env to private-bin (#6738)
The discord wrapper script in gentoo runs `#!/usr/bin/env bash`.

See https://github.com/gentoo/gentoo/blob/master/net-im/discord/files/launcher.sh
2025-05-06 08:56:20 +00:00
Kelvin M. Klann
a03c7f6b25
profiles: curl: allow ~/.netrc (#6736)
From curl(1):

> -n, --netrc
>        Make curl scan the .netrc file in the user's home directory for
>        login name and password. This is typically used for FTP on
>        Unix.  If used with HTTP, curl enables user authentication. See
>        netrc(5) and ftp(1) for details on the file format. curl does
>        not complain if that file does not have the right permissions
>        (it should be neither world- nor group-readable). The
>        environment variable "HOME" is used to find the home directory.

Environment: curl 8.13.0-2 on Artix Linux.

This is a follow-up to #6735.
2025-05-06 08:52:11 +00:00
Kelvin M. Klann
89587226ed
profiles: mpv: remove mkfile ~/.netrc (#6735)
To reduce clutter in the user home.

This file is apparently intended to specify login information for remote
systems, such as username and password for ftp/http connections
(similarly to using ~/.ssh/config for ssh connections).

From inetutils.info of GNU inetutils 2.6, which provides ftp and telnet
binaries (among others):

> 11.7 The ‘.netrc’ file

> The ‘.netrc’ file contains login and initialization information used
> by the auto-login process.  It generally resides in the user's home
> directory, but a location outside of the home directory can be set
> using the environment variable ‘NETRC’.  Both locations are overridden
> by the command line option ‘-N’.  The selected file must be a regular
> file, or access will be denied.

It seems that the file is intended to be created manually (just like
~/.ssh/config), as it is not mentioned in mpv(1).  mpv supports using
yt-dlp and ~/.netrc is mentined in yt-dlp(1), though it does not look
like it would create the file either.

Note also that this entry is not present in any other profile (including
the ones that allow ~/.netrc).

Related commits:

* 5d741795c ("Use whitelisting for video players (#3472)", 2020-08-15)
* 8bf892d67 ("Fix missing mkfile in
  5d741795c3", 2020-08-16)

This is a follow-up to #6732.
2025-05-06 08:52:01 +00:00
Kelvin M. Klann
8b60da9811
profiles: remove mkdir ~/.pki (#6732)
To reduce clutter in the user home.

This appears to be a legacy path and the relevant profiles already
create an XDG path as well:

    mkdir ${HOME}/.local/share/pki

From nss 3.111[1]:

    /**
     * Return the path to user's NSS database.
     * We search in the following dirs in order:
     * (1) $HOME/.pki/nssdb;
     * (2) $XDG_DATA_HOME/pki/nssdb if XDG_DATA_HOME is set;
     * (3) $HOME/.local/share/pki/nssdb (default XDG_DATA_HOME value).
     * If (1) does not exist, then the returned dir will be set to either
     * (2) or (3), depending if XDG_DATA_HOME is set.
     */

The XDG path has apparently been supported since nss 3.42, which was
released on 2019-01-25[2] [3] [4].

Misc: The original path was first added on commit 3a71eb2af ("added
mkdir in all whitelisted profiles", 2016-02-18) and the XDG path was
first added on commit 63c35052b ("Add '$HOME/.local/share/pki' to
blacklist", 2019-02-03).

Relates to #4262.

[1] https://github.com/nss-dev/nss/blob/NSS_3_111_RTM/lib/sysinit/nsssysinit.c#L64-L72
[2] https://github.com/nss-dev/nss/blob/NSS_3_42_RTM/lib/sysinit/nsssysinit.c#L65-L73
[3] 7f21d4f497
[4] https://github.com/nss-dev/nss/releases/tag/NSS_3_42_RTM
2025-05-04 05:13:08 +00:00
dependabot[bot]
2f1b51ab35 build(deps): bump step-security/harden-runner from 2.11.0 to 2.12.0
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](4d991eb9b9...0634a2670c)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-02 07:56:13 +00:00
dependabot[bot]
c95f036476 build(deps): bump github/codeql-action from 3.28.13 to 3.28.16
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.16.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b549b9259...28deaeda66)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-02 07:56:04 +00:00
netblue30
e2f372fd70 Merge branch 'master' of ssh://github.com/netblue30/firejail 2025-04-30 07:50:40 -04:00
netblue30
9b40f18013 more static map fixes 2025-04-30 07:50:30 -04:00
Kelvin M. Klann
726d956826 RELNOTES: add modif and profile items
Relates to #6707 #6716 #6718 #6719 #6724.
2025-04-30 08:20:50 -03:00
netblue30
3f294cb3dc
Merge pull request #6724 from kmk3/modif-keep-tcm
modif: keep tcm/tcmrm devices if keep-dev-tpm is used
2025-04-30 06:59:22 -04:00