Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1425500lqp; Mon, 15 Apr 2024 06:23:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5a2TMHFj45sGyweoxcX53gK/+u78ZYAhzbFj0HG0i6ru9e1GUowdEtv4+c+wTmFV0GZ5if3KtAt00sz+J1OpBP/ALZ2+1MVKbHImCtQ== X-Google-Smtp-Source: AGHT+IGqISpOOMr93BbrpMkgIWb0QnwDbNNT9BSeAd1MPeOODpO5UQ1A82Bnh8mnnjKEN+qfu+H3 X-Received: by 2002:a17:907:940a:b0:a52:5a04:f62c with SMTP id dk10-20020a170907940a00b00a525a04f62cmr3173156ejc.68.1713187436649; Mon, 15 Apr 2024 06:23:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713187436; cv=pass; d=google.com; s=arc-20160816; b=UmtgYaEdeGX7n+hIQ7XulSSMCgGoTRJXSY7dHflyI838+mCDdtUhwrkCr9SraMHnLL mDEsKvdx0MiyeLoeJwB2nUKWbE/4jGYEtszdE2akCjYfJtjeXV6a4DLW/gfUthmNx3Ln SFTv6MBzPlTOyzZEMXnuj44mz9E+ulByjJNmUhoRkReENHR+MwoJQZP+1sivlnRvkG26 9Sz/d9sXDivP6LLnkYbEyYXjHuEbSQz5LNLuxWRob129iUEMX+3r1Nsqq1Nqd0UuBGFH dJqdkQesyFqoxz9bRJv7tMID4sEsXv4yHmDMcn2qHFTspQQmmBaiivgnkgNvqin/7SY8 2ZqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=4q1T+fveRZjMHTvoEUqhMQBqnsOLA8vdGMrLNev6YzI=; fh=1XGdUz9JTvWC6H6eWmMTqF4ozD/pXdWLEj/GlO+VVAc=; b=bQWXPmOO3OoXSbPnN2fBpIna6LEklegkPG88Okn40PwZrNoDTTh4feExmWMBHuIkUg JVSK9CZ2bPuho5F7HHQ0tJMGCjbW4yeJLA3FNfbZHqXi5k1kqqtqAiHWvPfg4/0+cgpq gShtru2VKS3wiz+Fjo5DV8tWcGIQcomsQNKMUVnQAo73HGLwe2Eay6YsKZYI2c+KR6h5 q9k6YiGC9Amv/Ja/cPW/3Pen+Al54HCPul5k2P6NqjqDUWr+EYuH3g/FuE8hd6+iont/ cuDqcruFYzlrjHnrnC9wftQvZelpCAhQFNeFH3ukgs6NO+kOmmD7Z/PGbrT4i0Qx0E3x 7tIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=V6hLvTiW; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-145226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j9-20020a170906410900b00a5536691965si2402ejk.973.2024.04.15.06.23.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:23:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145226-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; dkim=pass header.i=@web.de header.s=s29768273 header.b=V6hLvTiW; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-145226-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145226-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 62EB61F21947 for ; Mon, 15 Apr 2024 13:23:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D539D12CD81; Mon, 15 Apr 2024 13:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="V6hLvTiW" Received: from mout.web.de (mout.web.de [217.72.192.78]) (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 B89A912C538; Mon, 15 Apr 2024 13:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.72.192.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713186483; cv=none; b=FS0aS6dEpgyDlRcdFt0uar93plSaz+jPdGnI8YsK1ufUqg3Vb1iJF6MgzEU06gpI2hFZozvaS8Qfk/yGpiHyGPjJ/qY58lw4SEGzbfg7ebHw2uG9aFplzsp59apVegXcz5v/OoEPnkVkKN/MZ5ESpAGhckoasCDWyPlU4mDcunE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713186483; c=relaxed/simple; bh=m0/I5+S6CSiilQW69yS2LbTSrey8p/oYlcMWnlsQ1J0=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=Anp6u6vQoun88I2pysGUkEjfkLQ4oY36X52EkMNBguQl0WUu1mnz21oIeFdrNjvGEwxo2UJT2MO32W2yPZ8ncFDV7M0ViBjgS3rIvhDNq/0Y30Axhhjn6XkzIUR3A1QNV+h0qxV+UkWHT/FLs2SiIIAdF4D1oK6j8DuvvFaEzSE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=V6hLvTiW; arc=none smtp.client-ip=217.72.192.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1713186419; x=1713791219; i=markus.elfring@web.de; bh=4q1T+fveRZjMHTvoEUqhMQBqnsOLA8vdGMrLNev6YzI=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:References: Subject:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=V6hLvTiWwBcQMJjgKssj/YRycNHHayc9GY/F/ZOJhV6qRMUb5S4a4ZlFaki16AIy 0TQ3G9D//AyAV6nRCb2fqGz65SJaBC1+qkM5a7LHIksupkkbBNRQrt2DRsucDePoF xmut1bsz2bo3057UG4ShP+eZqmIywbu0Lym0cPQWdV2IPR29olwBN5oKMrvq5V3Id tmglOZQ/U11PL3fQoYhfeCpInOTznaBM3M0snzoKIV6GcxLFHyUx8xPlSfuSWMjGn d72KdnTb9v9RAKdh8lWoX7sSUAq0/25NX+kWfTXkixMKKiQPs6GuwAnDdaVMSy2lX BNv93auRRxUnjuDVCQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.80.95]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mq1CC-1sacXB10a2-00nOEZ; Mon, 15 Apr 2024 15:06:59 +0200 Message-ID: Date: Mon, 15 Apr 2024 15:06:54 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Guanrui Huang , linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org, Marc Zyngier , Zenghui Yu Cc: LKML , Shannon Zhao , Thomas Gleixner References: <20240412021556.101792-1-guanrui.huang@linux.alibaba.com> Subject: Re: [PATCH v3] irqchip/gic-v3-its: Fix double free on error Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240412021556.101792-1-guanrui.huang@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:je1w6x2K7IgLg/YyCsujg70skuT5+UwFo/5EsgvyV0OKa75ON14 gLXr96eR4s/F1aoHi3GMFu9cpnRnrefuHQ4f5Gtoql6ONnBPdisIgpigWf5smwap4c2VUwX 9fTijWZyBo/MiS1bL3BDAGJUkhZUqjwx1tKJJTbtZhTcLPcZPTPg849RRO+nekfa6sPfXAh j4Dz5XiZVKnipOor0dWEA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:rm1SAKFwmZ8=;fwAliXKSJZyg6ImW72zUAywwFPP ngNWHHnusHBQIVHgT+2fYTiGcLDsfgc7Jpn7QIidJLdANeBPzMvL/8ku0xm4iBB00kr2Yv7Xc IDML4Z6UKRXaNx6HlN9jOAOQRbv7gVlFbqn/OPjhTkJubMtY3JheowwdCA0CWosGeB7Nz0Za1 ve26JZB3uuTkPF418kpZzW98NJ9DHlXhplm4hyY8Oyb8U0fjomdQCUJjFXzDu6lGkF9ma8IKy 6neuqOa/BIIoxxoqM0b6w3OhDBhfHs1e94Za5FZtxscROW0uDDndGZoZcceTkxY2s1O+xcOlR M1OSwLipi8gZtrGa3AX81vn762kIDj1ocNfPxcut9/XOueVhSX4oSo5Lg9HNdPswFWMhzuLew sVRhWeHLGPvfoSte7uKAUK+QbhzFJqBjnL6BzbAiHlILBGQWkENV14cnnq0ZYXfkM2AUbez2n 3EIEPC0Jw+LOlJRrQiJAUM2akKimJ1Qd+a3IJBOrzNoo/pfQdW8pvNoF3RdnpNnigZmnTOM20 LsO+04tfYuLAnRmqe86XLgoqr3M3/dlSSfOSkY3YAWoMAhLccgvCu8costpi5bjXxaPPGL55n uBbDN3FTXRLOMY7i6pCfiXkR7VbP2uapW7NeBIqr+mkpoGqaaT1NfzXIuGbb9wPQw6y3wLmSI COc90LcDdj/4vM9SKXbFL1AZPafPZRKkKl+BaahFV0IzlGO7yTbQBirmH7GzbGBVQR5n7WpMp rEZMKUUjQcVbIhhqikZ6Vi350WkGD41xizgBbDFgeRvUT0HUDIBw8haLiE37y71rxR30wZcGj PW+yBx+e1AwtQQaPZyEEOz9Ffre/ALat/P/OTXQdKZFac= > In its_vpe_irq_domain_alloc, when its_vpe_init() returns an error > with i > 0, its_vpe_irq_domain_free may free bitmap and vprop_page, > and then there is a double free in its_vpe_irq_domain_alloc. > > Fix it by calling its_vpe_irq_domain_free directly, bitmap and > vprop_page will be freed in this function. I find this change description improvable. Would you like to add the tag =E2=80=9CFixes=E2=80=9D accordingly? =E2=80=A6 > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -4521,8 +4521,6 @@ static int its_vpe_irq_domain_alloc(struct irq_dom= ain *domain, unsigned int virq > struct page *vprop_page; > int base, nr_ids, i, err =3D 0; > > - BUG_ON(!vm); =E2=80=A6 Please improve the patch granularity. See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Do= cumentation/process/submitting-patches.rst?h=3Dv6.9-rc4#n81 Regards, Markus