Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seccomp list output goes to stdout instead of stderr #4328

Closed
7 tasks done
slowpeek opened this issue Jun 3, 2021 · 2 comments
Closed
7 tasks done

Seccomp list output goes to stdout instead of stderr #4328

slowpeek opened this issue Jun 3, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@slowpeek
Copy link
Contributor

slowpeek commented Jun 3, 2021

Bug and expected behavior

  • Some firejail output goes to stdout instead of stderr.

Reproduce
Steps to reproduce the behavior:

  1. Run and see
    firejail --seccomp=\!name_to_handle_at pwd 2>/dev/null
    Seccomp list in: !name_to_handle_at, check list: @default-keep, prelist: unknown,
    Seccomp list in: !name_to_handle_at, check list: @default-keep, prelist: unknown,
    /etc/firejail
    
    It is not an artificial example btw. The seccomp filter comes from keepassxc profile inherited by keepassxc-cli hence the above lines are prepended to keepassxc-cli exported xml. FIREJAIL_QUIET=yes does suppress the lines but those are definitely debug information, it should not pollute stdout by default.

Environment

  • ubuntu focal
  • 0.9.64.4

Additional context
Source reference:

firejail/src/lib/syscall.c

Lines 1675 to 1695 in c50dd74

void syscalls_in_list(const char *list, const char *slist, int fd, char **prelist, char **postlist, bool native) {
(void) fd;
SyscallCheckList sl;
// these syscalls are used by firejail after the seccomp filter is initialized
sl.slist = slist;
sl.prelist = NULL;
sl.postlist = NULL;
syscall_check_list(list, syscall_in_list, 0, 0, &sl, native);
if (!arg_quiet) {
printf("Seccomp list in: %s,", list);
if (sl.slist)
printf(" check list: %s,", sl.slist);
if (sl.prelist)
printf(" prelist: %s,", sl.prelist);
if (sl.postlist)
printf(" postlist: %s", sl.postlist);
printf("\n");
}
*prelist = sl.prelist;
*postlist = sl.postlist;
}

Checklist

  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • I have performed a short search for similar issues (to avoid opening a duplicate).
  • If it is a AppImage, --profile=PROFILENAME is used to set the right profile.
  • Used LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAM to get english error-messages.
  • I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
  • This is not a question. Questions should be asked in https://github.com/netblue30/firejail/discussions.
@rusty-snake
Copy link
Collaborator

  1. IMHO we should print these messages only with arg_debug. Normal users likely doesn't even know what all those seccomp is.
  2. For stdout vs. stderr we have Where to print debug messages (stdout or stderr)? #3749/Rework quiet, debug and normal console output #4275

@netblue30
Copy link
Owner

I'm sending them to stderr for now, we'll have to rework it for #3749 and #4275.

@kmk3 kmk3 changed the title Some firejail output goes to stdout instead of stderr Seccomp list output goes to stdout instead of stderr Jan 21, 2022
@kmk3 kmk3 added the bug Something isn't working label Jan 21, 2022
kmk3 added a commit to kmk3/firejail that referenced this issue Jan 26, 2022
Note: They are added in the order that the issues were fixed/closed.

Note2: The issues were found through the following url:

https://github.com/netblue30/firejail/issues?q=is%3Aclosed+label%3Abug+-label%3Asecurity+closed%3A%3E2021-06-29+

The date used is the release date of 0.9.66, so in theory the query
should return every bug closed after that.  Security-related issues are
excluded because they will be added separately.

Note3: All issues other than netblue30#4328 were fixed before 0.9.68rc1.

Relates to netblue30#2758 netblue30#4235 netblue30#4328 netblue30#4387 netblue30#4395 netblue30#4460 netblue30#4467 netblue30#4558 netblue30#4560 netblue30#4586.
@kmk3 kmk3 moved this to Done (on RELNOTES) in Release 0.9.68 Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done (on RELNOTES)
Development

No branches or pull requests

4 participants