Re: [PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread Matthew Wilcox
On Fri, Jul 06, 2018 at 02:45:34PM -0700, Andrew Morton wrote: > On Fri, 6 Jul 2018 16:36:41 +0100 Mark Rutland wrote: > > > > > > > > > Acked-by: Matthew Wilcox > > > > > > Cheers! > > > > > > I assume that Andrew will pick this up, if he's also happy with it. > > > > I've just started fuzz

Re: [PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread Andrew Morton
On Fri, 6 Jul 2018 16:36:41 +0100 Mark Rutland wrote: > > > > > > Acked-by: Matthew Wilcox > > > > Cheers! > > > > I assume that Andrew will pick this up, if he's also happy with it. > > I've just started fuzzing, and found this also applies with > node_tag_set(). I'll spin a v2 with that fi

Re: [PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread Mark Rutland
On Fri, Jul 06, 2018 at 03:36:04PM +0100, Mark Rutland wrote: > On Fri, Jul 06, 2018 at 07:25:40AM -0700, Matthew Wilcox wrote: > > On Fri, Jul 06, 2018 at 02:41:44PM +0100, Mark Rutland wrote: > > > When idr_alloc() is called for the first time on an IDR (which has no > > > nodes in its radix tree

Re: [PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread valdis . kletnieks
On Fri, 06 Jul 2018 14:41:44 +0100, Mark Rutland said: > I beleive this is what Valdis hit [1] back in March. I spotted this while > booting an arm64 machine. Yes, the stack trace is the same. The odd part is that I was consistently seeing it until next-20180626, but it evaporated in sometime be

Re: [PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread Mark Rutland
On Fri, Jul 06, 2018 at 07:25:40AM -0700, Matthew Wilcox wrote: > On Fri, Jul 06, 2018 at 02:41:44PM +0100, Mark Rutland wrote: > > When idr_alloc() is called for the first time on an IDR (which has no > > nodes in its radix tree), we end up with calculate_count() calling > > get_slot_offset() with

Re: [PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread Matthew Wilcox
On Fri, Jul 06, 2018 at 02:41:44PM +0100, Mark Rutland wrote: > When idr_alloc() is called for the first time on an IDR (which has no > nodes in its radix tree), we end up with calculate_count() calling > get_slot_offset() with a NULL node, leading to a NULL pointer > dereference caught by UBSAN:

[PATCH] radix-tree: avoid NULL dereference

2018-07-06 Thread Mark Rutland
When idr_alloc() is called for the first time on an IDR (which has no nodes in its radix tree), we end up with calculate_count() calling get_slot_offset() with a NULL node, leading to a NULL pointer dereference caught by UBSAN: ==