Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147392411
D19713.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.diff
View Options
Index: head/sys/dev/tpm/tpm20.h
===================================================================
--- head/sys/dev/tpm/tpm20.h
+++ head/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: head/sys/dev/tpm/tpm20.c
===================================================================
--- head/sys/dev/tpm/tpm20.c
+++ head/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
Wed, Mar 11, 2:42 PM (6 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29512628
Default Alt Text
D19713.diff (1 KB)
Attached To
Mode
D19713: tpm: Prevent session hijack.
Attached
Detach File
Event Timeline
Log In to Comment