From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 318F1C433E3 for ; Wed, 24 Mar 2021 07:13:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43A8661A0A for ; Wed, 24 Mar 2021 07:13:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235727AbhCXHMk (ORCPT ); Wed, 24 Mar 2021 03:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235733AbhCXHML (ORCPT ); Wed, 24 Mar 2021 03:12:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE0DC061763; Wed, 24 Mar 2021 00:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=54Qbh71jGibI/QTbfGG9/h5IL8C6wSLI2XHKlvis0eI=; b=gFRvzRpNXls/yy7upHczWVYAMN tOtlIgTyynn1qKZJTjKZf7gLY/ai8EAbFpatb1GSNXmIX9TGJBw0FFq8ULfEhfTXJRshV44Ji6SDD xmEdnsDTyOuEmKufKDbbEo/NztEPcL4cE4o1F3drnw0lpu9lIn4F1Fo2lheZpicyMkZRpCdezVpc7 R8ofDGz02Gbr6vVvgyHnT+/ODApGr/cWel/pFRc8o2BxNO3lvyfpHg9f8M2vmfdne64d5LRlHpquw nv3mMqN6vB2BSdEdR3oRlhsY771qgeKMtDHEqjKzzRzLpTtnwEo4HhZ0dBbzAidV8ejNIq/gjWEXx beublnGw==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lOxea-00B4xp-Ks; Wed, 24 Mar 2021 07:10:18 +0000 Date: Wed, 24 Mar 2021 07:10:08 +0000 From: Christoph Hellwig To: Sami Tolvanen Cc: Kees Cook , Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , Peter Zijlstra , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 09/17] treewide: Change list_sort to use const pointers Message-ID: <20210324071008.GA2639075@infradead.org> References: <20210323203946.2159693-1-samitolvanen@google.com> <20210323203946.2159693-10-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323203946.2159693-10-samitolvanen@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 > Signed-off-by: Sami Tolvanen Looks good: Reviewed-by: Christoph Hellwig