Skip to content

Commit 29021bc

Browse files
J Freyenseegregkh
authored andcommitted
pti: double-free security PTI fix
This patch fixes a double-free error that will not always be seen unless /dev/pti char interface is stressed. Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 9d031d9 commit 29021bc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/misc/pti.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ EXPORT_SYMBOL_GPL(pti_request_masterchannel);
317317
* a master, channel ID address
318318
* used to write to PTI HW.
319319
*
320-
* @mc: master, channel apeture ID address to be released.
320+
* @mc: master, channel apeture ID address to be released. This
321+
* will de-allocate the structure via kfree().
321322
*/
322323
void pti_release_masterchannel(struct pti_masterchannel *mc)
323324
{
@@ -581,7 +582,7 @@ static int pti_char_open(struct inode *inode, struct file *filp)
581582
static int pti_char_release(struct inode *inode, struct file *filp)
582583
{
583584
pti_release_masterchannel(filp->private_data);
584-
kfree(filp->private_data);
585+
filp->private_data = NULL;
585586
return 0;
586587
}
587588

0 commit comments

Comments
 (0)