[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5j+9Fbbb5xfCaN81QTddFjqaHvOw5u55nLS8J+2zga8iKQ@mail.gmail.com>
Date: Tue, 20 Jun 2017 15:43:01 -0700
From: Kees Cook <keescook@...omium.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Ian Abbott <abbotti@....co.uk>,
Michal Nazarewicz <mina86@...a86.com>,
Borislav Petkov <bp@...e.de>,
Johannes Berg <johannes.berg@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Alexander Potapenko <glider@...gle.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kernel.h: fix new warnings for container_of()
On Tue, Jun 20, 2017 at 1:09 PM, Arnd Bergmann <arnd@...db.de> wrote:
> I see new warnings with gcc-7.0.1 with the modified container_of():
>
> fs/f2fs/dir.c: In function 'F2FS_I':
> fs/f2fs/f2fs.h:1122:385: note: found mismatched ssa struct pointer types: 'struct f2fs_inode_info' and 'struct inode'
This is actually from the randstruct plugin, not native gcc. I'll go
update the message reporting to include a "randstruct: " which should
make this more obvious.
> This seems to happen for all structures that have a zero offset
> between the member and the container structure, i.e. idential
> pointers.
>
> Reverting to an intermediate pointer avoids the warning, and using
> a void pointer instead of the target type should also avoid
> regressing on the previous patch again.
>
> Fixes: mmotm ("kernel.h: handle pointers to arrays better in container_of()")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Thanks!
I'll take this into the kspp tree so all the fixes are in the same place.
-Kees
--
Kees Cook
Pixel Security
Powered by blists - more mailing lists