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  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, 15 Mar 2019 11:18:24 +0100
From:   Ursula Braun <ubraun@...ux.ibm.com>
To:     Kangjie Lu <kjlu@....edu>
Cc:     pakki001@....edu, Karsten Graul <kgraul@...ux.ibm.com>,
        "David S. Miller" <davem@...emloft.net>,
        linux-s390@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: smc: fix a NULL pointer dereference



On 3/15/19 5:15 AM, Kangjie Lu wrote:
> In case alloc_ordered_workqueue fails, the fix returns NULL
> to avoid NULL pointer dereference.
> 

Thanks, looks good. Your patch will be part of our next patch
submission for the net-tree.

Regards, Ursula

> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
>  net/smc/smc_ism.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
> index 2fff79db1a59..e89e918b88e0 100644
> --- a/net/smc/smc_ism.c
> +++ b/net/smc/smc_ism.c
> @@ -289,6 +289,11 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
>  	INIT_LIST_HEAD(&smcd->vlan);
>  	smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
>  						 WQ_MEM_RECLAIM, name);
> +	if (!smcd->event_wq) {
> +		kfree(smcd->conn);
> +		kfree(smcd);
> +		return NULL;
> +	}
>  	return smcd;
>  }
>  EXPORT_SYMBOL_GPL(smcd_alloc_dev);
> 

Powered by blists - more mailing lists