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

bugfix: firemon: skip coredump if unsupported #6415

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Jul 24, 2024

The coredump-related code fails to build on Linux kernel version 3.8 as
apparently it only exists on Linux since version 3.10:

docker run --platform linux/386 --rm -it satmandu/crewbuild:386
[...]
./configure && make
[...]
gcc -ggdb -O2 -DVERSION='"0.9.73"' [...] -march=i686  -c ../../src/firemon/procevent.c -o ../../src/firemon/procevent.o
../../src/firemon/procevent.c: In function ‘procevent_monitor’:
../../src/firemon/procevent.c:399:38: error: ‘PROC_EVENT_COREDUMP’ undeclared (first use in this function); did you mean ‘PROC_EVENT_COMM’?
  399 |                                 case PROC_EVENT_COREDUMP:
      |                                      ^~~~~~~~~~~~~~~~~~~
      |                                      PROC_EVENT_COMM
../../src/firemon/procevent.c:399:38: note: each undeclared identifier is reported only once for each function it appears in
../../src/firemon/procevent.c:400:66: error: ‘union <anonymous>’ has no member named ‘coredump’
  400 |                                         pid = proc_ev->event_data.coredump.process_tgid;
      |                                                                  ^
make[1]: *** [../../src/prog.mk:25: ../../src/firemon/procevent.o] Error 1
make[1]: Leaving directory '/home/chronos/user/firejail/src/firemon'
make: *** [Makefile:72: src/firemon/firemon] Error 2

Environment: gcc 14.1.0, glibc 2.23 and linuxheaders 3.8 on ChromeOS
M58.

Misc: @Zopolis4 also reports that "All i686 chromebooks have a kernel
version of 3.8".

This amends commit e11949a ("add support for comm, coredump, and prctl
procevents in firemon", 2024-04-30).

Fixes #6414.

Reported-by: @Zopolis4

@kmk3
Copy link
Collaborator Author

kmk3 commented Jul 24, 2024

@Zopolis4

Does this work?

Also, what is the version of the Linux API headers?

On Arch:

$ pacman -Q linux-api-headers
linux-api-headers 6.8-1

Copy link
Collaborator

@glitsj16 glitsj16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Zopolis4
Copy link

Does this work?

Yes.

Also, what is the version of the Linux API headers?

Linux header version:

$ crew search -v linuxheaders
linuxheaders: Linux headers for Chrome OS.
https://kernel.org/
Version: 3.8
License: GPL-2

The coredump-related code fails to build on Linux kernel version 3.8 as
apparently it only exists on Linux since version 3.10:

    docker run --platform linux/386 --rm -it satmandu/crewbuild:386
    [...]
    ./configure && make
    [...]
    gcc -ggdb -O2 -DVERSION='"0.9.73"' [...] -march=i686  -c ../../src/firemon/procevent.c -o ../../src/firemon/procevent.o
    ../../src/firemon/procevent.c: In function ‘procevent_monitor’:
    ../../src/firemon/procevent.c:399:38: error: ‘PROC_EVENT_COREDUMP’ undeclared (first use in this function); did you mean ‘PROC_EVENT_COMM’?
      399 |                                 case PROC_EVENT_COREDUMP:
          |                                      ^~~~~~~~~~~~~~~~~~~
          |                                      PROC_EVENT_COMM
    ../../src/firemon/procevent.c:399:38: note: each undeclared identifier is reported only once for each function it appears in
    ../../src/firemon/procevent.c:400:66: error: ‘union <anonymous>’ has no member named ‘coredump’
      400 |                                         pid = proc_ev->event_data.coredump.process_tgid;
          |                                                                  ^
    make[1]: *** [../../src/prog.mk:25: ../../src/firemon/procevent.o] Error 1
    make[1]: Leaving directory '/home/chronos/user/firejail/src/firemon'
    make: *** [Makefile:72: src/firemon/firemon] Error 2

Environment: gcc 14.1.0, glibc 2.23 and linuxheaders 3.8 on ChromeOS
M58.

Misc: @Zopolis4 also reports that "All i686 chromebooks have a kernel
version of 3.8".

This amends commit e11949a ("add support for comm, coredump, and prctl
procevents in firemon", 2024-04-30).

Fixes netblue30#6414.

Reported-by: @Zopolis4
@kmk3 kmk3 merged commit 60ea220 into netblue30:master Jul 25, 2024
13 checks passed
@kmk3 kmk3 deleted the bugfix-firemon-coredump branch July 25, 2024 21:41
kmk3 added a commit that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

build: error: ‘PROC_EVENT_COREDUMP’ undeclared on Linux <3.10
3 participants