lkml.org 
[lkml]   [2016]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tpm: fix buffer overflow in /dev/tpm0
On Sun, Sep 11, 2016 at 03:19:00PM +0300, Jarkko Sakkinen wrote:
> tpm_write() does not check whether the buffer has at least enough space
> for the header before passing it to tpm_transmit() so an overflow can
> happen.

Eh?

tpm_write uses a hard wired buffer size of TPM_BUFSIZE when working
with tpm_transmit.

in_size is never used except for the copy. We should probably fix that
to sanity check the header length vs in_size.

That doesn't seem to be a security issue however because the header
length is propery limited to TPM_BUFSIZE and the data buffer is
allocated specifically for that process using kzalloc.

Jason

\
 
 \ /
  Last update: 2016-09-17 09:59    [W:0.228 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site