diff options
author | Jarkko Sakkinen <[email protected]> | 2022-09-06 03:02:20 +0300 |
---|---|---|
committer | Dave Hansen <[email protected]> | 2022-09-08 13:27:44 -0700 |
commit | 133e049a3f8c91b175029fb6a59b6039d5e79cba (patch) | |
tree | 3e4e12570082dcf29828225a6226ce85a75a09a0 /lib/mpi/mpi-sub-ui.c | |
parent | 5515d21c6817bc27b0b13c61edf22b09b58bc647 (diff) |
x86/sgx: Do not fail on incomplete sanitization on premature stop of ksgxd
Unsanitized pages trigger WARN_ON() unconditionally, which can panic the
whole computer, if /proc/sys/kernel/panic_on_warn is set.
In sgx_init(), if misc_register() fails or misc_register() succeeds but
neither sgx_drv_init() nor sgx_vepc_init() succeeds, then ksgxd will be
prematurely stopped. This may leave unsanitized pages, which will result a
false warning.
Refine __sgx_sanitize_pages() to return:
1. Zero when the sanitization process is complete or ksgxd has been
requested to stop.
2. The number of unsanitized pages otherwise.
Fixes: 51ab30eb2ad4 ("x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list")
Reported-by: Paul Menzel <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Reinette Chatre <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/linux-sgx/[email protected]/T/#u
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'lib/mpi/mpi-sub-ui.c')
0 files changed, 0 insertions, 0 deletions