From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753800AbbJBRkg (ORCPT ); Fri, 2 Oct 2015 13:40:36 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:52802 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753402AbbJBRkc (ORCPT ); Fri, 2 Oct 2015 13:40:32 -0400 X-Helo: d23dlp01.au.ibm.com X-MailFrom: zohar@linux.vnet.ibm.com X-RcptTo: stable@vger.kernel.org Message-ID: <1443807565.2503.68.camel@linux.vnet.ibm.com> Subject: Re: [PATCH 1/1] integrity: prevent loading untrusted certificates to IMA trusted keyring From: Mimi Zohar To: Dmitry Kasatkin Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Kasatkin , stable@vger.kernel.org Date: Fri, 02 Oct 2015 13:39:25 -0400 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 (3.12.11-1.fc21) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15100217-0013-0000-0000-000001FA859C Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-09-10 at 22:06 +0300, Dmitry Kasatkin wrote: > If IMA_LOAD_X509 is enabled either directly or indirectly via > IMA_APPRAISE_SIGNED_INIT, it enables certificate loading to the IMA trusted > keyring from the kernel. Due to the overlook, KEY_ALLOC_TRUSTED was used in the > key_create_or_update() to create keys within the kernel, which caused > overriding certificate verification result and allowed to load self-signed or > wrongly signed certificates. > > This patch just removes this option. Thanks! Mimi > > Signed-off-by: Dmitry Kasatkin > Cc: # 3.19+ > --- > security/integrity/digsig.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c > index 36fb6b5..5be9ffb 100644 > --- a/security/integrity/digsig.c > +++ b/security/integrity/digsig.c > @@ -105,7 +105,7 @@ int __init integrity_load_x509(const unsigned int id, const char *path) > rc, > ((KEY_POS_ALL & ~KEY_POS_SETATTR) | > KEY_USR_VIEW | KEY_USR_READ), > - KEY_ALLOC_NOT_IN_QUOTA | KEY_ALLOC_TRUSTED); > + KEY_ALLOC_NOT_IN_QUOTA); > if (IS_ERR(key)) { > rc = PTR_ERR(key); > pr_err("Problem loading X.509 certificate (%d): %s\n",