From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756230AbcILRcf (ORCPT ); Mon, 12 Sep 2016 13:32:35 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:34957 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753014AbcILRcb (ORCPT ); Mon, 12 Sep 2016 13:32:31 -0400 Date: Mon, 12 Sep 2016 11:32:19 -0600 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: Peter Huewe , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH v2] tpm: tpm_transmit() does not check for minimum buffer size. Message-ID: <20160912173219.GA5843@obsidianresearch.com> References: <1473677010-13737-1-git-send-email-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473677010-13737-1-git-send-email-jarkko.sakkinen@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.151 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 12, 2016 at 01:43:30PM +0300, Jarkko Sakkinen wrote: > tpm_transmit() does not check that bufsiz is at least TPM_HEADER_SIZE > before accessing data. This commit adds the check and returns -ENOMEM. -EINVAL > v2: Updated commit msg After the diffstat, do not commit that to the tree Jason