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:   Fri, 9 Sep 2022 10:08:11 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Bo Liu <liubo03@...pur.com>
Cc:     sudipm.mukherjee@...il.com, arnd@...db.de,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ppdev: check ida_simple_get() return value

On Tue, Sep 06, 2022 at 10:36:42PM -0400, Bo Liu wrote:
> As ida_simple_get() can fail, we should check the return value.
> 
> Signed-off-by: Bo Liu <liubo03@...pur.com>
> ---
>  drivers/char/ppdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
> index 38b46c7d1737..13b58b6823ee 100644
> --- a/drivers/char/ppdev.c
> +++ b/drivers/char/ppdev.c
> @@ -300,6 +300,11 @@ static int register_device(int minor, struct pp_struct *pp)
>  	}
>  
>  	index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
> +	if (index < 0) {
> +		rc = index;
> +		goto err;
> +	}
> +
>  	memset(&ppdev_cb, 0, sizeof(ppdev_cb));
>  	ppdev_cb.irq_func = pp_irq;
>  	ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0;
> -- 
> 2.27.0
> 

You just leaked a memory reference here :(

How did you test this?  What tool caused this to be changed?  Please fix
up your tool to not add problems when it is attempting to fix problems,
as that's a never-ending cycle we do not want to be in :(

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ