Page MenuHomeFreeBSD

fix devctl core file name
Needs ReviewPublic

Authored by aurelien.cazuc.external_stormshield.eu on Thu, Feb 13, 1:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 17, 11:25 AM
Unknown Object (File)
Thu, Feb 13, 6:27 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

the name of the core file written to the devctl socket is invalid when rotation occurs:
the effective core file is the oldest one, but the name sent to the devctl is the last tested one

in the following situation, files are scanned from test-0.core to test-4.core, but the oldest is test-2.core
the core file will be written to test-2.core, but the devctl will receive test-4.core

-rw-r--r--   1 root wheel  0 Feb 13 14:32 test-0.core
-rw-r--r--   1 root wheel  0 Feb 13 14:32 test-1.core
-rw-r--r--   1 root wheel  0 Feb 13 14:31 test-2.core
-rw-r--r--   1 root wheel  0 Feb 13 14:31 test-3.core
-rw-r--r--   1 root wheel  0 Feb 13 14:31 test-4.core

with the fix, test-2.core will be sent to the devctl socket

Sponsored by: Stormshield

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/kern/kern_sig.c
3881–3882

We can likely drop the (void) cast here and below

3923

I dislike this repetition. It's full of magic and wonder. It's too clever by half, I think, to copy since there's a lot of subtle things going on here. Making it a static inline function seems much safer.