Commit fba4cea
committed
configfs-tsm-report: Fix NULL dereference of tsm_ops
Unlike sysfs, the lifetime of configfs objects is controlled by
userspace. There is no mechanism for the kernel to find and delete all
created config-items. Instead, the configfs-tsm-report mechanism has an
expectation that tsm_unregister() can happen at any time and cause
established config-item access to start failing.
That expectation is not fully satisfied. While tsm_report_read(),
tsm_report_{is,is_bin}_visible(), and tsm_report_make_item() safely fail
if tsm_ops have been unregistered, tsm_report_privlevel_store()
tsm_report_provider_show() fail to check for ops registration. Add the
missing checks for tsm_ops having been removed.
Now, in supporting the ability for tsm_unregister() to always succeed,
it leaves the problem of what to do with lingering config-items. The
expectation is that the admin that arranges for the ->remove() (unbind)
of the ${tsm_arch}-guest driver is also responsible for deletion of all
open config-items. Until that deletion happens, ->probe() (reload /
bind) of the ${tsm_arch}-guest driver fails.
This allows for emergency shutdown / revocation of attestation
interfaces, and requires coordinated restart.
Fixes: 70e6f7e ("configfs-tsm: Introduce a shared ABI for attestation reports")
Cc: [email protected]
Cc: Suzuki K Poulose <[email protected]>
Cc: Steven Price <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Borislav Petkov (AMD) <[email protected]>
Cc: Tom Lendacky <[email protected]>
Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
Reported-by: Cedric Xing <[email protected]>
Reviewed-by: Kai Huang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Dan Williams <[email protected]>1 parent 8ffd015 commit fba4cea
1 file changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| |||
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
220 | 231 | | |
221 | 232 | | |
222 | 233 | | |
| |||
284 | 295 | | |
285 | 296 | | |
286 | 297 | | |
287 | | - | |
| 298 | + | |
288 | 299 | | |
289 | 300 | | |
290 | 301 | | |
| |||
421 | 432 | | |
422 | 433 | | |
423 | 434 | | |
| 435 | + | |
424 | 436 | | |
425 | 437 | | |
426 | 438 | | |
427 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
428 | 446 | | |
429 | 447 | | |
| 448 | + | |
430 | 449 | | |
431 | 450 | | |
432 | 451 | | |
| |||
459 | 478 | | |
460 | 479 | | |
461 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
462 | 486 | | |
463 | 487 | | |
464 | 488 | | |
| |||
470 | 494 | | |
471 | 495 | | |
472 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
473 | 500 | | |
474 | 501 | | |
475 | 502 | | |
| |||
0 commit comments