Commit 01476001 authored by Michael Halcrow's avatar Michael Halcrow Committed by Linus Torvalds
Browse files

tpm: Use correct data types for sizes in tpm_write() and tpm_read()

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: default avatarMichael Halcrow <>
Cc: Marcel Selhorst <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent ec288bd3
......@@ -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 */
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment