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=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 1F549C433C1 for ; Fri, 26 Mar 2021 04:37:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC00E61A3F for ; Fri, 26 Mar 2021 04:37:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC00E61A3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5bogHDX8hieBUQMWZ+skqimQ1ciBEzcrTY7LB0N/J6Y=; b=HSExgiYLroxHgtc9XiTzMqi8V hIZ8YmwKzrkFfGLlN9IAUgYMdkdCPei8djeH4Xz1Z9f5gfuTY2BQDW0RK3VhbYwomn0A6s4WPCHgm jCS3wzHhMJ0hDKKaPRvX7xD62nP4hucgcQq34NOQllU7RSnHlTshSg0WH7D+T2DjGuVjnPRFHIRZK TA5OKx3B7hU5GQHMeGuA+UeXq1zq61Y64QF3NoGe0qAjDjJss+eevlP/24JppyiaEuXMjxjD+o+4x hDSE8g5c87iPUFI0x8iHIrlMe4LZlzJX67uV8xEQDS9KZbaK9RKtJ3SlaX7i112w5HaLnfKr1ULSg jNpoRp5gw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPeC9-002lFK-7Y; Fri, 26 Mar 2021 04:35:37 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPeBz-002lDf-US for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 04:35:32 +0000 Received: by mail-pj1-x1034.google.com with SMTP id q6-20020a17090a4306b02900c42a012202so1869102pjg.5 for ; Thu, 25 Mar 2021 21:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vxhJYqYDEMLCG7mk2hvbmEzicWN7eS/ImmMoA4Wpy9s=; b=Y7C2yx9t4jVJNzzq+bJUag8zcjHDw7vTM3dhGvCOhTUSNJ9rVJAGUyw/R1kV1BKF9h UBZcJlu9jC+zABe5EH5uKqrAMx5g2Si4eSS06uLrUMls5fsYouIWM1mvmNY3BhP1kCgI 7z3GGiGVF/ZfEa0cIMn6Cl6WedLtccFzIZQLc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vxhJYqYDEMLCG7mk2hvbmEzicWN7eS/ImmMoA4Wpy9s=; b=mOEzpYDd5a4vCQUSV5qx3ewMq2krnSX8XlayXgx0+rAL4REUvTimR1z8+zmPakVzKu ZhMCiTR5gwL10hgmahwFaCcI2AUZA5+apHUswqgSLYYlYIMolE6mg63HEkr02PmcsHvh 3x1/ENgRZzKY2id9scioiZ/FGEj0ffktDNGLnQhPUELkdvn68D9GWjQbbEi4uNrYfg3m 8orX82tQlZ+pYokIMg38Fju6f+U4yKZOAB3Ps9Xq2Fx7Osr3w7oTue5yJSt1vGlGCiFa 1DIBR16eCRKQdaK4L5lO3cumGX5gelODj3E1HnjZL0xk3zigZYJbG73iYj6DHLIP/Uui FXkA== X-Gm-Message-State: AOAM5314Sd761FZLRQwR/Sxa0FfVt9VJFB9fIu/1ef5lWPswKHH6nTzF WpuotBMjxrv3Lh804WkqxT4iFQ== X-Google-Smtp-Source: ABdhPJz2QNhFYdHooMpU/mFgIftB2v/X0l9ww3xc4ZF/mkJWRrD/dCONt/yBrv2NakIcxZr0lCtyZQ== X-Received: by 2002:a17:902:d4cb:b029:e5:f608:6d5e with SMTP id o11-20020a170902d4cbb02900e5f6086d5emr13342060plg.20.1616733325756; Thu, 25 Mar 2021 21:35:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u84sm7686856pfc.90.2021.03.25.21.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 21:35:25 -0700 (PDT) Date: Thu, 25 Mar 2021 21:35:24 -0700 From: Kees Cook To: Sami Tolvanen Cc: 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: <202103252135.9B17EFB@keescook> References: <20210323203946.2159693-1-samitolvanen@google.com> <20210323203946.2159693-10-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210323203946.2159693-10-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_043528_113219_D37B91CC X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel