diff options
author | Sean Christopherson <[email protected]> | 2022-04-15 00:43:43 +0000 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2022-04-21 13:16:11 -0400 |
commit | 2031f2876896d82aca7e82f84accd9181b9587fb (patch) | |
tree | 3738b7477aeb1e7436fa3a01a0a3ff63d0266952 /lib/test_fortify/write_overflow-strlcpy-src.c | |
parent | fdd6f6ac2e489b9b256cd05a880d13bfdbac7c2e (diff) |
KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused
Add wrappers to acquire/release KVM's SRCU lock when stashing the index
in vcpu->src_idx, along with rudimentary detection of illegal usage,
e.g. re-acquiring SRCU and thus overwriting vcpu->src_idx. Because the
SRCU index is (currently) either 0 or 1, illegal nesting bugs can go
unnoticed for quite some time and only cause problems when the nested
lock happens to get a different index.
Wrap the WARNs in PROVE_RCU=y, and make them ONCE, otherwise KVM will
likely yell so loudly that it will bring the kernel to its knees.
Signed-off-by: Sean Christopherson <[email protected]>
Tested-by: Fabiano Rosas <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions