sd-journal: refuse entry objects with an empty boot ID
Otherwise, e.g. sd_journal_get_monotonic_usec() return an empty boot ID when called for such a broken entry object. Such a broken object may be stored when the system was not cleanly shutdown. Fixes #29167.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
1365355d14
commit
c650d4cdef
@@ -991,6 +991,11 @@ static int check_object(JournalFile *f, Object *o, uint64_t offset) {
|
||||
le64toh(o->entry.monotonic),
|
||||
offset);
|
||||
|
||||
if (sd_id128_is_null(o->entry.boot_id))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Invalid object entry with an empty boot ID: %" PRIu64,
|
||||
offset);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user