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]
Message-ID: <4934093b-86c0-4889-a5e9-0f9d63fd528c@web.de>
Date: Wed, 17 Jan 2024 22:24:01 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Kunwu Chan <chentao@...inos.cn>, linux-scsi@...r.kernel.org,
 kernel-janitors@...r.kernel.org, "James E. J. Bottomley"
 <jejb@...ux.ibm.com>, "Manoj N. Kumar" <manoj@...ux.ibm.com>,
 "Matthew R. Ochs" <mrochs@...ux.ibm.com>,
 Uma Krishnan <ukrishn@...ux.ibm.com>,
 "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Kunwu Chan <kunwu.chan@...mail.com>
Subject: Re: [PATCH] scsi: cxlflash: Fix null pointer dereference in
 ocxlflash_get_fd

> kasprintf() returns a pointer to dynamically allocated memory
> which can be NULL upon failure.
…
> +++ b/drivers/scsi/cxlflash/ocxl_hw.c
> @@ -1231,6 +1231,11 @@ static struct file *ocxlflash_get_fd(void *ctx_cookie,
>  		fops = (struct file_operations *)&ocxl_afu_fops;
>
>  	name = kasprintf(GFP_KERNEL, "ocxlflash:%d", ctx->pe);
> +	if (!name) {
> +		rc = -ENOMEM;
> +		dev_err(dev, "%s: kasprintf allocation failed\n", __func__);
> +		goto err2;
> +	}
…

How do you think about to omit the extra error message?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ