Skip to content

Commit

Permalink
tpm: Use correct data types for sizes in tpm_write() and tpm_read()
Browse files Browse the repository at this point in the history
Use the correct data types for the size parameters in tpm_write() and
tpm_read(). Note that rw_verify_area() makes sure that this bug cannot
be exploited to produce a buffer overrun.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Marcel Selhorst <tpm@selhorst.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Michael Halcrow authored and Linus Torvalds committed Jul 26, 2008
1 parent ec288bd commit 0147600
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ ssize_t tpm_write(struct file *file, const char __user *buf,
size_t size, loff_t *off)
{
struct tpm_chip *chip = file->private_data;
int in_size = size, out_size;
size_t in_size = size, out_size;

/* cannot perform a write until the read has cleared
either via tpm_read or a user_read_timer timeout */
Expand Down Expand Up @@ -1063,7 +1063,7 @@ ssize_t tpm_read(struct file *file, char __user *buf,
size_t size, loff_t *off)
{
struct tpm_chip *chip = file->private_data;
int ret_size;
ssize_t ret_size;

del_singleshot_timer_sync(&chip->user_read_timer);
flush_scheduled_work();
Expand Down

0 comments on commit 0147600

Please sign in to comment.