From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: [PATCH] tpm: fix buffer overflow in /dev/tpm0 Date: Sun, 11 Sep 2016 21:57:37 +0300 Message-ID: <20160911185737.GA13353@intel.com> References: <1473596340-11376-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160911125142.GA20191@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20160911125142.GA20191-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Peter Huewe Cc: "moderated list:TPM DEVICE DRIVER" , open list List-Id: tpmdd-devel@lists.sourceforge.net On Sun, Sep 11, 2016 at 03:51:42PM +0300, Jarkko Sakkinen wrote: > 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. > > > > Signed-off-by: Jarkko Sakkinen > > This is usable neither as read nor write primitive for an exploit. Still > it makes sense to validate the input here. Cannot add fixes line for this one as it's from pre-GIT times... /Jarkko ------------------------------------------------------------------------------ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932311AbcIKS5p (ORCPT ); Sun, 11 Sep 2016 14:57:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:15730 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756426AbcIKS5o (ORCPT ); Sun, 11 Sep 2016 14:57:44 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,318,1470726000"; d="scan'208";a="7595459" Date: Sun, 11 Sep 2016 21:57:37 +0300 From: Jarkko Sakkinen To: Peter Huewe Cc: Marcel Selhorst , Jason Gunthorpe , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH] tpm: fix buffer overflow in /dev/tpm0 Message-ID: <20160911185737.GA13353@intel.com> References: <1473596340-11376-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160911125142.GA20191@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160911125142.GA20191@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 11, 2016 at 03:51:42PM +0300, Jarkko Sakkinen wrote: > 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. > > > > Signed-off-by: Jarkko Sakkinen > > This is usable neither as read nor write primitive for an exploit. Still > it makes sense to validate the input here. Cannot add fixes line for this one as it's from pre-GIT times... /Jarkko