Thread (35 messages) 35 messages, 8 authors, 2021-03-29

Re: [PATCH v3 09/17] treewide: Change list_sort to use const pointers

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-03-24 07:13:15
Also in: bpf, linux-arch, linux-hardening, linux-kbuild, linux-pci, lkml

On Tue, Mar 23, 2021 at 01:39:38PM -0700, Sami Tolvanen wrote:
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 <redacted>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help