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: <20090623142357.b2050c14.akpm@linux-foundation.org>
Date:	Tue, 23 Jun 2009 14:23:57 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Nikanth Karthikesan <knikanth@...e.de>
Cc:	axboe@...nel.dk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix error handling in add_disk

On Wed, 17 Jun 2009 12:31:10 +0530
Nikanth Karthikesan <knikanth@...e.de> wrote:

> Fix error handling in add_disk. Also add WARN_ON()'s in case
> of error, which can be removed once the callers handle the error.
> 

I have a vague ancestral memory that some of the unchecked errors which
you're now checking for actually do happen in practice, and that this
"fix" will end up breaking currently-working setups.

Or maybe I'm thinking of a similar but different piece of code (maybe
it was the partition code?).

Still, I think it would be prudent to initially make this patch
continue to ignore the errors.  So add the warnings, but don't change
the response to errors.  Then we can get the change distributed for a
bit of testing and if that all looks good then we can add the control
flow changes later.

>  	retval = blk_alloc_devt(&disk->part0, &devt);
>  	if (retval) {
>  		WARN_ON(1);
> -		return;
> +		goto err_out;
>  	}
> ...
> +	if (retval) {
> +		WARN_ON(1);
> +		goto err_free_devt;
> +	}
> ...
> +	if (retval) {
> +		WARN_ON(1);
> +		goto err_free_region;
> +	}
> ...
> -	WARN_ON(retval);
> +	if (retval) {
> +		WARN_ON(1);
> +		goto err_free_queue;
> +	}

These all can be coded as

	if (WARN_ON(retval))
		goto foo;

--
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