[dm-devel] [PATCH 3/4] block: fix a probe argument to blk_register_region
Tejun Heo
tj at kernel.org
Tue Oct 15 13:44:46 UTC 2013
On Mon, Oct 14, 2013 at 12:13:24PM -0400, Mikulas Patocka wrote:
> The probe function is supposed to return NULL on failure (as we can see in
> kobj_lookup: kobj = probe(dev, index, data); ... if (kobj) return kobj;
>
> However, in loop and brd, it returns negative error from ERR_PTR.
>
> This causes a crash if we simulate disk allocation failure and run
> less -f /dev/loop0 because the negative number is interpreted as a pointer:
...
> Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
> Cc: stable at kernel.org # 2.6.22+
Acked-by: Tejun Heo <tj at kernel.org>
Thanks.
--
tejun
More information about the dm-devel
mailing list