Re: [PATCH -next] powerpc/mm/ptdump: fix an undefined behaviour

2020-03-04 Thread Michael Ellerman
Christophe Leroy writes: > Le 05/03/2020 à 05:47, Qian Cai a écrit : >> Booting a power9 server with hash MMU could trigger an undefined >> behaviour because pud_offset(p4d, 0) will do, >> >> 0 >> (PAGE_SHIFT:16 + PTE_INDEX_SIZE:8 + H_PMD_INDEX_SIZE:10) >> >> UBSAN: shift-out-of-bounds in arch

Re: [PATCH -next] powerpc/mm/ptdump: fix an undefined behaviour

2020-03-04 Thread Christophe Leroy
Le 05/03/2020 à 05:47, Qian Cai a écrit : Booting a power9 server with hash MMU could trigger an undefined behaviour because pud_offset(p4d, 0) will do, 0 >> (PAGE_SHIFT:16 + PTE_INDEX_SIZE:8 + H_PMD_INDEX_SIZE:10) UBSAN: shift-out-of-bounds in arch/powerpc/mm/ptdump/ptdump.c:282:15 shif

[PATCH -next] powerpc/mm/ptdump: fix an undefined behaviour

2020-03-04 Thread Qian Cai
Booting a power9 server with hash MMU could trigger an undefined behaviour because pud_offset(p4d, 0) will do, 0 >> (PAGE_SHIFT:16 + PTE_INDEX_SIZE:8 + H_PMD_INDEX_SIZE:10) UBSAN: shift-out-of-bounds in arch/powerpc/mm/ptdump/ptdump.c:282:15 shift exponent 34 is too large for 32-bit type 'int'