Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp417589pxb; Wed, 3 Mar 2021 06:36:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2JZYx/hZSZkWxEGnfk98lhwjUqrARtHklM27/ycAxdFq0JDP2oeNEcyPx3wy94+lwrTv4 X-Received: by 2002:a17:906:abcd:: with SMTP id kq13mr4674026ejb.477.1614782206761; Wed, 03 Mar 2021 06:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614782206; cv=none; d=google.com; s=arc-20160816; b=oNBK7qPp8pewT5m/0+DPoh2wGDofOtTfY/+MzyTdbpKFLHhygQEtwdZ1CjRfVBZ9VD KKNXO4zVqfZxg3Wi17vW+AKmdga5chqZ7flKgrZmdAQK+XCPXJA1wwA70j3EsYcE1yys qQu9nmESNW/OTeRqqEf4ftTTPtUqeGxr0OASwUW85+GOc74z4avj/+TRC9YuDo4MexE5 ylLsUXabFIXx1InqXqLiQqfGYze8/qxZkzsW/IvQZITzKoZ0Syq8K/j8o4T08KhUMEKy I8ysq7xT8Q+OkF/aO9Aw3idXCaB7BhV5l9EwJgan2PGImHO0yO2Wf14Vc1f34Z34nLzQ fcUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/4iycJAP7BB7PFu0XyYR9Wfx2YkIdp1plqjlhCI+BW4=; b=YoyGb6A6RSXmz9ATmpGdGZ8mj96E8LJ7aObO6c6nXn8bTL9hnV13cjCewRB84EF9yb +wKxBgdHwzZZ6Ih+baC8ee+CvwGwoqJqMhcCvrI23Xe+OhbzHSAaGPaclXPu8qGxXGxd 97maVMVSRTurIJHwL39sEXoe5SIrs7xgjQVt12ExM3LYEB70dk824Gb342jjg+zdMxzN GqMZ0D/lgPH2taz17Kn5kU31ojJ9TJDMbagFnDwIFjo5rUFYbWzGhc7eduQHTJNFZM2O 0NU/n9d0IT+v0KegexPXVboxr3QxTUROprvvBIG1mzU1P6bS8eEilNjoV1inCealEQC3 f7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JO91QCC0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du8si15593959ejc.659.2021.03.03.06.35.46; Wed, 03 Mar 2021 06:36:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JO91QCC0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244611AbhCAVYf (ORCPT + 99 others); Mon, 1 Mar 2021 16:24:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:52684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237656AbhCARQD (ORCPT ); Mon, 1 Mar 2021 12:16:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D1BB65048; Mon, 1 Mar 2021 16:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617168; bh=jNF7Ts/QUWA9NvetN84T45Bhs0xnDxiOkeZaWPSyUYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JO91QCC0ZN65mGKIAJunn2h3V4srFLxhO6XuXHySNbaIYmv4EOrI8zDZ0T2b8RWwY WNUoTbSmUlc6iNX4KyGx3k+E/hubY1KKQj+0lGJ6nVn4AwNy4XCWTkpmdT5z3Ehm5G 9Uw6LrNLJ2dNRuTK5dfJ+DKf/CmnO+ssI0cFJtVM= 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.19 196/247] KEYS: trusted: Fix migratable=1 failing Date: Mon, 1 Mar 2021 17:13:36 +0100 Message-Id: <20210301161041.244925533@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -796,7 +796,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: