Re: [PATCH] workqueue: Fix an object aliasing bug with `work_data_bits'

From: Tejun Heo
Date: Wed May 25 2016 - 16:55:27 EST


On Tue, May 17, 2016 at 12:04:33PM +0100, Maciej W. Rozycki wrote:
> Fix an aliasing issue causing a MIPS port build error:
>
> In file included from include/linux/srcu.h:34:0,
> from include/linux/notifier.h:15,
> from ./arch/mips/include/asm/uprobes.h:9,
> from include/linux/uprobes.h:61,
> from include/linux/mm_types.h:13,
> from ./arch/mips/include/asm/vdso.h:14,
> from arch/mips/vdso/vdso.h:27,
> from arch/mips/vdso/gettimeofday.c:11:
> include/linux/workqueue.h: In function 'work_static':
> include/linux/workqueue.h:186:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
> return *work_data_bits(work) & WORK_STRUCT_STATIC;
> ^

Umm... the kernel is built explicitly with -fno-strict-aliasing and
it's not something individual archs can opt out.

Thanks.

--
tejun