Page MenuHomeFreeBSD

MFC r278479,278494,278525,278545,278592,279237,280410:

Authored by will on Aug 24 2017, 12:13 AM.



This change merges devctl notification for userland coredumps.

r278479 (rpaulo):

Notify devd(8) when a process crashed.

This change implements a notification (via devctl) to userland when
the kernel produces coredumps after a process has crashed.
devd can then run a specific command to produce a human readable crash
report.  The command is most usually a helper that runs gdb/lldb
commands on the file/coredump pair.  It's possible to use this
functionality for implementing automatic generation of crash reports.

devd(8) will be notified of the full path of the binary that crashed and
the full path of the coredump file.

r278494 (rpaulo):

Sanitise the coredump file names sent to devd.

While there, add a sysctl to turn this feature off as requested by kib@.

r278525 (rpaulo):

Remove a printf and an strlen() from the coredump code.

r278545 (rpaulo):

Restore the data array in coredump(), but use a different style to
calculate the length.

r278592 (rpaulo):

Remove check against NULL after M_WAITOK.

r279237 (kib):

Keep a reference on the coredump vnode for vn_fullpath() call.  Do it
by moving vn_close() after the point where notification is sent.

r280410 (rpaulo):

Disable coredump_devctl because it could lead to leaking paths to jails.
Test Plan

Install updated kernel. Test with and without sysctl kern.coredump_devctl=1,
with an appropriate devd configuration & absolute path in kern.corefile.

Diff Detail

rS FreeBSD src repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 11218
Build 11596: arc lint + arc unit

Event Timeline

will created this revision.Aug 24 2017, 12:13 AM
will retitled this revision from MFC r278479,278494,278525,278545,278592,279237,280410 from HEAD to stable/10. to MFC r278479,278494,278525,278545,278592,279237,280410:.Aug 24 2017, 2:26 AM
will edited the summary of this revision. (Show Details)
will abandoned this revision.Aug 24 2017, 6:20 PM