Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4763738imm; Mon, 15 Oct 2018 22:42:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV63JuK+mnuULvv6NCXqPqMP5rx7vKu/LO7RUf7Rb30hxwrOFMRpkf0lTZodJYOgY4VsXyol4 X-Received: by 2002:a63:ea07:: with SMTP id c7-v6mr17981909pgi.361.1539668557642; Mon, 15 Oct 2018 22:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539668557; cv=none; d=google.com; s=arc-20160816; b=gahBlEGJE66wnfVotY+9aWe7NY6liASX6jk069eg9Yn34CVJbRdZYz5NSOZvaC/am1 Q8OKM5FipANBBwncWjIEWh/EeU0dy7dAWa2OuMbkhG+CiiXiX5vQbIImjG+0Y3cRZNZE qXhEdoIqNMUxjj1yXEjIAThUGGrTktJu4Ghcey7UZMYBY8zYkF+IdoWigARnozIc1bRS NqpWdxvUWAGDXFuuh5QK50vvdjqkZ/rxMKHTdJyQn86ESQi+PVVkn7cvWh1iO3VdH4K+ M4ZQvpzOGtK3L412TC2Zck8vMQ0EONxlXR/sfKmczUXbskJq8vHfFc9tjgFwOB2OhKMc N1wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aN5T+E2mtLJusevk4aCR20XhJ6KSSmAGvn90Y5s64Ms=; b=E7Po/WdjPH29xbb7PqlPg3xseEYkWWlO3kiqarVJYpr68bt3sdxkA3Ql42PqSDNIUK wkjCu89pj8QK1O51AaCvY4146/rRp1+ZsDBUQg/MOiiXjZ/hLjehAgaIPkIFDBZjK6jz OgJA2AAukqPszwqQ6KCwqHBYDStd0qvF3JqWJB92QMGWpPFtP4Hg9HJ7pJt5+KhLdc2X a1Jg+lzz3wQB3tzQye39V3drohSW6WDhjVCVDSZ2BJovtrBrobs4XhdyZGIMPSm9TEUn iJf6J0KVk8L+4ftTKN2lPXMjP9t88ZxNKkfh4t5IT4j+il7Z2LLxfwv5EszmIy8AOo6P gs+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=H8Qkl3d9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6-v6si12791887pgf.303.2018.10.15.22.42.22; Mon, 15 Oct 2018 22:42:37 -0700 (PDT) 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; dkim=pass header.i=@ziepe.ca header.s=google header.b=H8Qkl3d9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728053AbeJPNan (ORCPT + 99 others); Tue, 16 Oct 2018 09:30:43 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34159 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727258AbeJPNan (ORCPT ); Tue, 16 Oct 2018 09:30:43 -0400 Received: by mail-wm1-f68.google.com with SMTP id z25-v6so24472874wmf.1 for ; Mon, 15 Oct 2018 22:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aN5T+E2mtLJusevk4aCR20XhJ6KSSmAGvn90Y5s64Ms=; b=H8Qkl3d9QpjfH9y28wqeuXccK27jDAmBDtasEQlIpgAR+8/EmAj+6drKUyn22kIDVY at4vD+4w+7yHtRtu3Q6Nrd7GoYIz1CEZH8g5v8JF5+Wz9oKld4VJpOjOk8WrIzBeRP1F GakNz7hFN5K8ToKaTJMZ7P6C1zN6dqSHVX1t3wWjoMG+nypJM+ftOF7zea2tcF/Pfb4N jxvpwqsMJJJpqGpt43cMgf3x6eiVyX10HpwvnnZmtaLE9RNM5u8PRG22dAALDC6zcpi7 aEHydPhX/uch7JYaENMrN5icP4r6jFJoDQiWApAdzJnknE5kaPZ3ZL7ry1AfayPh2Hfc hDBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aN5T+E2mtLJusevk4aCR20XhJ6KSSmAGvn90Y5s64Ms=; b=C2YYqZaIsXuE1G/Wa5b5MorvHNOSHechsCp8mwIJQcnSr99GwOIQ7bhZcp0w7Rk/LM d7W6Drdg/8j/oPsJN+1a3FgB+dDvD46vX/R3Sf6le2YNlJYFmTop4bvY03l7CTKsaoFk q1iij9rrU2grEbtD3I4w0L4e0cInEW2GS2UgrJD/WEfGY4Gk2Xbo15R6+aiy5FKbFFTG U6qvXnfS+aB9rl8fZLnUDuZoEEkqY/TDuZrjQnffGQmsA7HPrF4eGeXlameKWyMnrkSl LA+ybtHVHeWeoAzdquJ/TN8LNQMzxaUPBBPXaJ7tQ5y9z0/AGgfBtsV9hx/1tbzpPW/K 9MnQ== X-Gm-Message-State: ABuFfog46tm3DKAkp0kl/MYG3qnj7JrX5tzlCPFQhIrX8kVJ6K35w1PC Ivl6F8yY3mv3zQu3lSGMABlH6w== X-Received: by 2002:a1c:9a4a:: with SMTP id c71-v6mr15135854wme.71.1539668518077; Mon, 15 Oct 2018 22:41:58 -0700 (PDT) Received: from ziepe.ca ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id e133-v6sm13061953wma.42.2018.10.15.22.41.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 22:41:56 -0700 (PDT) Received: from jgg by jggl.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gCI79-0004rz-KA; Mon, 15 Oct 2018 23:41:55 -0600 Date: Mon, 15 Oct 2018 23:41:55 -0600 From: Jason Gunthorpe To: Tomas Winkler Cc: Jarkko Sakkinen , Nayna Jain , Alexander Usyskin , Tadeusz Struk , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Message-ID: <20181016054155.GA18664@ziepe.ca> References: <20181015111434.7777-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181015111434.7777-1-tomas.winkler@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 15, 2018 at 02:14:34PM +0300, Tomas Winkler wrote: > Ignore the return value of go_to_idle() in tpm_try_transmit(). > Once it may shadow the return value of actual tpm operation, > second the consequent command will fail as well and the error > will be caought anyway. > Last fix wrong goto, that jumped back instead of forward. > > Fixes: 627448e85c76 ("tpm: separate cmd_ready/go_idle from runtime_pm") > Signed-off-by: Tomas Winkler > drivers/char/tpm/tpm-interface.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > index 129f640424b7..f69c711bf74a 100644 > +++ b/drivers/char/tpm/tpm-interface.c > @@ -547,9 +547,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip, > dev_err(&chip->dev, "tpm2_commit_space: error %d\n", rc); > > out: > - rc = tpm_go_idle(chip, flags); > - if (rc) > - goto out; > + (void)tpm_go_idle(chip, flags); We don't really use this style in the kernel, AFAIK. Jason