From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752485AbdKHTqc (ORCPT ); Wed, 8 Nov 2017 14:46:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:43316 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbdKHTqa (ORCPT ); Wed, 8 Nov 2017 14:46:30 -0500 Date: Wed, 8 Nov 2017 20:46:26 +0100 From: "Luis R. Rodriguez" To: "AKASHI, Takahiro" Cc: Greg Kroah-Hartman , Linus Torvalds , "Luis R. Rodriguez" , Mimi Zohar , Jan Blunck , Julia Lawall , David Howells , Marcus Meissner , Gary Lin , linux-security-module@vger.kernel.org, gnomes@lxorguk.ukuu.org.uk, linux-efi , linux-kernel@vger.kernel.org, Matthew Garrett Subject: Re: Firmware signing -- Re: [PATCH 00/27] security, efi: Add kernel lockdown Message-ID: <20171108194626.GQ22894@wotan.suse.de> References: <1509660086.3416.15.camel@linux.vnet.ibm.com> <150842463163.7923.11081723749106843698.stgit@warthog.procyon.org.uk> <14219.1509660259@warthog.procyon.org.uk> <1509660641.3416.24.camel@linux.vnet.ibm.com> <20171107230700.GJ22894@wotan.suse.de> <20171108061551.GD7859@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171108061551.GD7859@linaro.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 08, 2017 at 03:15:54PM +0900, AKASHI, Takahiro wrote: > Luis, > > Thank you for this heads-up. > > On Wed, Nov 08, 2017 at 12:07:00AM +0100, Luis R. Rodriguez wrote: > > On Thu, Nov 02, 2017 at 06:10:41PM -0400, Mimi Zohar wrote: > > > On Thu, 2017-11-02 at 22:04 +0000, David Howells wrote: > > > > Mimi Zohar wrote: > > > > > > > > > > Only validly signed device firmware may be loaded. > > > > > > > > > > fw_get_filesystem_firmware() calls kernel_read_file_from_path() to > > > > > read the firmware, which calls into the security hooks. Is there > > > > > another place that validates the firmware signatures.  I'm not seeing > > > > > which patch requires firmware to be signed? > > > > > > > > Luis has a set of patches for this. However, I'm not sure if that's going > > > > anywhere at the moment. Possibly I should remove this from the manpage for > > > > the moment. > > > > Remove it for now. The state of of affairs for firmware signing is complex given > > that we first wanted to address how to properly grow the API without making > > the API worse. This in and of itself was an effort, and that effort also > > evaluated two different development paradigms: > > > > o functional API > > o data driven API > > > > I only recently was convinced that functional API should be used, even for > > commonly used exported symbols, > > Are you? Yes, this stemmed from the fact that even system calls can be abused through data driven APIs, and that long term a functional API at least can make evolutions much easier to review and bisect. That said this is all based on *empirical hearsay*, and no formal observations. But the ease to more easily bisect long term is enough for me to consider this for the firmware API given subtle regressions have been a long standing pain on the firmware API and I would not want to make the process of bisecting any harder. If anyone *does* have actual efforts which compares and contrasts both, I'd love to get them, to further back my current position, but as-is I'm already sold on functional API driven interface. > I haven't answered Linus' question, but my concern about functional APIs, > as far as firmware signing goes, is that we have no way to _enforce_ > firmware signing to existing (i.e. verification-unaware) drivers if we need > an explicit call of a function, say, verify_firmware(). Your concern seems to be that a functional driven API for firmware signing would implicate having to support verify_firmware() for drivers which *cannot* get signed firmware verified, is that correct? IMHO that should just fail then, ie, a "locked down" kernel should not want to *pass* a firmware signature if such thing could not be done. Its no different than trying to verify a signed module on a "locked down" for which it has no signature. But perhaps I'm not understanding the issue well, let me know. > > and as such I've been going back and slowly > > grooming the firmware API with small atomic changes to first clean up the > > complex flag mess we have. > > > > Since I'm busy with that Takahiro AKASHI has taken up firmware singing effort > > but this will depend on the above small cleanup to be done first. I was busy > > with addressing existing bugs on the firmware API for a while, then company > > travel / conferences so was not able to address this, but I'm back now and > > I believe I should be able to tackle the cleanup now. > > Good to hear. > > > Only after this is merged can we expect a final respin of the firmware signing > > effort. > > > > > Or reflect that IMA-appraisal, if enabled, will enforce firmware being > > > validly signed. > > > > But FWICT lockdown is a built-in kernel thingy, unless lockdown implies IMA > > it would not be the place to refer to it. > > I think that the situation is the same as in module signing. But by definition a "locked down" kernel will enforce module signing, and it would seem logical that if modules signing is enforced, eventually a statement about firmware signing can be added, as it relates to a kernel enforcement effort, not a kernel-userpace framework such as IMA. Luis > -Takahiro AKASHI > > > It seems the documentation was proposed to help users if an error was caught. > > That error should cover only what is being addressed in code on the kernel. > > > > Luis > -- Luis Rodriguez, SUSE LINUX GmbH Maxfeldstrasse 5; D-90409 Nuernberg From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Luis R. Rodriguez" Subject: Re: Firmware signing -- Re: [PATCH 00/27] security, efi: Add kernel lockdown Date: Wed, 8 Nov 2017 20:46:26 +0100 Message-ID: <20171108194626.GQ22894@wotan.suse.de> References: <1509660086.3416.15.camel@linux.vnet.ibm.com> <150842463163.7923.11081723749106843698.stgit@warthog.procyon.org.uk> <14219.1509660259@warthog.procyon.org.uk> <1509660641.3416.24.camel@linux.vnet.ibm.com> <20171107230700.GJ22894@wotan.suse.de> <20171108061551.GD7859@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20171108061551.GD7859-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "AKASHI, Takahiro" Cc: Greg Kroah-Hartman , Linus Torvalds , "Luis R. Rodriguez" , Mimi Zohar , Jan Blunck , Julia Lawall , David Howells , Marcus Meissner , Gary Lin , linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org, linux-efi , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Matthew Garrett List-Id: linux-efi@vger.kernel.org On Wed, Nov 08, 2017 at 03:15:54PM +0900, AKASHI, Takahiro wrote: > Luis, > > Thank you for this heads-up. > > On Wed, Nov 08, 2017 at 12:07:00AM +0100, Luis R. Rodriguez wrote: > > On Thu, Nov 02, 2017 at 06:10:41PM -0400, Mimi Zohar wrote: > > > On Thu, 2017-11-02 at 22:04 +0000, David Howells wrote: > > > > Mimi Zohar wrote: > > > > > > > > > > Only validly signed device firmware may be loaded. > > > > > > > > > > fw_get_filesystem_firmware() calls kernel_read_file_from_path() to > > > > > read the firmware, which calls into the security hooks. Is there > > > > > another place that validates the firmware signatures.  I'm not seeing > > > > > which patch requires firmware to be signed? > > > > > > > > Luis has a set of patches for this. However, I'm not sure if that's going > > > > anywhere at the moment. Possibly I should remove this from the manpage for > > > > the moment. > > > > Remove it for now. The state of of affairs for firmware signing is complex given > > that we first wanted to address how to properly grow the API without making > > the API worse. This in and of itself was an effort, and that effort also > > evaluated two different development paradigms: > > > > o functional API > > o data driven API > > > > I only recently was convinced that functional API should be used, even for > > commonly used exported symbols, > > Are you? Yes, this stemmed from the fact that even system calls can be abused through data driven APIs, and that long term a functional API at least can make evolutions much easier to review and bisect. That said this is all based on *empirical hearsay*, and no formal observations. But the ease to more easily bisect long term is enough for me to consider this for the firmware API given subtle regressions have been a long standing pain on the firmware API and I would not want to make the process of bisecting any harder. If anyone *does* have actual efforts which compares and contrasts both, I'd love to get them, to further back my current position, but as-is I'm already sold on functional API driven interface. > I haven't answered Linus' question, but my concern about functional APIs, > as far as firmware signing goes, is that we have no way to _enforce_ > firmware signing to existing (i.e. verification-unaware) drivers if we need > an explicit call of a function, say, verify_firmware(). Your concern seems to be that a functional driven API for firmware signing would implicate having to support verify_firmware() for drivers which *cannot* get signed firmware verified, is that correct? IMHO that should just fail then, ie, a "locked down" kernel should not want to *pass* a firmware signature if such thing could not be done. Its no different than trying to verify a signed module on a "locked down" for which it has no signature. But perhaps I'm not understanding the issue well, let me know. > > and as such I've been going back and slowly > > grooming the firmware API with small atomic changes to first clean up the > > complex flag mess we have. > > > > Since I'm busy with that Takahiro AKASHI has taken up firmware singing effort > > but this will depend on the above small cleanup to be done first. I was busy > > with addressing existing bugs on the firmware API for a while, then company > > travel / conferences so was not able to address this, but I'm back now and > > I believe I should be able to tackle the cleanup now. > > Good to hear. > > > Only after this is merged can we expect a final respin of the firmware signing > > effort. > > > > > Or reflect that IMA-appraisal, if enabled, will enforce firmware being > > > validly signed. > > > > But FWICT lockdown is a built-in kernel thingy, unless lockdown implies IMA > > it would not be the place to refer to it. > > I think that the situation is the same as in module signing. But by definition a "locked down" kernel will enforce module signing, and it would seem logical that if modules signing is enforced, eventually a statement about firmware signing can be added, as it relates to a kernel enforcement effort, not a kernel-userpace framework such as IMA. Luis > -Takahiro AKASHI > > > It seems the documentation was proposed to help users if an error was caught. > > That error should cover only what is being addressed in code on the kernel. > > > > Luis > -- Luis Rodriguez, SUSE LINUX GmbH Maxfeldstrasse 5; D-90409 Nuernberg From mboxrd@z Thu Jan 1 00:00:00 1970 From: mcgrof@kernel.org (Luis R. Rodriguez) Date: Wed, 8 Nov 2017 20:46:26 +0100 Subject: Firmware signing -- Re: [PATCH 00/27] security, efi: Add kernel lockdown In-Reply-To: <20171108061551.GD7859@linaro.org> References: <1509660086.3416.15.camel@linux.vnet.ibm.com> <150842463163.7923.11081723749106843698.stgit@warthog.procyon.org.uk> <14219.1509660259@warthog.procyon.org.uk> <1509660641.3416.24.camel@linux.vnet.ibm.com> <20171107230700.GJ22894@wotan.suse.de> <20171108061551.GD7859@linaro.org> Message-ID: <20171108194626.GQ22894@wotan.suse.de> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Wed, Nov 08, 2017 at 03:15:54PM +0900, AKASHI, Takahiro wrote: > Luis, > > Thank you for this heads-up. > > On Wed, Nov 08, 2017 at 12:07:00AM +0100, Luis R. Rodriguez wrote: > > On Thu, Nov 02, 2017 at 06:10:41PM -0400, Mimi Zohar wrote: > > > On Thu, 2017-11-02 at 22:04 +0000, David Howells wrote: > > > > Mimi Zohar wrote: > > > > > > > > > > Only validly signed device firmware may be loaded. > > > > > > > > > > fw_get_filesystem_firmware() calls kernel_read_file_from_path() to > > > > > read the firmware, which calls into the security hooks. Is there > > > > > another place that validates the firmware signatures. ?I'm not seeing > > > > > which patch requires firmware to be signed? > > > > > > > > Luis has a set of patches for this. However, I'm not sure if that's going > > > > anywhere at the moment. Possibly I should remove this from the manpage for > > > > the moment. > > > > Remove it for now. The state of of affairs for firmware signing is complex given > > that we first wanted to address how to properly grow the API without making > > the API worse. This in and of itself was an effort, and that effort also > > evaluated two different development paradigms: > > > > o functional API > > o data driven API > > > > I only recently was convinced that functional API should be used, even for > > commonly used exported symbols, > > Are you? Yes, this stemmed from the fact that even system calls can be abused through data driven APIs, and that long term a functional API at least can make evolutions much easier to review and bisect. That said this is all based on *empirical hearsay*, and no formal observations. But the ease to more easily bisect long term is enough for me to consider this for the firmware API given subtle regressions have been a long standing pain on the firmware API and I would not want to make the process of bisecting any harder. If anyone *does* have actual efforts which compares and contrasts both, I'd love to get them, to further back my current position, but as-is I'm already sold on functional API driven interface. > I haven't answered Linus' question, but my concern about functional APIs, > as far as firmware signing goes, is that we have no way to _enforce_ > firmware signing to existing (i.e. verification-unaware) drivers if we need > an explicit call of a function, say, verify_firmware(). Your concern seems to be that a functional driven API for firmware signing would implicate having to support verify_firmware() for drivers which *cannot* get signed firmware verified, is that correct? IMHO that should just fail then, ie, a "locked down" kernel should not want to *pass* a firmware signature if such thing could not be done. Its no different than trying to verify a signed module on a "locked down" for which it has no signature. But perhaps I'm not understanding the issue well, let me know. > > and as such I've been going back and slowly > > grooming the firmware API with small atomic changes to first clean up the > > complex flag mess we have. > > > > Since I'm busy with that Takahiro AKASHI has taken up firmware singing effort > > but this will depend on the above small cleanup to be done first. I was busy > > with addressing existing bugs on the firmware API for a while, then company > > travel / conferences so was not able to address this, but I'm back now and > > I believe I should be able to tackle the cleanup now. > > Good to hear. > > > Only after this is merged can we expect a final respin of the firmware signing > > effort. > > > > > Or reflect that IMA-appraisal, if enabled, will enforce firmware being > > > validly signed. > > > > But FWICT lockdown is a built-in kernel thingy, unless lockdown implies IMA > > it would not be the place to refer to it. > > I think that the situation is the same as in module signing. But by definition a "locked down" kernel will enforce module signing, and it would seem logical that if modules signing is enforced, eventually a statement about firmware signing can be added, as it relates to a kernel enforcement effort, not a kernel-userpace framework such as IMA. Luis > -Takahiro AKASHI > > > It seems the documentation was proposed to help users if an error was caught. > > That error should cover only what is being addressed in code on the kernel. > > > > Luis > -- Luis Rodriguez, SUSE LINUX GmbH Maxfeldstrasse 5; D-90409 Nuernberg -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html