[Bug 214867] UBSAN: shift-out-of-bounds in drivers/of/unittest.c:1933:36

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Sat Oct 30 01:06:48 AEDT 2021


https://bugzilla.kernel.org/show_bug.cgi?id=214867

Arnd Bergmann (arnd at arndb.de) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arnd at arndb.de

--- Comment #2 from Arnd Bergmann (arnd at arndb.de) ---
This is the function that triggers it:

static void of_unittest_untrack_overlay(int id)
{
        if (overlay_first_id < 0)
                return;
        id -= overlay_first_id;
        if (WARN_ON(id >= MAX_UNITTEST_OVERLAYS))
                return;
        overlay_id_bits[BIT_WORD(id)] &= ~BIT_MASK(id);
}

My guess is that 'id' is negative here, which means it fails to tigger the
WARN_ON() but ends up still being out of range.

Can you try changing it to 'unsigned int id'?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.


More information about the Linuxppc-dev mailing list