Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3218164ybg; Sun, 20 Oct 2019 09:09:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6Jrkzk7p4lFGlyQNlWup/7yq5+60sgEDD5BDuDuFeZKvWfpTwyq7JJ5doC3bIaYOD7u+7 X-Received: by 2002:a50:fa42:: with SMTP id c2mr6967528edq.112.1571587780040; Sun, 20 Oct 2019 09:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571587780; cv=none; d=google.com; s=arc-20160816; b=F8X22LJaI6Pa0hMVssXgRWkZ+NJ53daVOpP/1+1HA8DhUNzbIYE2xPnA8YuPNWWv7Q oR9WrVq6/wL2ZH+kWElwSr67HJnnlKKXTm6aofssuZH8mdpXNVX4PRxz+N4tATB1oWx2 SfvwBiqO3CD05F9zQB0oOxRKfkM1Qf/4JNZH95lY3e53boAfA6oDOI+fpX4voT5St63x 4HzPb5md5j0DXqFGGTcxsYzfOGNrW7KcST6PjKLB6bT7UvnlxM8kmicDKwQc2NH0ml7Y 3QKrLqN421J9o1P7fyWlxqoIfEi8ZFNqNlIRJhBpoBbu9P7YXwO1ylQm/q85M40LXts9 pfQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=0fCHTImDR8Q+GYJOYRRhA5+9eI43pYwlsXzcRKLAfZw=; b=YuKGjfdQMevyEC/SZTcZWOC8lhwRnqVt30atszMVX2KNwaKMIxkZ2+BkT974jN5FxO VuDOaGL8gkHcjmmtHw8sqCQNEfuqs1y4+YTNejVNimieL6raMd26Fl1pL+LxsulvluYH xVfBEBTglOiTcn56XC8bJwRhLrIDOfYkYg9f/CcH167sSrE3O/q5280l1PBKyyLDEp2q N/nOlVK3bQZ8KwTwikZQaQcUcTGoud5eh5jxUWrc/xbiitP5VNK2XZKHq7UOF9zY9u87 XI3c6Hw6MGQFFI2mDYLmu2LmUxEkhU12209saJa/+BfX4YeKJkvzWqOgTNmRZHgCcuIS YiVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HZkr9mE9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si7654259edx.223.2019.10.20.09.09.15; Sun, 20 Oct 2019 09:09:40 -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=@kernel.org header.s=default header.b=HZkr9mE9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfJTQJG (ORCPT + 99 others); Sun, 20 Oct 2019 12:09:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:45756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbfJTQJF (ORCPT ); Sun, 20 Oct 2019 12:09:05 -0400 Received: from localhost.localdomain (ool-18bba523.dyn.optonline.net [24.187.165.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AAB83218BA; Sun, 20 Oct 2019 16:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571587744; bh=2rqZqTghk0jq/6poDX1vz2pfYzf7Qp8iUns4NuEy5NQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HZkr9mE9kNuZvNX5TVBK80qFqOhhKOI6Vd4XPcDsexisoiZQIUZLZ/LAj/FksDrGR bgMOem4aYqutYg8IUTz77yWm6QiAJnF4ImF78HC7TIBhqG66WXDFG2MSG0pQ0AA/ea uVPisOxbE+dqQv9ilAzF5wVw96sXtT4B8LpkVHCY= Message-ID: <1571587740.5104.10.camel@kernel.org> Subject: Re: [PATCH v8 7/8] ima: check against blacklisted hashes for files with modsig From: Mimi Zohar To: Nayna Jain , linuxppc-dev@ozlabs.org, linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Ard Biesheuvel , Jeremy Kerr , Matthew Garret , Greg Kroah-Hartman , Claudio Carvalho , George Wilson , Elaine Palmer , Eric Ricther , Oliver O'Halloran , Prakhar Srivastava , Lakshmi Ramasubramanian Date: Sun, 20 Oct 2019 12:09:00 -0400 In-Reply-To: <1571587602.5104.8.camel@linux.ibm.com> References: <1571508377-23603-1-git-send-email-nayna@linux.ibm.com> <1571508377-23603-8-git-send-email-nayna@linux.ibm.com> <1571587602.5104.8.camel@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2019-10-20 at 12:06 -0400, Mimi Zohar wrote: > On Sat, 2019-10-19 at 14:06 -0400, Nayna Jain wrote: > > Asymmetric private keys are used to sign multiple files. The kernel > > currently support checking against blacklisted keys. However, if the > > public key is blacklisted, any file signed by the blacklisted key will > > automatically fail signature verification. We might not want to blacklist > > all the files signed by a particular key, but just a single file. > > Blacklisting the public key is not fine enough granularity. > > > > This patch adds support for checking against the blacklisted hash of the > > file based on the IMA policy. The blacklisted hash is the file hash > > without the appended signature. Defined is a new policy option > > "appraise_flag=check_blacklist". > > Please add an example of how to blacklist a file with an appended > signature.  The simplest example that works on x86 as well as Power > would be blacklisting a kernel module.  The example should include > calculating the kernel module hash without the appended signature, > enabling the Kconfig option (CONFIG_SYSTEM_BLACKLIST_HASH_LIST), and > the blacklist hash format (eg. "bin:"). And of course, the IMA appraise kernel module policy rule containing "appraise_flag=check_blacklist". thanks, Mimi