1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:37:45 +00:00

Kernel: Set "pledge_violation" coredump metadata in REQUIRE_PROMISE()

Similar to LibC storing an assertion message before aborting, process
death by pledge violation now sets a "pledge_violation" key with the
respective pledge name as value in its coredump metadata, which the
CrashReporter will then show.
This commit is contained in:
Linus Groh 2021-01-20 20:10:13 +01:00 committed by Andreas Kling
parent 7e5c49b755
commit 678919e9c1
2 changed files with 6 additions and 0 deletions

View file

@ -57,6 +57,8 @@ struct [[gnu::packed]] ProcessInfo {
// - "pid" (int)
// - "termination_signal" (u8)
// - "executable_path" (String)
// - "arguments" (Vector<String>)
// - "environment" (Vector<String>)
char json_data[]; // Null terminated
};
@ -91,6 +93,7 @@ struct [[gnu::packed]] Metadata {
//
// Well-known keys:
// - "assertion": Used by LibC's __assertion_failed() to store assertion info
// - "pledge_violation": Used by the Kernel's REQUIRE_PROMISE() to store pledge violation info
char json_data[]; // Null terminated
};