From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753105AbdK0Vw2 (ORCPT ); Mon, 27 Nov 2017 16:52:28 -0500 Received: from s3.sipsolutions.net ([144.76.63.242]:59088 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdK0Vw1 (ORCPT ); Mon, 27 Nov 2017 16:52:27 -0500 Message-ID: <1511819541.5456.19.camel@sipsolutions.net> Subject: Re: d7be102f29 ("cfg80211: initialize regulatory keys/database later"): kernel BUG at crypto/asymmetric_keys/public_key.c:80! From: Johannes Berg To: Linus Torvalds , "Wu, Fengguang" , David Howells , Kees Cook , Josh Boyer Cc: "Ye, Xiaolong" , LKML , LKP Date: Mon, 27 Nov 2017 22:52:21 +0100 In-Reply-To: References: <20171126030718.x4yu4s7ozzegu5cy@wfg-t540p.sh.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.0-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-11-27 at 21:46 +0000, Linus Torvalds wrote: > On Sat, Nov 25, 2017 at 7:07 PM, Fengguang Wu wrote: > > FYI, we noticed the following commit (built with gcc-4.8): > > > > commit: d7be102f2945a626f55e0501e52bb31ba3e77b81 ("cfg80211: initialize regulatory keys/database later") > > The attached 'dmesg.xz' doesn't actually match the kernel or the > report. Very odd. > > > [ 8.602885] kernel BUG at crypto/asymmetric_keys/public_key.c:80! > > In that reported kernel, that is > > 80 BUG_ON(!sig->digest); > > so the public key signature has no digest. Yeah. I believe this was fixed by commit 01a95b2141e3 ("cfg80211: select CRYPTO_SHA256 if needed"), and since that was already on the way I didn't reply to this report specifically. > I'm not seeing why it would ever be ok to do BUG_ON() instead of just > returning an error, though. That's kinda a good question - here we might fail to load this certificate, print a key, and then never be able to load the signed file - but at least we wouldn't crash immediately :-) johannes