mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1039] ASSERT_PERMS_FD should use fstat() rather than stat() #705
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#705
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 @setharnold on GitHub (Jan 11, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1039
Hello, please note that ASSERT_PERMS_FD() (and thus also ASSERT_PERMS_STREAM()) have a mistake that would lead to a segmentation violation, if they were actually used in the code:
#define ASSERT_PERMS_FD(fd, uid, gid, mode)
do {
struct stat s;
if (stat(fd, &s) == -1) errExit("stat");\ ### should use fstat() instead of stat()
assert(s.st_uid == uid);
assert(s.st_gid == gid);
assert((s.st_mode & 07777) == (mode));
} while (0)
https://github.com/netblue30/firejail/blob/master/src/firejail/firejail.h#L108
Thanks
@netblue30 commented on GitHub (Jan 14, 2017):
I've pushd the fix on all 3 branches, thanks.