Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1615355pxb; Mon, 11 Oct 2021 09:32:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNob90chFmgnHRNuvhIfdltfLIYVEe6JaihjAp1VGEVEawRzJ5Vn7xrdAgdU4oQYDFkIcI X-Received: by 2002:a17:906:3990:: with SMTP id h16mr5460692eje.47.1633969932611; Mon, 11 Oct 2021 09:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969932; cv=none; d=google.com; s=arc-20160816; b=ZHSdALriPX0YMkygysguy2P9hj35CThUg5y9A7ZeertRC7jBg3VsiUjPVj0Fx3iKJw 0ix+PdRWHH5jkQjXC5ZPHbgh9o5ai2qg2CU6QAkbqNnmsvaU+D7jl31MlCmBpXw8AqiZ 5xyyXgnNlYUeZszz5POqoxD1ITJQEzlkroZmpyZGW8cEzFOrb4hTEzEx80uwcHizoAXE M6RV41pThr0sM2cL06bkhXQU/+cYpmYT1+y7qUdz63v3PFE5CbVn6+I6rH3IYUgOvqNj oR6Oe72f/uBpIOCNS71xJ/iEebRtMmvavNbihT743z4+Nw/Kc4gOqEiyWDjhUFf3SGKk rejg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M2p/LmVKrR4K9MN31LLV00Bm5ot+eR3hA0UHT5L0Kiw=; b=li6/edJxcvLMu6dHb+vQOW7Q75AnY57LGnu4lsDKH4MD+d5wwy7/nixF7dEnfge0r6 Oc3njHD1b2bYUjYm0x+HPWA0WXv0tnEHuK3DqPA5vqJ7Xx27I1i5n5XdzPB+CROtrHjB sfCxTOMqlI3xA5iaqGDvacrfav6yuHBHUffvHHiQTcmmyHpvAgnQx+funLYjw8E206ff vvMS2iWELLa31SiiPYv773FchCqJEN1PuvpgtLYGCEMY8+9up38xBjwQ2jRXkVDe97fh MuO6p0HPyrU2UoQ/Fux5ANRjVO+8QFPiqIw8OZTxXJdgEWgZI8pyDkt9KlwgzyX/X2RF FSXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iOuR3oEh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk2si10678377edb.40.2021.10.11.09.31.49; Mon, 11 Oct 2021 09:32:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iOuR3oEh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238401AbhJKOAu (ORCPT + 99 others); Mon, 11 Oct 2021 10:00:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238486AbhJKN6o (ORCPT ); Mon, 11 Oct 2021 09:58:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 73FF46108F; Mon, 11 Oct 2021 13:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960524; bh=99MS2tfrh/YSqqQcksI2D7npQ3n1kaiMY9/XiGxorng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOuR3oEh2QcR7xugs3gp+gRBZenqOC6Fwx+AyAQwfr1jlZGPL/MVl2ITZinkxzgqN TFq+q9Imxuc7y2riM97DTPXcIKox3VePsJjedb8f4ahabNC0dHvfcR/TjZzF1an4AT exxdCZcIW+jPsOz7blXgkTDUupmUUgyhvive/C3s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tiezhu Yang , Ilya Leoshkevich , Christian Borntraeger , Vasily Gorbik , Sasha Levin Subject: [PATCH 5.10 71/83] bpf, s390: Fix potential memory leak about jit_data Date: Mon, 11 Oct 2021 15:46:31 +0200 Message-Id: <20211011134510.830016431@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tiezhu Yang [ Upstream commit 686cb8b9f6b46787f035afe8fbd132a74e6b1bdd ] Make sure to free jit_data through kfree() in the error path. Fixes: 1c8f9b91c456 ("bpf: s390: add JIT support for multi-function programs") Signed-off-by: Tiezhu Yang Acked-by: Ilya Leoshkevich Reviewed-by: Christian Borntraeger Signed-off-by: Christian Borntraeger Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- arch/s390/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 8d9047d2d1e1..cd0cbdafedbd 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -1775,7 +1775,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) jit.addrs = kvcalloc(fp->len + 1, sizeof(*jit.addrs), GFP_KERNEL); if (jit.addrs == NULL) { fp = orig_fp; - goto out; + goto free_addrs; } /* * Three initial passes: -- 2.33.0