[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210324071008.GA2639075@infradead.org>
Date: Wed, 24 Mar 2021 07:10:08 +0000
From: Christoph Hellwig <hch@...radead.org>
To: Sami Tolvanen <samitolvanen@...gle.com>
Cc: Kees Cook <keescook@...omium.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Masahiro Yamada <masahiroy@...nel.org>,
Will Deacon <will@...nel.org>, Jessica Yu <jeyu@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Tejun Heo <tj@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Christoph Hellwig <hch@...radead.org>,
Peter Zijlstra <peterz@...radead.org>, bpf@...r.kernel.org,
linux-hardening@...r.kernel.org, linux-arch@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kbuild@...r.kernel.org,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 09/17] treewide: Change list_sort to use const pointers
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 <ndesaulniers@...gle.com>
> Signed-off-by: Sami Tolvanen <samitolvanen@...gle.com>
Looks good:
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists