Re: Bug - bcache: "unable to handle kernel NULL pointer dereference" when trying to add a md caching device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 25 Mar 2016, Eric Wheeler wrote:
> On Thu, 24 Mar 2016, Sebastian Roesner wrote:
> > I experienced a bug after upgrading to a recent kernel (4.5.0).
> > 
> > # echo /dev/md2 > /sys/fs/bcache/register
> > 
> > gives me a stack trace.
> > 
> > I created a bug in the kernel bugtracker but I'm not sure if it has been
> > noticed by the bcache developers:
> > 
> > <https://bugzilla.kernel.org/show_bug.cgi?id=114871>
> 
> The dereference appears to happen inside of bio_trim which is core block 
> code.  In this case, it looks like bio_trim is being passed a null pointer 
> to *bio, but by whom?  
> 
> Please send this output:
> 
> tail /sys/block/md2/queue/discard_*
> 
> > Could somebody have a look?
> 
> It could be an allocation failure in bcache that gets pushed down the 
> stack at registration.  If that is the case, please pull these two fixes 
> branches which may have missed 4.5:
> 
> git pull https://bitbucket.org/ewheelerinc/linux v4.5-rc6-bcache-fixes
> git pull https://bitbucket.org/ewheelerinc/linux v4.5-rc7-bcache-fixes

Sebastian,

Try this patch and see if it BUGs:

diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
index 86a0bb8..f6bbbce 100644
--- a/drivers/md/bcache/io.c
+++ b/drivers/md/bcache/io.c
@@ -24,6 +24,9 @@ struct bio *bch_bbio_alloc(struct cache_set *c)
 	struct bbio *b = mempool_alloc(c->bio_meta, GFP_NOIO);
 	struct bio *bio = &b->bio;
 
+	BUG_ON(!b);
+	BUG_ON(!bio);
+
 	bio_init(bio);
 	bio->bi_flags		|= BIO_POOL_NONE << BIO_POOL_OFFSET;
 	bio->bi_max_vecs	 = bucket_pages(c);
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux