Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755971AbcKVU3c (ORCPT ); Tue, 22 Nov 2016 15:29:32 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:40243 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbcKVU3a (ORCPT ); Tue, 22 Nov 2016 15:29:30 -0500 Date: Tue, 22 Nov 2016 21:30:58 +0100 From: Lukas Wunner To: David Howells Cc: Matthew Garrett , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org Subject: Re: [PATCH 4/6] efi: Get the secure boot status Message-ID: <20161122203058.GA1844@wunner.de> References: <20161122104401.GC1552@wunner.de> <20161117123731.GA11573@wunner.de> <147977472115.6360.13015228230799369019.stgit@warthog.procyon.org.uk> <7199.1479826047@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7199.1479826047@warthog.procyon.org.uk> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 951 Lines: 26 On Tue, Nov 22, 2016 at 02:47:27PM +0000, David Howells wrote: > Lukas Wunner wrote: > > The "out_efi_err" portion differs from the previous version of this > > patch. Setting a __u8 to a negative value, is this really what you > > want? > > Eh? efi_get_secureboot() returns an int as before. The out_efi_err: > portions are exactly the same: By "the previous version of this patch" I was referring to your submission of Nov 16, not the existing code in the kernel. Your patch didn't contain the out_efi_err portion. You're assigning a negative value to boot_params->secure_boot (which is declared __u8). In the next patch you're just checking if the value isn't 0 and you're considerung secure boot to be enabled even though GetVariable failed. Hence my question above, is this what you want? Likely not, perhaps this is what you really want: boot_params->secure_boot = (efi_get_secureboot() == 1); Best regards, Lukas