aboutsummaryrefslogtreecommitdiff
path: root/lib/esan/esan_flags.cpp
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-27 14:01:51 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-09-01 18:24:46 +0000
commit5319035afacceaa267792ec193eb03fa51c972f7 (patch)
tree5b5efe63fb9102b96f902f14f6c1a3631344b99b /lib/esan/esan_flags.cpp
parent4e0f283fb97a7b0903adc7bc3ef2f6e07167c73e (diff)
tpm: Move user copies outside the TPM 1.2 lockHEADmain
The character-device paths held the transaction and lifecycle lock while uiomove() accessed user memory. A user page fault could therefore delay suspend or detach, and a copyout failure occurred while the TPM response was still active. Copy commands into the bounded stack buffer before taking the lock. For reads, validate the response header, buffer the complete response while the lock is held, finish the TPM transaction, and copy it to userspace after unlocking. Use a non-blocking allocation so memory pressure cannot turn response buffering into another lifecycle wait. NetBSD uses the same separation but limits responses to its fixed 1 KiB buffer. Allocate the TPM-advertised response length to preserve the existing FreeBSD support for larger streamed responses. On a ThinkPad T440p with an STMicro TPM 1.2, a PCR read into a 4 KiB userspace buffer returned the expected 30-byte response. A deliberately short five-byte read failed cleanly, relinquished locality zero, and the next PCR read succeeded. Reviewed by: kevans MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59238
Diffstat (limited to 'lib/esan/esan_flags.cpp')
0 files changed, 0 insertions, 0 deletions