OSDN Git Service

tpm: fix a kernel memory leak in tpm-sysfs.c
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 20 Jun 2017 09:38:02 +0000 (11:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Aug 2017 02:19:43 +0000 (19:19 -0700)
commit7e789223932762e1e7ffdb63f3fd1b42dbeeb789
tree56e3751e36218f0b3533ed613116c8050c2553db
parent366f50133bb66bb368fb933c90f2dd2b07d35162
tpm: fix a kernel memory leak in tpm-sysfs.c

commit 13b47cfcfc60495cde216eef4c01040d76174cbe upstream.

While cleaning up sysfs callback that prints EK we discovered a kernel
memory leak. This commit fixes the issue by zeroing the buffer used for
TPM command/response.

The leak happen when we use either tpm_vtpm_proxy, tpm_ibmvtpm or
xen-tpmfront.

Fixes: 0883743825e3 ("TPM: sysfs functions consolidation")
Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/tpm/tpm-sysfs.c