]> git.baikalelectronics.ru Git - kernel.git/commit
randstruct: Check member structs in is_pure_ops_struct()
authorJoonwon Kang <kjw1627@gmail.com>
Sat, 27 Jul 2019 15:58:41 +0000 (00:58 +0900)
committerKees Cook <keescook@chromium.org>
Wed, 31 Jul 2019 20:13:22 +0000 (13:13 -0700)
commit5896a6ad07e82ccde2b6ded7f48042b67665bf26
tree41cd23407429499f0c3fab1ed59e0cc566254f1a
parent41a187cd24925e8550afd67e1bda36b35bf2bd6a
randstruct: Check member structs in is_pure_ops_struct()

While no uses in the kernel triggered this case, it was possible to have
a false negative where a struct contains other structs which contain only
function pointers because of unreachable code in is_pure_ops_struct().

Signed-off-by: Joonwon Kang <kjw1627@gmail.com>
Link: https://lore.kernel.org/r/20190727155841.GA13586@host
Fixes: deadd073ee1d ("gcc-plugins: Add the randstruct plugin")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
scripts/gcc-plugins/randomize_layout_plugin.c