Re: UBSAN: Undefined behaviour in lib/radix-tree.c:123:14: member access within null pointer of type 'const struct radix_tree_node'

From: Stephen Boyd
Date: Mon Oct 08 2018 - 19:16:43 EST


Quoting Mark Rutland (2018-07-20 01:31:02)
> In-Reply-To: <19427cc3-3372-9b02-4b92-096fbe328622@xxxxxxxxxxxxx>
>
> On Fri, Jul 20, 2018 at 09:53:21AM +0200, Paul Menzel wrote:
> > Dear Linux folks,
>
> Hi,
>
> > Enabling the undefined behavior sanitizer and building GNU/Linux 4.18-rc5+
> > (with some unrelated commits) with GCC 8.1.0 from Debian Sid/unstable, the
> > warning below is shown.
> >
> > > [ 0.958688] ================================================================================
> > > [ 0.959029] UBSAN: Undefined behaviour in lib/radix-tree.c:123:14
>
> That's in get_slot_offset(), and I think this is addressed by the patch [1] I previously sent.
>
> There are at least a couple of instances in the radix tree code, and I had
> intended to address them together, but I haven't had the chance over the last
> couple of weeks.
>
> I will try to get back to that soon.

Do you have that reworked patch lying around somewhere? I ran into an
ubsan error in radix-tree today and patch [1] fixes things.

> [1] https://lkml.kernel.org/r/20180706134144.48446-1-mark.rutland@xxxxxxx