Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154953123
D19713.id55452.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D19713.id55452.diff
View Options
Index: sys/dev/tpm/tpm20.h
===================================================================
--- sys/dev/tpm/tpm20.h
+++ sys/dev/tpm/tpm20.h
@@ -120,6 +120,7 @@
uint8_t *buf;
size_t pending_data_length;
+ lwpid_t owner_tid;
struct callout discard_buffer_callout;
#ifdef TPM_HARVEST
Index: sys/dev/tpm/tpm20.c
===================================================================
--- sys/dev/tpm/tpm20.c
+++ sys/dev/tpm/tpm20.c
@@ -77,6 +77,10 @@
callout_stop(&sc->discard_buffer_callout);
sx_xlock(&sc->dev_lock);
+ if (sc->owner_tid != uio->uio_td->td_tid) {
+ sx_xunlock(&sc->dev_lock);
+ return (EPERM);
+ }
bytes_to_transfer = MIN(sc->pending_data_length, uio->uio_resid);
if (bytes_to_transfer > 0) {
@@ -128,9 +132,11 @@
result = sc->transmit(sc, byte_count);
- if (result == 0)
+ if (result == 0) {
callout_reset(&sc->discard_buffer_callout,
TPM_READ_TIMEOUT / tick, tpm20_discard_buffer, sc);
+ sc->owner_tid = uio->uio_td->td_tid;
+ }
sx_xunlock(&sc->dev_lock);
return (result);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 7:18 AM (2 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32561403
Default Alt Text
D19713.id55452.diff (1 KB)
Attached To
Mode
D19713: tpm: Prevent session hijack.
Attached
Detach File
Event Timeline
Log In to Comment