Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp8035121rwn; Wed, 14 Sep 2022 08:04:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6w8nbV6tUe3NJda4REztBA/0qeVga9IZDCsMfJaaunFdqdCU+q2RMuemEMWxugSwUBsxDW X-Received: by 2002:a05:6402:b29:b0:44e:d429:749d with SMTP id bo9-20020a0564020b2900b0044ed429749dmr31422013edb.423.1663167854099; Wed, 14 Sep 2022 08:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663167854; cv=none; d=google.com; s=arc-20160816; b=QP2KzB+CWitQJqYzjmfLt+0KH5z6vFSS4dfOkMq+bh1zIhaTbXZqMXR3685FpKzBrG Y/p7njcpwH1ZYC24xt+bpiqszjdI+rhUkP1jn6s4EXdEEKnoL93vpx9kYh56FuN9XL4s rSrM4LeS6QGPTEx94WnsOzgtlu77SW2iG6LsjmCaR3OC+zd1J/KTrMdribKCmD8qeg7d xB4mDdWcpvHVnmaRO8CjZ6Krdkx2Vu0SGKWA696WG61sX/scBD7dX7b77CxjGJuJujek KdYBz6zKRYvoooAaVW4hSeWHXilM/OtNYz/2ZMoi/NxSxjkT2glqLS4Ncn2KaMwqRKc8 48xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=mjEG5Y8VLBYP7Xezg79iRzXZ86epK1Dqcefrf05JuXI=; b=09ikU55oWHrrfgvvW6C3p3UueJcJtbzX3elQW4tuWaV8jvr4nmmFwgcMi49pbG0GOu 1sFrPRuFve50mtUyJF+Hyd+EQnJnj/0/RY+m67++4aXvwVwq+hnuuLzSXpPJSh+BSBZ9 zzWPYLfPWyudJSYPdb9PUZhgwzbETQ2IvXijnjgoOL8B3IqnomvAugQqj7uC0FiF8II8 3AKGD9ebUVSfoQjvtcXfDEMFBLGHJj2m5cjOYpyw/EYO7MZ1XV2c0FNABMe4EpAi+Evv EJM4ATluSwzAEK6VTC3PFKunYUjkgOHDD8JCVjB4mjhDpd2O1SDwWWl6GyOB0ine8D6M J1MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a05640225c800b0044e7ba203dasi11428194edb.614.2022.09.14.08.03.48; Wed, 14 Sep 2022 08:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbiINO06 (ORCPT + 99 others); Wed, 14 Sep 2022 10:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiINO0i (ORCPT ); Wed, 14 Sep 2022 10:26:38 -0400 Received: from mail.sf-mail.de (mail.sf-mail.de [IPv6:2a01:4f8:1c17:6fae:616d:6c69:616d:6c69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10C92DEE for ; Wed, 14 Sep 2022 07:26:07 -0700 (PDT) Received: (qmail 29980 invoked from network); 14 Sep 2022 14:26:24 -0000 Received: from p200300cf07104d0076d435fffeb7be92.dip0.t-ipconnect.de ([2003:cf:710:4d00:76d4:35ff:feb7:be92]:50372 HELO eto.sf-tec.de) (auth=eike@sf-mail.de) by mail.sf-mail.de (Qsmtpd 0.38dev) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPSA for ; Wed, 14 Sep 2022 16:26:24 +0200 From: Rolf Eike Beer To: Li zeming , James.Bottomley@hansenpartnership.com, Helge Deller Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] parisc: Increase the usage check of kmalloc allocated object a Date: Wed, 14 Sep 2022 16:25:59 +0200 Message-ID: <7266457.TOmriZnqnj@eto.sf-tec.de> In-Reply-To: <3a72852c-2f28-2916-f02c-b52cb06efd7d@gmx.de> References: <20220914060428.4039-1-zeming@nfschina.com> <1668528.WaZXzWfjLs@eto.sf-tec.de> <3a72852c-2f28-2916-f02c-b52cb06efd7d@gmx.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3490446.bMliCE8gdQ"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart3490446.bMliCE8gdQ Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Rolf Eike Beer Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 14 Sep 2022 16:25:59 +0200 Message-ID: <7266457.TOmriZnqnj@eto.sf-tec.de> In-Reply-To: <3a72852c-2f28-2916-f02c-b52cb06efd7d@gmx.de> MIME-Version: 1.0 Am Mittwoch, 14. September 2022, 11:04:33 CEST schrieb Helge Deller: > On 9/14/22 08:43, Rolf Eike Beer wrote: > > Am Mittwoch, 14. September 2022, 08:18:19 CEST schrieb Helge Deller: > >> On 9/14/22 08:04, Li zeming wrote: > Yes, your proposal is good. > Anyone want to send a patch (with a small comment that kcalloc() will return > at least the required 8-byte alignment)? Done. > > And these functions end up propagating an allocation error in this file > > and it will never reach kernel/setup.c, which seems bad. > > That part I don't understand. > The return value of iosapic_alloc_irt() is checked afterwards, but you > probably meant something else? > > > But I guess the only point where this really can go wrong if the PDC > > returns an absurdly large number of entries. What I meant was that if iosapic_alloc_irt() fails, then iosapic_load_irt() will return 0, which can either be "nothing to do" or "error". iosapic_init() is void, so even if it could detect the failure, it can't report it upwards to parisc_init(). Which is the same for basically all other *_init() calls in there. Eike --nextPart3490446.bMliCE8gdQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSaYVDeqwKa3fTXNeNcpIk+abn8TgUCYyHkdwAKCRBcpIk+abn8 TiFmAKCiYz0oM2+UTnWjzFdCTegZHOedFACfSwfqyw+ldoHibEfySzEWC9sw16g= =rIPh -----END PGP SIGNATURE----- --nextPart3490446.bMliCE8gdQ--