lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Jul 2022 02:46:10 +1000
From:   Andrew Donnellan <ajd@...ux.ibm.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Frederic Barrat <fbarrat@...ux.ibm.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH 2/2] cxl: Fix a memory leak in an error handling path

On Mon, 2022-07-11 at 21:14 +0200, Christophe JAILLET wrote:
> A bitmap_zalloc() must be balanced by a corresponding bitmap_free()
> in the
> error handling path of afu_allocate_irqs().
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>

Thanks for catching this.

Acked-by: Andrew Donnellan <ajd@...ux.ibm.com>

> ---
> The error handling path should be done in the reversed order but it
> should
> work as-is.
> ---
>  drivers/misc/cxl/irq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
> index 0ce91d99aead..b730e022a48e 100644
> --- a/drivers/misc/cxl/irq.c
> +++ b/drivers/misc/cxl/irq.c
> @@ -349,6 +349,7 @@ int afu_allocate_irqs(struct cxl_context *ctx,
> u32 count)
>  
>  out:
>         cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
> +       bitmap_free(ctx->irq_bitmap);
>         afu_irq_name_free(ctx);
>         return -ENOMEM;
>  }


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ