aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAge
* improve detection of firejail login shellLibravatar smitsohu2021-11-01
|
* Merge pull request #4643 from rusty-snake/profile-checksLibravatar Kelvin M. Klann2021-10-29
|\ | | | | Profile Checks
| * Sort src/firecfg/firecfg.configLibravatar rusty-snake2021-10-27
| |
* | private-bin fixup (#4646)Libravatar smitsohu2021-10-28
| | | | | | | | | | cannot create fslogger file as user, so raise privs and create it as root
* | more cleanupLibravatar smitsohu2021-10-28
|/ | | | | possible because selinux_relabel_path now raises privs itself where necessary
* cleanupLibravatar smitsohu2021-10-22
|
* private-bin: switch effective uidLibravatar smitsohu2021-10-22
|
* private-bin: fix #4626, refactor symlink detectionLibravatar smitsohu2021-10-22
|
* Merge pull request #4600 from crocket/masterLibravatar netblue302021-10-21
|\ | | | | Add profiles for imv, retroarch, and torbrowser
| * Add profiles for imv, retroarch, and torbrowserLibravatar crocket2021-10-17
| | | | | | | | | | imv, retroarch, and torbrowser are also added to firecfg.config
* | small fixLibravatar netblue302021-10-20
| |
* | --noprinter optionLibravatar netblue302021-10-20
| |
* | mountinfo: improve readabilityLibravatar smitsohu2021-10-18
| | | | | | | | | | | | | | | | | | | | | | | | Removes the inconsistency that some blacklisted paths could be remounted (files specified explicitly) and some could not. Now all blacklisted paths can be mounted nosuid, nodev, noexec if users specify this. Also fixes the bug that mount id can indeed be 0. Other than that no functional or algorithmic changes, only readability improvements.
* | readabilityLibravatar smitsohu2021-10-18
| |
* | cleanupLibravatar smitsohu2021-10-18
| |
* | man pagesLibravatar smitsohu2021-10-18
| |
* | Merge pull request #4610 from kmk3/fix-misc-get-group-idLibravatar smitsohu2021-10-17
|\ \ | | | | | | Fix misc in get_group_id
| * | util.c: rename "group" arg to "groupname" in get_group_idLibravatar Kelvin M. Klann2021-10-16
| | | | | | | | | | | | | | | To make things clearer, since there is already a `struct group` in the same function.
| * | util.c: fix return type of get_group_idLibravatar Kelvin M. Klann2021-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gr_gid is of type gid_t (not uid_t). From grp.h(0p) of POSIX.1-2017: > DESCRIPTION > > The <grp.h> header shall declare the group structure, which shall > include the following members: > > char *gr_name The name of the group. > gid_t gr_gid Numerical group ID. > char **gr_mem Pointer to a null-terminated array of character > pointers to member names. > > The <grp.h> header shall define the gid_t and size_t types as > described in <sys/types.h>. Note: The callers already store the result in gid_t variables. First caused by commit dc3564b18 ("fixes", 2016-03-09).
| * | util.c: remove tty comment from get_group_idLibravatar Kelvin M. Klann2021-10-16
| | | | | | | | | | | | | | | This amends commit 40ed53c20 ("nvidia fix", 2016-10-08) and commit 74149d248 ("fixes", 2016-03-20).
* | | Merge pull request #4606 from kmk3/rm-limits-h-libtraceLibravatar smitsohu2021-10-17
|\ \ \ | |/ / |/| | libtrace.c: use realpath instead of readlink to avoid PATH_MAX
| * | libtrace.c: use realpath instead of readlink to avoid PATH_MAXLibravatar Kelvin M. Klann2021-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PATH_MAX is not guaranteed to be defined and it may be defined to -1. Avoid depending on it by getting the result directly from realpath. See commit 579f856c5 ("firejail.h: add missing linux/limits.h include") / PR #4583 for details. Note: This replaces the static char array currently used with a dynamic one returned from realpath. Misc: This is a continuation of #4583.
* | | cgroup: minor refactor, add v2 support, bugfixesLibravatar smitsohu2021-10-16
|/ / | | | | | | | | | | | | | | Adds minimal cgroupv2 support, and fixes an effective user id assertion in --join (instead of asserting effective user id of the user, drop privileges completely in a child process).
* | cleanup: move overlayfs code in separate moduleLibravatar smitsohu2021-10-13
| |
* | Merge branch 'master' into replace-iwrite-iwuserLibravatar netblue302021-10-09
|\ \
| * \ Merge branch 'master' into fix-include-limits-hLibravatar netblue302021-10-09
| |\ \
| | * \ Merge pull request #4579 from dm9pZCAq/masterLibravatar netblue302021-10-09
| | |\ \ | | | |/ | | |/| fix compilation on musl (#4578)
| | | * fix compilation on musl (#4578)Libravatar dm9pZCAq2021-09-27
| | | |
| | * | Merge pull request #4593 from kmk3/revert-allow-deny-fbuilderLibravatar netblue302021-10-09
| | |\ \ | | | | | | | | | | Revert "allow/deny fbuilder"
| | | * | Revert "allow/deny fbuilder"Libravatar Kelvin M. Klann2021-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4438f14f2892b5c88d158ae8fad0a80a2eebfd44. Also, partially revert related commit e4307b409 ("fix whitelist/allow in make test-utils") to keep the tests working. The profiles are being generated using aliases, which are not used on the profiles in the repository. So generate them using the normal commands for consistency. See also commit dd13595b8 ("Revert "allow/deny help and man pages"") / PR #4502. Relates to #4410. Misc: I noticed this on issue #4592.
| | | * | build_profile.c: fix typo of "begins"Libravatar Kelvin M. Klann2021-10-05
| | | | | | | | | | | | | | | | | | | | Added on commit 9af2c1472 ("Better debug handling.").
| | * | | Merge pull request #4587 from kmk3/fix-vscodiumLibravatar netblue302021-10-09
| | |\ \ \ | | | | | | | | | | | | Fix vscodium
| | | * | | Add codium.profile as a redirect to vscodium.profileLibravatar Kelvin M. Klann2021-10-04
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both base names are valid: $ grep '^NAME' /etc/os-release NAME="Artix Linux" $ pacman -Q vscodium-bin vscodium-bin 1.60.2-2 $ pacman -Qlq vscodium-bin | grep -v -e '/$' -e /resources/ | grep /bin/ /usr/bin/codium /usr/bin/vscodium /usr/share/vscodium-bin/bin/codium Note: The first two paths are symlinks to the third one. Fixes #3871.
| | * | | Merge pull request #4586 from smitsohu/traceLibravatar netblue302021-10-09
| | |\ \ \ | | | | | | | | | | | | trace, tracelog: don't truncate /etc/ld.so.preload in sandbox
| | | * | | trace, tracelog: don't truncate /etc/ld.so.preloadLibravatar smitsohu2021-10-05
| | | | | |
| | * | | | Merge pull request #4510 from rusty-snake/allow-tray-conditionLibravatar netblue302021-10-09
| | |\ \ \ \ | | | | | | | | | | | | | | Add new condition ALLOW_TRAY
| | | * | | | Add new condition ALLOW_TRAYLibravatar rusty-snake2021-09-04
| | | | | | |
| | * | | | | profile parsing fixesLibravatar smitsohu2021-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | results from a systematic search for strncmp calls with a suspicious (non-fitting) integer literal as third argument
| | * | | | | mountinfo: get mount id from failed call to name_to_handle_atLibravatar smitsohu2021-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables recursive remounting on very old kernels, which has some relevance for SailfishOS community ports.
| | * | | | | simplify recursive remountingLibravatar smitsohu2021-10-05
| | | |_|/ / | | |/| | |
| * | | | | firejail.h: add missing linux/limits.h includeLibravatar Kelvin M. Klann2021-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | firejail.h uses PATH_MAX when defining a macro. Note that ARG_MAX and PATH_MAX are not guaranteed to be (and potentially should not be) defined. From POSIX.1-2017's limits.h(0p)[1]: > A definition of one of the symbolic constants in the following list > shall be omitted from the <limits.h> header on specific > implementations where the corresponding value is equal to or greater > than the stated minimum, but where the value can vary depending on the > file to which it is applied. The actual value supported for a > specific pathname shall be provided by the pathconf() function. Use linux/limits.h instead of limits.h because glibc's limits.h deliberately undefines ARG_MAX. See glibc commit f96853beaf ("* sysdeps/unix/sysv/linux/bits/local_lim.h: Undefined ARG_MAX if", 2008-03-27)[2]. From /usr/include/bits/local_lim.h (glibc 2.33-5 on Artix Linux): #ifndef ARG_MAX # define __undef_ARG_MAX #endif /* The kernel sources contain a file with all the needed information. */ #include <linux/limits.h> /* [...] */ /* Have to remove ARG_MAX? */ #ifdef __undef_ARG_MAX # undef ARG_MAX # undef __undef_ARG_MAX #endif So if a file uses ARG_MAX (currently only cmdline.c) and limits.h (or a firejail.h that includes limits.h) is included before linux/limits.h, then the build will fail on glibc. Build log from using limits.h (instead of linux/limits.h) on firejail.h: $ make clean >/dev/null && make >/dev/null cmdline.c:145:12: error: use of undeclared identifier 'ARG_MAX'; did you mean 'CFG_MAX'? if (len > ARG_MAX) { ^~~~~~~ CFG_MAX ./firejail.h:805:2: note: 'CFG_MAX' declared here CFG_MAX // this should always be the last entry ^ [...] Fixes #4578. [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html [2] https://sourceware.org/git/?p=glibc.git;a=commit;h=f96853beafc26d4f030961b0b67a79b5bfad5733
| * | | | | Remove unnecessary linux/limits.h includeLibravatar Kelvin M. Klann2021-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | None of the files affected use any macros from linux/limits.h: $ git grep -Fl 'NGROUPS_MAX ARG_MAX LINK_MAX MAX_CANON MAX_INPUT NAME_MAX PATH_MAX PIPE_BUF XATTR_NAME_MAX XATTR_SIZE_MAX XATTR_LIST_MAX RTSIG_MAX' -- src src/firejail/cmdline.c src/firejail/firejail.h src/libtrace/libtrace.c src/libtracelog/libtracelog.c Environment: $ grep '^NAME' /etc/os-release NAME="Artix Linux" $ pacman -Qo /usr/include/linux/limits.h /usr/include/linux/limits.h is owned by linux-api-headers 5.12.3-1 Note: This include has been present on all of the affected files since their inception. For restrict_users.c, that's on commit 4f003daec ("prevent leaking user information by modifying /home directory, /etc/passwd and /etc/group") and for every other file, it's on commit 137985136 ("Baseline firejail 0.9.28"). Relates to #4578.
| * | | | | main.c: remove unnecessary limits.h includeLibravatar Kelvin M. Klann2021-09-28
| | |_|_|/ | |/| | | | | | | | | | | | | Relates to #4578.
* | | | | s/S_IWRITE/S_IWUSR/Libravatar Kelvin M. Klann2021-10-02
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are equivalent, but only the latter is POSIX. See sys_stat.h(0p) of POSIX.1-2017[1]. From Section 14.9.5, The Mode Bits for Access Permission of the glibc manual[2]: > S_IWUSR > S_IWRITE > > Write permission bit for the owner of the file. Usually 0200. > S_IWRITE is an obsolete synonym provided for BSD compatibility. Current usage: $ git grep -F S_IWRITE -- src | wc -l 11 $ git grep -F S_IWUSR -- src | wc -l 26 Commands used to search and replace: $ git grep -l -z S_IWRITE -- src | xargs -0 -I '{}' sh -c \ "printf '%s\n' \"\`sed 's/S_IWRITE/S_IWUSR/g' '{}'\`\" >'{}'" Note: The other related non-POSIX macros are not used anywhere: $ git grep -F -e S_IREAD -e S_IEXEC -- src $ [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [2] https://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html
* | | | Merge pull request #4585 from smitsohu/euidLibravatar smitsohu2021-10-02
|\ \ \ \ | |/ / / |/| | | add more EUID improvements
| * | | add more EUID improvementsLibravatar smitsohu2021-10-01
| | |/ | |/|
* / | trim excess whitespaceLibravatar a13460542021-09-25
|/ /
* | private-lib fixupLibravatar smitsohu2021-09-25
| | | | | | | | | | don't try to read /usr/bin/firejail if private-bin removed it from the sandbox filesystem
* | private-lib: check firejail libraries as root user (#4576)Libravatar smitsohu2021-09-25
| | | | | | | | | | | | users, and fldd in particular, might have no read permission on the firejail executable, make that ok by running fldd as root
* | Merge pull request #4564 from lecso7/masterLibravatar netblue302021-09-24
|\ \ | | | | | | Create goldendict.profile