Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1066715ybl; Wed, 8 Jan 2020 10:24:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzwLC/JQlCGpikeyeImr23sgzYE/DtsR/arhlRJGK9XyxE8ny69AN//ihj3svfnn7pzipSg X-Received: by 2002:aca:c38c:: with SMTP id t134mr3940828oif.175.1578507888183; Wed, 08 Jan 2020 10:24:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578507888; cv=none; d=google.com; s=arc-20160816; b=yj+Hs84u3rfUqo5s7aVnvYYlQagNY69WToALws3aNiDQ3zmeZtXdbaXJ3wOfLSzKJB RD79JZMkKjU5L7kRwaMbyFT6oz/bjWWf6hVcRLPNzKvNwfFnVcUfCZKo5owpUGQ7gwBz somVYpGVDVcRsBVknc4qshTwQDg3N0kiOReERtAfX0EuP+Staa06ZyK0o6IOLa/3utfa uJGUuLTOTZax0BWE7nHfbOWQPhxN6y5n5u39WwF8Tz3YHD7kuMC6x5BcwFeZ32weJn1M 2b6zj/TfsIa4tT5a9sPdLUmaAZYOlHxs0o4srH3NALCOtvY1fWzubJay7a5gsfzxM74y ytmQ== 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:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=xlswHklTf3e255cM4QBgoqAu42jAc8Rc0VBO7SWQBVw=; b=0gt7NwzzjZRmCvVqnJo+XooZdWNofs4NJ47sbPt1na/TlUwXEDc45K/W5dBphDfb7f GzZVoEsZdokPLue80oTCPWpmZEkeZhBxARbsy95/Dzzn0vJ2VkZE4AZSMBmYJl5QSOq9 SPs3ObpkxMdriT1qArgio/EgiGeRY8LcdPW/c3q/QK5DUXIhiy1Yn2ku+r2/hCkKA5QT SrJ8rxYmD9AGkqS6htAu0pFl/ufrdt6Qb9RqiQhblKxvxpNqp5YLxW9K+40QnGcMWqx+ CNBEvQVJNUfYmJs0ab9MGYJ0n91VJb/MqEqF7DqYm5pRsfNNo7tJGUzPSW7oz9V11qCJ XpqQ== 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 u62si2197848oig.29.2020.01.08.10.24.34; Wed, 08 Jan 2020 10:24:48 -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 S1729158AbgAHP6q (ORCPT + 99 others); Wed, 8 Jan 2020 10:58:46 -0500 Received: from mga06.intel.com ([134.134.136.31]:24326 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729151AbgAHP6p (ORCPT ); Wed, 8 Jan 2020 10:58:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2020 07:58:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,410,1571727600"; d="scan'208";a="217546290" Received: from dkurtaev-mobl.ccr.corp.intel.com ([10.252.22.167]) by fmsmga007.fm.intel.com with ESMTP; 08 Jan 2020 07:58:42 -0800 Message-ID: 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 Date: Wed, 08 Jan 2020 17:58:41 +0200 In-Reply-To: <157843468820.24718.10808226634364669421.stgit@tstruk-mobl1> 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" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. /Jarkko