Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp919766lqt; Tue, 19 Mar 2024 07:44:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9F9gqcnoTuZ4565CFL85HGWYKu2iCpYvNDv9Vr7s7YdqCP9io4Tey/7I/RpIFP4QaHjpTWQW/k2olx/cS+CSrDedqb3keTKjHGGB6kw== X-Google-Smtp-Source: AGHT+IFeRUAhW0Dibg4iqCflYbUlFr3ap02UojdSBHguQP9NhBZ233W9YVmgVrfJMbIid5MY99io X-Received: by 2002:a2e:95d3:0:b0:2d4:68ef:c714 with SMTP id y19-20020a2e95d3000000b002d468efc714mr8787003ljh.38.1710859494109; Tue, 19 Mar 2024 07:44:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710859494; cv=pass; d=google.com; s=arc-20160816; b=o/QUhO4v+lASgSAxj+hPbJDzG3Mx7qw8Ufd0y/PL2OA1g3zqAU49F9uPwh61MKpZnX HP+KHq10K+DQs5uamU3mcdWdoyj/nk6bjVQ7a8HI2z0sew7Uv4OSRWCMZIYwFkzoMPNN iuv5+B3aiyu1twQab7znlU/X2h2sbJAdow2bMnd2tv818ZGQEt48t73+dqXvDryzJDEq C/WIb+KSLwJShXbPVoqte991fG/SfauCAmBEOcp2ddTvqga8L+h27yXeDqbhvZEOBXJ9 0UrCBgl51ClXaeec5KPjBnQ+JDpUbqGTAYvgq7/g6ednPrJI0N+MO2KYZjAOIgUUOYke elAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=P40Vdq5Nbbd2vIKB85O00otSW5GtKAMdXan8b0B8sCE=; fh=CZGdRUqutRLdjQm0D9sB4ELmaLAl6J4KUSos8KkSqhA=; b=j1XX9M5/G2vJvbJI9zcNFPlOzSzuI59iOE5vWw9Wc/tV60LIJQHAIytaJJGImZTUrB vlRo/I+I1Jcpxqe/6N23iIsIcYvQEslD0kZPa0kvoNF+9wGVGXIxFY/mDGib4auzXg6i FGq8HFa9QWkMqw8WKLnfivSCpuSF5cSDHDzZPope3qQdB3vRqfqykTquX5ZNd+P9Jf9z VbBDHyH0M/cY5fsRAC/LKKYD9/fTXXvsqzCzVbu/J/AwCzCk3yJsuBwGoplsOVUeB7e3 rfV/SeksgGOpbQCY4h+pfFSDX2J7d9MbExaV5j6U59X1SZYSUdDPbfwdWfoj/NQQtgHo ZVfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-107669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107669-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l23-20020a170906645700b00a46258410a9si5189052ejn.447.2024.03.19.07.44.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 07:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-107669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107669-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CE0931F21317 for ; Tue, 19 Mar 2024 14:44:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3533A5CDC0; Tue, 19 Mar 2024 14:44:46 +0000 (UTC) Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FEBB23A8; Tue, 19 Mar 2024 14:44:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710859485; cv=none; b=NN9imhUuPNwsjh7L+72dxvQQ7NROetZNmwV2eyNt2RX76/ux5oJtqN/tScQTFybfy2TokZWJZuv62aLsvdLaihpvnhdEXPSczxgJgZ+tcsjrcEMzh5aIYLiH7Zax3IuBmDo+bIBfECbLBHizhVGkEVzy3pSm+lwjO/2KAVycSv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710859485; c=relaxed/simple; bh=P40Vdq5Nbbd2vIKB85O00otSW5GtKAMdXan8b0B8sCE=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=J88m519p4Cg4lzPdNVHcmqNRrj7Ny8gSORrEWk4YymyO5OZwl4bv1QdscrCO+d81avSKhTpb7dxubbwkFnzCv1OD9f7ETiaPAGHgTETV5WTcdc5taHOkqFzXdGtFJa6ixDy0nGhZIZ2AVPJJUc2ymrIMD0yZZv/JrHqsWChbexY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from msexch01.omp.ru (10.188.4.12) by msexch02.omp.ru (10.188.4.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Tue, 19 Mar 2024 17:44:35 +0300 Received: from msexch01.omp.ru ([fe80::485b:1c4a:fb7f:c753]) by msexch01.omp.ru ([fe80::485b:1c4a:fb7f:c753%5]) with mapi id 15.02.1258.012; Tue, 19 Mar 2024 17:44:35 +0300 From: Roman Smirnov To: Jarkko Sakkinen , David Howells , Herbert Xu , "David S. Miller" , Andrew Zaborowski CC: "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" , "Sergey Shtylyov" Subject: Re: [PATCH] KEYS: prevent NULL pointer dereference in find_asymmetric_key() Thread-Topic: [PATCH] KEYS: prevent NULL pointer dereference in find_asymmetric_key() Thread-Index: AQHadsRHcr0dJekxEkCC6oTcOjjyP7E9+xQAgAEukF0= Date: Tue, 19 Mar 2024 14:44:35 +0000 Message-ID: References: <20240315103320.18754-1-r.smirnov@omp.ru>, In-Reply-To: Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-kse-serverinfo: msexch02.omp.ru, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 3/19/2024 12:55:00 PM x-kse-attachment-filter-triggered-rules: Clean x-kse-attachment-filter-triggered-filters: Clean x-kse-bulkmessagesfiltering-scan-result: InTheLimit Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 19 Mar 2024 01:39:00 +0200 Jarkko Sakkinen wrote: > On Fri Mar 15, 2024 at 12:33 PM EET, Roman Smirnov wrote: > > With the current code, in case all NULLs are passed in id_{0,1,2}, >=20 > "current code" is not unambigious reference of any part of the kernel > tree. Please just write down the function name instead. >=20 > > the kernel will first print out a WARNING and then have an oops > > because id_2 gets dereferenced anyway. >=20 > Would be more exact": >=20 > s/print out a WARNING/emit WARN/ Okay, I'll prepare a second version of the patch. > > Note that WARN_ON() is also considered harmful by Greg Kroah- > > Hartman since it causes the Android kernels to panic as they > > get booted with the panic_on_warn option. >=20 > Despite full respect to Greg, and agreeing what he had said about > the topic (which you are lacking lore link meaning that in all > cases the current description is incomplete), the only thing that > should be documented should be that since WARN_ON() can emit > panic when panic_on_warn is set in the *kernel command-line* > (not "option") this condition should be relaxed. Here's a link to the discussion: https://lore.kernel.org/all/2024011213-situated-augmented-64a4@gregkh/ From the context, I thought WARN_ON() would be better removed. > > > > Found by Linux Verification Center (linuxtesting.org) with Svace. >=20 > I'm not sure if this should be part of the commit message. I have already submitted patches with this line, some have been accepted. It is important for the Linux Verification Center to mark patches as closing issues found with Svace. > > > > Fixes: 7d30198ee24f ("keys: X.509 public key issuer lookup without AKID= ") > > Suggested-by: Sergey Shtylyov >=20 > Should be reported-by. The suggested-by tag belongs to Sergey because he suggested the fix, subject/description of the patch. The tag reported-by belongs to Svace tool. Thank you for the reply.=