system: initial dmesgd implementation

dmesgd is a daemon for collection of non-fatal kernel error reports on
production devices. Its main purpose is to drop the syslog_read
permission from system_server by performing error log parsing in a
separate process.

Every time a memory corruption is detected in the kernel, system_server
sets the dmesgd.start property to 1 to notify dmesgd about new reports.
init then starts dmesgd, which spawns a dmesg process, parses its output
and puts the found KFENCE/KASAN reports in DropBox.

Right now dmesgd just reimplements the corresponding part of
BootReceiver.java
(https://android.googlesource.com/platform/frameworks/base/+/e070aa86f2d72318adf4e9ee4d899f78da885cfc),
i.e. it only collects non-fatal reports from KFENCE and KASAN.
But in the future it can be extended to handle other types of errors
that need to be collected.

Bug: 215095687
Test: build and run dmesg_parser_test on device
Test: run dmesgd on a user device with injected kernel bugs
Change-Id: I388098ef0384d9165f2f41e11244ce8518fd13b1
7 files changed