5 Commits

Author SHA1 Message Date
Sami Tolvanen
8c25f26ead ANDROID: cfi: remove unnecessary <asm/memory.h> include
This change makes it possible to compile CFI for x86, which doesn't
provide this header file.

Bug: 145297900
Change-Id: I60ad190bb0c2296b67eef2194b72f381e7f94e2c
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2020-04-30 10:08:09 -07:00
Nathan Chancellor
7b98aa6fd8 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-04-09 11:30:45 -07:00
Sami Tolvanen
ca20dbf407 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:07:52 -08:00
Sami Tolvanen
83a9a284eb cfi: print target address on failure
Bug: 78862212
Bug: 67506682
Change-Id: Ifaa3e3f8fc5f19649f4857d185d50383b4a89055
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2018-05-01 08:26:47 -07:00
Sami Tolvanen
d590fd127d ANDROID: 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-04-26 16:03:37 -07:00