From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbdKJTun (ORCPT ); Fri, 10 Nov 2017 14:50:43 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58830 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753647AbdKJTum (ORCPT ); Fri, 10 Nov 2017 14:50:42 -0500 Subject: Re: [RFC PATCH] fw_lockdown: new micro LSM module to prevent loading unsigned firmware From: Mimi Zohar To: "Luis R. Rodriguez" , "AKASHI, Takahiro" Cc: David Howells , linux-security-module , linux-fsdevel , linux-kernel , James Bottomley , David Woodhouse , Johannes Berg , Andy Lutomirski , Linus Torvalds , Kees Cook Date: Fri, 10 Nov 2017 14:50:30 -0500 In-Reply-To: <20171110193507.GP22894@wotan.suse.de> References: <1510336703.3404.17.camel@linux.vnet.ibm.com> <20171110193507.GP22894@wotan.suse.de> 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 X-TM-AS-GCONF: 00 x-cbid: 17111019-0020-0000-0000-000003CAF2BA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111019-0021-0000-0000-000042601648 Message-Id: <1510343430.3404.25.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-10_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711100272 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-11-10 at 20:35 +0100, Luis R. Rodriguez wrote: > On Fri, Nov 10, 2017 at 12:58:23PM -0500, Mimi Zohar wrote: > > Hi David, > > > > If you are interested in preventing the loading of unsigned firmware, > > the patch below is straight forward.  The patch has ONLY been tested > > with IMA-appraisal enabled, and works as intended - allowing only > > signed firmware to be loaded. > > Very nice! This is the sort of thing that I mean by LSM'ifying fw access > through a system policy. > > We currently handle the LSM aspect for firmware through > kernel_read_file_from_path() and so the kernel_read_file LSM hook, so why a new > hook here? kernel_read_file(), itself, is not an LSM hook, but calls two LSM hooks named security_kernel_read_file(), prior to reading a file, and security_kernel_post_read_file(), post reading a file. In this case, we want to reject even reading the file if it isn't signed, so we're using the security_kernel_read_file() LSM hook. > > Where does this plug in? This is a standalone, micro LSM that can be configured at build.  For now I left it is an optional Kconfig parameter, but at some point, you might want to consider making it required. Mimi