Skip to content

[PW_SID:1100131] [v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler#2005

Open
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1100131
Open

[PW_SID:1100131] [v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler#2005
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1100131

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1100131 applied to workflow__riscv__fixes

Name: [v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1100131
Version: 2

The SUSP handler checks that all other vCPUs are stopped before
entering system suspend, but a concurrent HSM HART_START can start
a vCPU after it has already passed the check.

This is a known TOCTOU race. We do not fix it because:
1. Triggering it requires a pathological guest.
2. Only guest state is at risk, not host integrity.
3. Userspace can double-check vCPU states before suspend.

Add a comment documenting the race and the rationale for not fixing it.

Signed-off-by: Jiakai Xu <jiakaiPeanut@gmail.com>
Signed-off-by: Jiakai Xu <xujiakai2025@iscas.ac.cn>
Assisted-by: YuanSheng:DeepSeek-V3.2
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.65 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1037.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1416.14 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.43 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.74 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 85.15 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] RISC-V: KVM: Document a TOCTOU race in SBI system suspend handler"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants