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] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E3C06D2.2020309@redhat.com>
Date:	Fri, 05 Aug 2011 17:05:54 +0200
From:	Laszlo Ersek <lersek@...hat.com>
To:	Dan Carpenter <error27@...il.com>
CC:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Joe Jin <joe.jin@...cle.com>,
	open list <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: Re: [patch] xen-blkback: add missing return on error in xen_update_blkif_status()

On 08/05/11 16:18, Dan Carpenter wrote:
> We should return here after reporting the error.  Otherwise we'd hit
> a NULL deref of blkif->xenblkd on the next line.
>
> Signed-off-by: Dan Carpenter<error27@...il.com>
>
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index 32d4c3c..b750299 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -107,6 +107,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
>   		err = PTR_ERR(blkif->xenblkd);
>   		blkif->xenblkd = NULL;
>   		xenbus_dev_error(blkif->be->dev, err, "start xenblkd");
> +		return;
>   	}
>
>   	blkif->be->kthread_pid = blkif->xenblkd->pid;

In case somebody were asking for my opinion:

I think this block was the last block in the originally containing 
function (update_blkif_status()?), thus the "return" wasn't needed 
there. I guess the block got copied and then other code was added below it.

Acked-by: Laszlo Ersek <lersek@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ