Received: by 10.223.185.116 with SMTP id b49csp1041473wrg; Wed, 21 Feb 2018 11:03:44 -0800 (PST) X-Google-Smtp-Source: AH8x224Kh7ME6WjLJ/kjj1+LZqMfDZq3IPVrSTj4vpUIJ5+BR5nTZJ5Ht1wykYDTwHGwcQDv5iu9 X-Received: by 2002:a17:902:d909:: with SMTP id c9-v6mr3786491plz.34.1519239823963; Wed, 21 Feb 2018 11:03:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519239823; cv=none; d=google.com; s=arc-20160816; b=S6fqpUKbef7V15Je6P+RRTN7UXAO0NxWKV3rJ7sQjBC/RpwNK8m1GMR19pV30Bv6Mq FHj4bd0ChBHVUbbhG7bry4Cuom1HKOs4Kd0P++l0vRzBEam55nNZ2WjsjEsZbPtBbeB3 gkzIHyTaZPsW3Ph/Dd2Py172PZZnHArUxlJbzZDfULbxeMdcE1+ta6uskZ52kWYsexIG TFP1AGgPIKX8XIBtxha2bsx9OMfq5yEDiiLEvHTCFwteER2qLrMPNPZPsHgA3jElLGhH Ehx3r4yAoa/R0xk5feC7nxQkBs+BRIPS+guIRv3RtZczZVEkxUng58RMrUXk9rtPcf8d LucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization :arc-authentication-results; bh=5djhcq3DteOhjxQbkdrk8CksOA6w4xOFKMBr9cpDL6g=; b=h3syrjnCMGyQTDNtCDfv7zdGeVL3GEmbfmgkrqz9C4jim9pC4gW0W9Br+afgZqQiXm F0Fu+3I1knDLF+AXOru+cs1+J+u2HRHNSrOFyFx/PvQWQPuM1tqsIlUIpWELuRoPo0QO AeUi21basegvxyw/5otcux41eq34xfjggEZb42QnaoJ6QcWI/W4/ZL3hXtHhGnvJVRRr wi8pf1KOk9m0HMedA5qmtN5LT1MJbHoTDV09xafNbPfFbyG1YysEVUDSDrnbN83zah+t y6JOen0tu4G7msfqn4u6WU9KQ6BMjD9NGnsMN19HrE6vJKgCkjY36yoOu27urOPmY0Li FXRw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si891298pgt.475.2018.02.21.11.03.29; Wed, 21 Feb 2018 11:03:43 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935440AbeBUQVA (ORCPT + 99 others); Wed, 21 Feb 2018 11:21:00 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932767AbeBUQU6 (ORCPT ); Wed, 21 Feb 2018 11:20:58 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23762407A9AA; Wed, 21 Feb 2018 16:20:58 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-250.rdu2.redhat.com [10.10.120.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF4FA10A9717; Wed, 21 Feb 2018 16:20:56 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20180119125425.l72meyyc2qtrriwe@dwarf.suse.cz> References: <20180119125425.l72meyyc2qtrriwe@dwarf.suse.cz> <20180116193936.oiycvwlk5xy3gm77@dwarf.suse.cz> <20180111120157.23qceywzi6omvvkb@dwarf.suse.cz> <151024863544.28329.2436580122759221600.stgit@warthog.procyon.org.uk> <151024869793.28329.4817577607302613028.stgit@warthog.procyon.org.uk> <20180111115915.dejachty3l7fwpmf@dwarf.suse.cz> <4582.1516120311@warthog.procyon.org.uk> <24618.1516206864@warthog.procyon.org.uk> To: Jiri Bohac Cc: dhowells@redhat.com, linux-security-module@vger.kernel.org, gnomes@lxorguk.ukuu.org.uk, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, jforbes@redhat.com, Chun-Yi Lee Subject: Re: [PATCH 08a/30] kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23575.1519230051.1@warthog.procyon.org.uk> Date: Wed, 21 Feb 2018 16:20:51 +0000 Message-ID: <23576.1519230051@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 21 Feb 2018 16:20:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 21 Feb 2018 16:20:58 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiri Bohac wrote: > Key verification may and will fail for lots of reasons which is > just going to make a user's life harder. E.g. you want to kexec > an old kernel with an expired key. Or your date is just wrong and > you get -EKEYEXPIRED. Note that we can't check for expired keys as we can't trust the system clock to be correct at this point. > Also, only now I found that some of the error codes the crypto > code returns yield really confusing messages (e.g. > kexec_file_load of an unsigned kernel returns -ELIBBAD which > makes kexec exit with "kexec_file_load failed: Accessing a > corrupted shared library"). Yeah, that should be fixed. > Maybe the error code could be unified to -EKEYREJECTED for all > sorts of key verification failures? Things like ENOMEM and EINTR definitely need to stay separate (not that I allow interruption at the moment). ENOKEY (couldn't find matching key), EINVAL (didn't recognise identifier), ENOPKG (couldn't find a crypto algo) and EBADMSG (couldn't parse signature) are arguable. I think there's a valid case for treating ENOKEY, EINVAL and ENOPKG differently to EKEYREJECTED - more so for ENOKEY. In my opinion, ENOKEY, EINVAL and ENOPKG are not fatal errors if we're not enforcing signature checking, but EKEYREJECTED and EBADMSG are. David