Commit graph

4 commits

Author SHA1 Message Date
Nathan Chancellor
3a8e785fdd ANDROID: cfi: Remove unused variable in ptr_to_check_fn
An unused variable will be exposed by a backport of mainline commit
0a5f41767444 ("kbuild: clang: disable unused variable warnings only
when constant").

kernel/cfi.c:231:16: warning: unused variable 'check'
[-Wunused-variable]
        unsigned long check;
                      ^
1 warning generated.

Remove it so there is no more warning.

Change-Id: I05a4c20d2a54790991dc1c88c48d8258c548a8cd
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2019-03-06 18:27:16 +00:00
Sami Tolvanen
046daa57dd ANDROID: cfi: fix shadow rebasing
If the module area base address changes when loading a new module, the
new CFI shadow will only cover the first allocated page for each existing
module. This will cause cross-DSO look-ups to functions elsewhere in the
module to fall back to a red-black tree, which may be slower.

Bug: 122963951
Change-Id: I9262034d39351afcd42590ead8d6384fc30a8ce8
Reported-by: Wu,Le <wule01@baidu.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2019-01-23 15:06:27 -08:00
Sami Tolvanen
1321d42261 cfi: print target address on failure
Bug: 78862212
Bug: 67506682
Change-Id: Ifaa3e3f8fc5f19649f4857d185d50383b4a89055
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-05-01 16:49:34 +00:00
Sami Tolvanen
00a195e7c0 add support for clang Control Flow Integrity (CFI)
This change adds the CONFIG_CFI_CLANG option, CFI error handling,
and a faster look-up table for cross module CFI checks.

Bug: 67506682
Change-Id: Ic009f0a629b552a0eb16e6d89808c7029e91447d
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-02-28 15:09:58 -08:00