Return-Path: Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56939 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758700AbdLRMHD (ORCPT ); Mon, 18 Dec 2017 07:07:03 -0500 Date: Mon, 18 Dec 2017 13:07:07 +0100 From: Greg KH To: Eric Biggers Cc: stable@vger.kernel.org, David Howells , Eric Biggers Subject: Re: [PATCH 1/2 for 3.18/4.1] KEYS: Don't permit request_key() to construct a new keyring Message-ID: <20171218120707.GD31295@kroah.com> References: <20171215204418.130486-1-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171215204418.130486-1-ebiggers3@gmail.com> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Dec 15, 2017 at 12:44:17PM -0800, Eric Biggers wrote: > From: David Howells > > commit 911b79cde95c7da0ec02f48105358a36636b7a71 upstream. > [Please apply to 3.18-stable and 4.1-stable.] > > If request_key() is used to find a keyring, only do the search part - don't > do the construction part if the keyring was not found by the search. We > don't really want keyrings in the negative instantiated state since the > rejected/negative instantiation error value in the payload is unioned with > keyring metadata. > > Now the kernel gives an error: > > request_key("keyring", "#selinux,bdekeyring", "keyring", KEY_SPEC_USER_SESSION_KEYRING) = -1 EPERM (Operation not permitted) > > Signed-off-by: David Howells > Signed-off-by: Eric Biggers > --- > security/keys/request_key.c | 3 +++ > 1 file changed, 3 insertions(+) Now applied to 3.18, thanks. greg k-h