Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp943305ybl; Wed, 8 Jan 2020 08:23:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw0gcfySsCuBjOqDR5S0tNrZOjGnW/WT88oJj+FQFJJT7GP0W6ljN3U0QX9W2I8cJvkN2kM X-Received: by 2002:a05:6808:3c2:: with SMTP id o2mr3760032oie.45.1578500604563; Wed, 08 Jan 2020 08:23:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578500604; cv=none; d=google.com; s=arc-20160816; b=j3woLCXXesAYjktbnwCFavPaTI74Sw5gSFkBRMx4siJ8V4wEhPLYAqZLef5zDICHbp t6uLVhR9juuGvBASnnhsmkT3j7OwNgNrdx+9gkJ4BLJHdA2PaAjj1JfdDOwASjTsCFsR BsBCC9y6W9CmTz8fc7WiRAiFmZE+utd5iwb72GPFmi7R4lzs30TyURQCPB6qyoh9lIbw /iJwHA+z4rlIYex+thV2ftdlvstkB61Us5PrUpcvoeL7jG4EypwntvVIBnn9NFoT3iIY jwXUuF39R8vAU6MrSLjME+dyqkAZEtRVbL4uOkbBjmhQtijEq6FbnfS4ukqzvhVtwZg/ bVwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent:date :mime-version:organization:references:in-reply-to:cc:to:from:subject :message-id; bh=kabJ7HHgTWx74p9XpjfGfc6dRUz50hBx8tRqq9beeRA=; b=B1Ve5axl3py/faCOE9HnzEMEwqozsMPSuyxDAzkKqAS+HWIp6LO+6USvcJi4PiF8H6 8ppLEt4bzICuepF0BtFbz72g22dDQML9jwy+tAd+4+ES/KNU+/byLnfcsy49ZRLVvs2Q 4ekPdYdXWx8wnpoW8HuYhjPGxJZWeEb4RzOGHekzUefABKcLk59icjcjNC5gznyksyNC G3MZd9FQrR/YI+ZcOC6/tEyoC7roZMMS7qFkYD1lg72Gk3+lnnAlaYTYAHFSP26HVymn ZPkjOpuj4Ran7cPADjrZnhzGNloiqodVkslT7bWb9KRtGFejceNGih0fYclSJ/lPVWjl uGxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s68si2144065oih.275.2020.01.08.08.23.10; Wed, 08 Jan 2020 08:23:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728827AbgAHQFA (ORCPT + 99 others); Wed, 8 Jan 2020 11:05:00 -0500 Received: from mga07.intel.com ([134.134.136.100]:7093 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726922AbgAHQE7 (ORCPT ); Wed, 8 Jan 2020 11:04:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2020 08:04:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,410,1571727600"; d="scan'208";a="211580709" Received: from dkurtaev-mobl.ccr.corp.intel.com ([10.252.22.167]) by orsmga007.jf.intel.com with ESMTP; 08 Jan 2020 08:04:55 -0800 Message-ID: <80272f0259d967fe61dacd1036cbbd9f555b8402.camel@linux.intel.com> Subject: Re: [PATCH] tpm: handle negative priv->response_len in tpm_common_read From: Jarkko Sakkinen To: Tadeusz Struk Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-integrity@vger.kernel.org, labbott@redhat.com In-Reply-To: References: <157843468820.24718.10808226634364669421.stgit@tstruk-mobl1> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 08 Jan 2020 18:04:49 +0200 User-Agent: Evolution 3.34.1-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-01-08 at 17:58 +0200, Jarkko Sakkinen wrote: > On Tue, 2020-01-07 at 14:04 -0800, Tadeusz Struk wrote: > > The priv->responce_length can hold the size of an response or > > an negative error code, and the tpm_common_read() needs to handle > > both cases correctly. Changed the type of responce_length to > > signed and accounted for negative value in tpm_common_read() > > > > Cc: stable@vger.kernel.org > > Fixes: d23d12484307 ("tpm: fix invalid locking in NONBLOCKING mode") > > Reported-by: Laura Abbott > > Signed-off-by: Tadeusz Struk > > Reviewed-by: Jarkko Sakkinen > > Adding to the next PR. Applied but had to fix bunch of typos, missing punctaction and missing parentheses in the commit message. Even checkpatch.pl was complaining :-/ Thanks. /Jarkko