linux-stable/drivers/interconnect
Sami Tolvanen 4f0f586bf0 treewide: Change list_sort to use const pointers
list_sort() internally casts the comparison function passed to it
to a different type with constant struct list_head pointers, and
uses this pointer to call the functions, which trips indirect call
Control-Flow Integrity (CFI) checking.

Instead of removing the consts, this change defines the
list_cmp_func_t type and changes the comparison function types of
all list_sort() callers to use const pointers, thus avoiding type
mismatches.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210408182843.1754385-10-samitolvanen@google.com
2021-04-08 16:04:22 -07:00
..
imx interconnect: imx8mq: Use icc_sync_state 2020-12-28 14:03:02 +02:00
qcom treewide: Change list_sort to use const pointers 2021-04-08 16:04:22 -07:00
samsung interconnect: Add generic interconnect driver for Exynos SoCs 2020-11-30 17:26:22 +02:00
bulk.c interconnect: Fix kerneldoc warning 2021-03-18 23:46:21 +02:00
core.c interconnect: core: fix error return code of icc_link_destroy() 2021-03-08 15:09:15 +02:00
internal.h interconnect: Add helpers for enabling/disabling a path 2020-05-10 18:30:37 +03:00
Kconfig interconnect: Add generic interconnect driver for Exynos SoCs 2020-11-30 17:26:22 +02:00
Makefile interconnect: Add generic interconnect driver for Exynos SoCs 2020-11-30 17:26:22 +02:00
trace.h interconnect: Add basic tracepoints 2019-12-16 09:25:23 +02:00