From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE40FC433E0 for ; Fri, 22 Jan 2021 13:10:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB860206A4 for ; Fri, 22 Jan 2021 13:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbhAVNKL (ORCPT ); Fri, 22 Jan 2021 08:10:11 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:57503 "EHLO wout5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbhAVNEz (ORCPT ); Fri, 22 Jan 2021 08:04:55 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id DB7103BA; Fri, 22 Jan 2021 08:03:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 22 Jan 2021 08:03:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm2; bh=k zk5CkVPDV2z5ANLM8vZ51aMVOkQ1/iQCg3WWm0XRpI=; b=EIVRnu/P3l8XjfUVm H2fU/D0jtlKFt3+hQgD+aFvlaqCPT/hnEambIXcAasw4SU6Tga0gz8KuP5zZi3N3 ZLlpaKn+L7zEJgP9sXjxJneAFYWCJWe5/UMf/fImn6i/GkTfy3JJ6B6zjdI562Rr BgrmPcAxBjZedqyPTNH7lk0csARp8hjtaIyqy/0fDTkSj3l0Kl5Qf8gQtnKlzwho xE+r/r5ekWzynpcVdFydsS+r/2i/VXF5X9U/qe1tmYjNFiwVcSNSuZjuNwhPrMRa X/gqj4UPT767AvtQ88fJ5kDfvzSHbyu+InUBj5W4J0O4Qw0KrBg6gS5K0Gi4KsZ/ R02yw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=kzk5CkVPDV2z5ANLM8vZ51aMVOkQ1/iQCg3WWm0XR pI=; b=EMN4zhKaBmhHVlOtCgVbKjEON+KFiJlEpuSsH2Vi/rF2MHtysYIIOzJKX Qr9tCEPNxhQNXK612hspvT9A70JLwUbTp5+qb6gYCPIN3TTFGmaDflpFoqf/RUY5 5rm/KNOXRuHG81wFrKvmv4VpnoPJ0XIL6vB18Z5JJP83Ik25FkHiRqO671du4/na R6nLFJc1vgn7Vkw57ZXtj0n8SO8da6dmNr8OwhZAeltEaUi4GoQH8lZPFLD6/GCn qTYM16Ycv4zbWP5gSbsr27D8YPQlSjvzq1KUgXbVuhNd/2XcUoEc+pc4qpO2fLmO 5vOXRgLJSYMvZhrl5REY56jz0QvPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeigdehvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeevtdeile euteeggefgueefhfevgfdttefgtefgtddvgeejheeiuddvtdekffehffenucfkphepkeef rdekiedrjeegrdeigeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id CCE15108005C; Fri, 22 Jan 2021 08:03:39 -0500 (EST) Date: Fri, 22 Jan 2021 14:03:36 +0100 From: Greg KH To: =?iso-8859-1?Q?=A0Tan?= Zhongjun Cc: tanzhongjun@yulong.com, Tianjia Zhang , Tobias Markus , David Howells , Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , =?iso-8859-1?Q?Jo=E3o?= Fonseca , Jarkko Sakkinen , stable@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH] X.509: Fix crash caused by NULL pointer Message-ID: References: <20210122121917.1414-1-hbut_tan@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210122121917.1414-1-hbut_tan@163.com> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Jan 22, 2021 at 08:19:15PM +0800,  Tan Zhongjun wrote: > From: Tianjia Zhang > > On the following call path, `sig->pkey_algo` is not assigned > in asymmetric_key_verify_signature(), which causes runtime > crash in public_key_verify_signature(). > > keyctl_pkey_verify > asymmetric_key_verify_signature > verify_signature > public_key_verify_signature > > This patch simply check this situation and fixes the crash > caused by NULL pointer. > > Fixes: 215525639631 ("X.509: support OSCCA SM2-with-SM3 certificate verification") > Reported-by: Tobias Markus > Signed-off-by: Tianjia Zhang > Signed-off-by: David Howells > Reviewed-and-tested-by: Toke Høiland-Jørgensen > Tested-by: João Fonseca > Acked-by: Jarkko Sakkinen > Cc: stable@vger.kernel.org # v5.10+ > Signed-off-by: Linus Torvalds > Signed-off-by: george.tan > --- > crypto/asymmetric_keys/public_key.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Why send this to us again? Is it needed somewhere we have not already applied it to? thanks, greg k-h