Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp210499pxf; Wed, 24 Mar 2021 03:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhl/sTLbJUFMTADWhM8HAEYWHZ0qECt8gBGWfpAey9qv1vFYSsKTexUO2+uDr4/Sgl5qAz X-Received: by 2002:a05:6402:1517:: with SMTP id f23mr2691934edw.272.1616581083300; Wed, 24 Mar 2021 03:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616581083; cv=none; d=google.com; s=arc-20160816; b=ZQy0+zA++psJOxvjJmc0s2Le6UnsAUVTdHaivcrwFdEJZjua3Mz3DT5fSsnoNqtUfs TjLXfG962RuK6LRwQo6lHa7GbwWgBFJcpQuv0dcoiypsMSAhbVQafIWRQFnnidPAAoM1 RLO7/hXEuWfetMEPVbti+22sjyazR+ZJOkreaxI5K2YgsvwCFe3KVi0BhIhKkDcug0Wb cAKVGK5n4aqck2WzKVJf3TUGifbZXVX1Fh+nAsAfXnYFFdXYdYZL9iSbRM3MGrEwjEUu /NGPwEacVAhP7mw/E6AkpOkGMJNiRHG0rU5xIQvrGTQUZVqWHwkeSvbqSNObCfsTKYSP /gyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=54Qbh71jGibI/QTbfGG9/h5IL8C6wSLI2XHKlvis0eI=; b=oLV0Fl5TGR3k95h1mOIrzAhcci+YBFivJUgSYGhZiXnIzg39ELlObbcPkJFSS9u8XA aGe3OOpcIZRKb4xSz0y5m/hp6q6hOvSb/bjQW6iPjEtQttD6+gEMidJ2PBeVfHMdhmRf b3hfksGVkoo8EZ8wMbpGCOb5hh8sYEEvlSRYk9DxzjC2+WI/3fZm7ucVr0Bf17o8XqxB C1Lul5puMm90lBzG0JuSZQY5S3OToSAIlRqSlKjxvYz6zrqvI/merZwik0Krjv6ZPk3z sE5kP1g088tOOmXRUJovN39xPLGrrZbvAuarnrJFLlfbW3hM3cQ7AW+49NIbiuUWWeVk dI+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gFRvzRpN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si28si1399028ejb.106.2021.03.24.03.17.39; Wed, 24 Mar 2021 03:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gFRvzRpN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235729AbhCXHMk (ORCPT + 99 others); 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-kernel@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