From patchwork Mon Mar 1 16:13:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 390263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4DC1C433DB for ; Mon, 1 Mar 2021 16:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79A5064F6B for ; Mon, 1 Mar 2021 16:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234172AbhCAQ0I (ORCPT ); Mon, 1 Mar 2021 11:26:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:56680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237570AbhCAQWX (ORCPT ); Mon, 1 Mar 2021 11:22:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E89464E6F; Mon, 1 Mar 2021 16:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614615554; bh=oDMH6g+fID6mVs25Fr2EpRDARpCmuuFnOlvsp/38mjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Sf7jKcA1yORPJjBvJX6u9pEbztI+7WCsxbLLzYolFKmkBz8eX2GvBdO/j2VxCGX3 w9biHenp05vfk8uq0QfzlcTjgz7/mOv6rfXKrPVWm/mdWJ5xmHyUNQm3VEIvWQg2Rb oJHUDO+3V2vLZ+oF5EjjRmW2eBuvJ/XmsYJAYff4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "James E.J. Bottomley" , Mimi Zohar , David Howells , Jarkko Sakkinen Subject: [PATCH 4.4 72/93] KEYS: trusted: Fix migratable=1 failing Date: Mon, 1 Mar 2021 17:13:24 +0100 Message-Id: <20210301161010.426797319@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161006.881950696@linuxfoundation.org> References: <20210301161006.881950696@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jarkko Sakkinen commit 8da7520c80468c48f981f0b81fc1be6599e3b0ad upstream. Consider the following transcript: $ keyctl add trusted kmk "new 32 blobauth=helloworld keyhandle=80000000 migratable=1" @u add_key: Invalid argument The documentation has the following description: migratable= 0|1 indicating permission to reseal to new PCR values, default 1 (resealing allowed) The consequence is that "migratable=1" should succeed. Fix this by allowing this condition to pass instead of return -EINVAL. [*] Documentation/security/keys/trusted-encrypted.rst Cc: stable@vger.kernel.org Cc: "James E.J. Bottomley" Cc: Mimi Zohar Cc: David Howells Fixes: d00a1c72f7f4 ("keys: add new trusted key-type") Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- security/keys/trusted.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/security/keys/trusted.c +++ b/security/keys/trusted.c @@ -778,7 +778,7 @@ static int getoptions(char *c, struct tr case Opt_migratable: if (*args[0].from == '0') pay->migratable = 0; - else + else if (*args[0].from != '1') return -EINVAL; break; case Opt_pcrlock: