Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp372148rwn; Wed, 14 Sep 2022 23:08:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR4FABORCzQNTt+e7Jo5TSi4B2zEv5c9g3TRNIZpXDDPZ7n4YecEqHtelp/hxsqikuntX0Mm X-Received: by 2002:a05:6a00:c86:b0:542:7c38:4a59 with SMTP id a6-20020a056a000c8600b005427c384a59mr21820900pfv.74.1663222112445; Wed, 14 Sep 2022 23:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663222112; cv=none; d=google.com; s=arc-20160816; b=mDG9z69/9k+Drf2zBkqrRb0hY8MiWiAr0WVHloATsGvXfD/7GeXuxHHmpuN4uay+QI 3mHTLJM3vWoWpFjvWPSwoc09L0lCDu5ubygBw1zIh5gZtkSvikwNAkUa5OHEey0/bGjl ptTqGsak3BnF6MY5AyLc2oUbcoVd1Rt4D2yJCuULc4wjIxso46j/5etcXrky4XIc85fD HMFFjGC+qQUD0HbJjAtwLQljNDSnkmSc6kuGu+bPLdcCaVSdv+4kJS0SRNueHXxoI60K Nk6QTkZG3m4GIL8GzpkIINS6cfCrrtKGMLwysUvBq4V33tT6Yl2m3uCuw7nLjmfQyTHS lNOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PV7fH85MRA4yc9AjgyP4hdElIOcHCJ5CFQAPoEX99J0=; b=qCDPHN/NhANAWLPPvqLKHKTPbfP0pPFk7a6N7rqBXA9/y7//XplVxpWwKXd3Oe9gNV xQKD09EXjw7G5NEvlDhK00nevihBhy9nUUO4PHoNf6+JuvhmjgtGGwh8l1yo4OeCjS0Y wYFtDez3ru9tQFVRxnyT8fphwGdFG0gVBJAOyeNf6bgYSr2fJCL3McfOH7indK41I54u Wk4S71v6XNg54r3pRpNjWmk8DQeIxIRgDC0O2SX6Am5f27d108EqZzAGSLU7ttc2DRkg 4oKlh00vQYqpkL+RiYa4GOZxs4fVvf/L3s3qwODFPiMTxIdI9z0pqNX6GBJDbahwHbS1 DPjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=ktfV9dAV; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a170902e74600b001751a9de12esi20913673plf.288.2022.09.14.23.08.18; Wed, 14 Sep 2022 23:08:32 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=ktfV9dAV; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229679AbiIOFpZ (ORCPT + 99 others); Thu, 15 Sep 2022 01:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiIOFpW (ORCPT ); Thu, 15 Sep 2022 01:45:22 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D59B8E463; Wed, 14 Sep 2022 22:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1663220684; bh=PV7fH85MRA4yc9AjgyP4hdElIOcHCJ5CFQAPoEX99J0=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ktfV9dAVDv4xo0RomC6f0kSSOEhok4v4xnQ3yW/kx/uuEsMkJHaT1bdQ5AqC/22wt NICRODoW4i/7tvD50msK9qcTloBeni8hdJ6LdLnGfMs6SAjTe7C6ga7MQZnLUC3KNP afsekUe1FDHMq4e5n7vXVq/zp+O6sJbojrEhhp94= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.174.140]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N0XCw-1pUuwC0agO-00wYKm; Thu, 15 Sep 2022 07:44:44 +0200 Message-ID: <86318454-d5cd-3787-a88f-41be40967c4d@gmx.de> Date: Thu, 15 Sep 2022 07:44:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] parisc: Increase the usage check of kmalloc allocated object a Content-Language: en-US To: Rolf Eike Beer , Li zeming , James.Bottomley@hansenpartnership.com Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220914060428.4039-1-zeming@nfschina.com> <1668528.WaZXzWfjLs@eto.sf-tec.de> <3a72852c-2f28-2916-f02c-b52cb06efd7d@gmx.de> <7266457.TOmriZnqnj@eto.sf-tec.de> From: Helge Deller In-Reply-To: <7266457.TOmriZnqnj@eto.sf-tec.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/VEdP8sMnEu/1h9MXY9piRI2fM98LLscHVjUzRkuV0T3xN/2Qcv VeggksKCNaZTxpf2266xe7gPBWjUIplJydtqpumHhS70Pgupv2+Ul0ihBPOVfr++NM2yJeP DUTADUWNOoggGeh/48yovNuNN3EbLQ7m0Euji+tPmdlikx6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XiY1jMxokMVblcFBi3WdNO5fa3HaoGGuDs31o+8ywIQS19poYOWIsJ0v dmS+F2WGkEKyCBlkp9P/44Rw6kWr9niRhoPiYBIdbYXV2PquUiogZ2c9WrI4J4u1zuhANhogq 4IGpAevt+nyU5hHH44as7JZ4VN7gVBHz6rEz1WWxcxWW+bBODJMkI7AeHZLSUfGStNYVu2JXg 0BQwrf7VPtwUGt11UoDMVPt7De X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 On 9/14/22 16:25, Rolf Eike Beer wrote: > 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 r= eturn >> at least the required 8-byte alignment)? > > Done. > >>> And these functions end up propagating an allocation error in this fil= e >>> 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_ir= t() > will return 0, which can either be "nothing to do" or "error". iosapic_i= nit() > is void, so even if it could detect the failure, it can't report it upwa= rds to > parisc_init(). Which is the same for basically all other *_init() calls = in > there. Ok, I see. Not sure if that needs fixing. If the allocation fails we will be in troub= le anyway :-) Helge