mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
bhyve: tpm: allow the last dword of the CRB command buffer
The bounds check rejected any access ending exactly at the end of the
register block, so a four byte write at offset 0xffc was refused,
returning EINVAL and killing the VM.
MFC after: 1 week
PR: 291063
Fixes: 75909086a4 ("bhyve: allow read/write to full CRB buffer")
Sponsored by: Defenso
Signed-off-by: Quentin Thébault <[email protected]>
Reviewed-by: aokblast, kevans, markj
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2362
This commit is contained in:
1 parent
602d1b994a
commit
4505445ccd
1 file changed
+1
-1
@@ -321,7 +321,7 @@ tpm_crb_mem_handler(struct vcpu *vcpu __unused, const int dir,
|
||||
crb = arg1;
|
||||
|
||||
off = addr - TPM_CRB_ADDRESS;
|
||||
if (off > TPM_CRB_REGS_SIZE || off + size >= TPM_CRB_REGS_SIZE) {
|
||||
if (off > TPM_CRB_REGS_SIZE || off + size > TPM_CRB_REGS_SIZE) {
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user