Skip to content

Commit 2e223e9

Browse files
committed
components: declare what the technique discloses, on every component
`addr:` was optional, unvalidated free text that the hardening report interpolated into prose. 98 components declared it, 15 did not, and the values had drifted to four spellings -- including phys-extent, which names a shape `pos` already carries on the wire, and none, which meant "no address" but rendered as though it meant "system facts". The field is renamed to discloses: and required of every component, with each value set from what that component's emitters actually produce. Four declarations disagreed with their own source: proc_config, boot_config and proc_cpuinfo each claimed `none` while emitting an address. Mandatory rather than optional because the JSON publishes each component's whole KASLD_META block, so this is a per-component field external consumers read. Present on some components and absent on others, its absence would encode nothing but which part of the hardening renderer happens to consult it -- and an absent value cannot be told apart from an unconsidered omission, which is how the drift went unnoticed. The vocabulary closes to virtual/physical/both/facts, checked by check-component-meta. `both` now has users; it was documented and claimed by nothing. The report still prefers what a component actually disclosed. The compile-time surface section reads only that: it already skips everything but OUTCOME_SUCCESS, so a record attributed to the component always exists and the declaration could never be reached there. Only the hardware side-channel section consults it, being the one that lists a component whether or not it produced anything. The render tests seeded the old key, so they passed without touching any of this. They now seed discloses:, and two tests cover the behaviour itself: observation overrides a contrary declaration, and a component that produced nothing and declares nothing yields no kind at all.
1 parent 99e026f commit 2e223e9

118 files changed

Lines changed: 260 additions & 142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/components/acpi_mrrm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ KASLD_EXPLAIN(
6565
// Untested: no hardware with an ACPI MRRM table available for testing.
6666
KASLD_META("method:parsed\n"
6767
"phase:inference\n"
68-
"addr:physical\n"
68+
"discloses:physical\n"
6969
"config:CONFIG_ACPI_MRRM\n");
7070

7171
int main(void) {

src/components/alsa_seq_ext_ptr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ KASLD_EXPLAIN(
213213
KASLD_META("method:parsed\n"
214214
"phase:inference\n"
215215
"live:1\n"
216-
"addr:virtual\n"
216+
"discloses:virtual\n"
217217
"patch:v7.2\n");
218218

219219
/* Perform one self-addressed variable-event round trip on an already-open

src/components/arm64_no_seed.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ KASLD_EXPLAIN("On non-EFI device-tree arm64 with no FDT /chosen/kaslr-seed and "
3939
"the compile-time default; emits SF_VIRT_KASLR_DISABLED for the "
4040
"engine pin rule. arm64 only.");
4141
KASLD_META("method:parsed\n"
42-
"phase:inference\n");
42+
"phase:inference\n"
43+
"discloses:facts\n");
4344

4445
int main(void) {
4546
if (kasld_kaslr_disabled_text_default())

src/components/bcm_msg_head_struct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ KASLD_EXPLAIN(
5858
KASLD_META("method:heuristic\n"
5959
"phase:probing\n"
6060
"live:1\n"
61-
"addr:virtual\n"
61+
"discloses:virtual\n"
6262
"cve:CVE-2021-34693\n"
6363
"patch:v5.12\n"
6464
"config:CONFIG_CAN\n"

src/components/boot_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ KASLD_EXPLAIN(
3333

3434
KASLD_META("method:detection\n"
3535
"phase:inference\n"
36-
"addr:none\n");
36+
"discloses:virtual\n");
3737

3838
static unsigned long get_kernel_addr_boot_config(FILE *fp) {
3939
if (kconfig_has_kaslr(fp))

src/components/boot_params_e820.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ KASLD_EXPLAIN(
8282

8383
KASLD_META("method:parsed\n"
8484
"phase:inference\n"
85-
"addr:physical\n");
85+
"discloses:physical\n");
8686

8787
/* Path and size of the boot_params sysfs binary attribute. */
8888
#define BOOT_PARAMS_PATH "/sys/kernel/boot_params/data"

src/components/boot_params_facts.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ KASLD_EXPLAIN("Reads /sys/kernel/boot_params/data for the exact kernel "
1414
"init_size and CONFIG_PHYSICAL_ALIGN, emitted as scalar facts "
1515
"tightening the KASLR ceiling and slot granularity. x86 only.");
1616
KASLD_META("method:parsed\n"
17-
"phase:inference\n");
17+
"phase:inference\n"
18+
"discloses:facts\n");
1819

1920
int main(void) {
2021
unsigned long v;

src/components/bootconfig_facts.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ KASLD_EXPLAIN("Reads the kernel boot config (/boot/config-*, /lib/modules/...) "
1313
"for CONFIG_RANDOMIZE_BASE_MAX_OFFSET and CONFIG_PAGE_OFFSET, "
1414
"emitted as scalar facts. No privileges.");
1515
KASLD_META("method:parsed\n"
16-
"phase:inference\n");
16+
"phase:inference\n"
17+
"discloses:facts\n");
1718

1819
int main(void) {
1920
unsigned long v;

src/components/bpf_verifier_ksym.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ KASLD_EXPLAIN(
197197
KASLD_META("method:parsed\n"
198198
"phase:inference\n"
199199
"live:1\n"
200-
"addr:virtual\n"
200+
"discloses:virtual\n"
201201
"sysctl:unprivileged_bpf_disabled>=1\n"
202202
"bypass:CAP_BPF\n"
203203
"config:CONFIG_DEBUG_INFO_BTF\n"

src/components/bpf_verifier_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ KASLD_EXPLAIN(
121121
KASLD_META("method:parsed\n"
122122
"phase:inference\n"
123123
"live:1\n"
124-
"addr:virtual\n"
124+
"discloses:virtual\n"
125125
"sysctl:unprivileged_bpf_disabled>=1\n"
126126
"bypass:CAP_BPF\n"
127127
"patch:v7.2\n");

0 commit comments

Comments
 (0)