Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp591455rwi; Wed, 2 Nov 2022 15:53:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7cuY+TirjN2hJZFrXiUWaZI8QMAdgUuTzWJNAqW7gfzjGRNTH1x8zFKi2MnakMbiNENjUt X-Received: by 2002:a17:90a:4b05:b0:213:ead5:92ee with SMTP id g5-20020a17090a4b0500b00213ead592eemr17224291pjh.117.1667429632110; Wed, 02 Nov 2022 15:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667429632; cv=none; d=google.com; s=arc-20160816; b=GkobDGE/mRwuK0aN2U8r4gfeRQprLwUQH1FyVhlr5o8DPdCSBr6KPiNoy/s/F10kP7 6Dy5hUbf26FJ8P9mR5jmaYhs81qUrQLuLssM3zH4ToJFIkaL8NxRES8XaS2szbAZGAi/ lsMeGWLNhEuyZfkKG5s9AK+eRCO+gx4wK0tifeySBMcOr+DBXhooZS6itSHqwOSoClzK d5zRBiwGzWaq8hOfZwDdosqTu9aGDYIWB+sWA3BrzxOGyB1SxrdJl4vgsAoTkreaUJ/A RTcVtZUVDr0OtNWGnSWaWAKL3gisDhrG2356SNzs9q3JsHseJ+oT7gn9ADaEltwxl6sK Mmhw== 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=tDdQ76HTuetM+x0U50OZVmoiEGjK/pNJ2DGCTRImjr8=; b=zY9jVogq6caSfwrPqkmnMd/gzw+5SJAYbaXEZSxmWOtFJmY/rH3AzRnnR5XVE08lai mvo9/PM9UU8outzRHyGEOhIBNakWfIif7S88e4tgt6EQlbVSBhRFc4qTRT/2MebNRItE JxL7mUF3KkaT7ffmr7z9bw1FRnloORmQWxNnBALGoWn5Rn/L07S3HCaZLZTqumkHPSIC /qbwYf75mO1KbZa8wv+On4IAFRaWk/4nNUdGNUS4ouf5uZ61ZoKc+M/2BIafvUE7JpRk R98XVJPYpaQhtJ2LsFUrBnACYbfqSpeAKvNLwSGK2/QBEwnE2ulsSTKuNu92BAsgbPVd ha/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KQiJkZte; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u22-20020a056a00159600b0056c72071d3esi19700712pfk.235.2022.11.02.15.53.39; Wed, 02 Nov 2022 15:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KQiJkZte; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbiKBWCu (ORCPT + 97 others); Wed, 2 Nov 2022 18:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbiKBWCr (ORCPT ); Wed, 2 Nov 2022 18:02:47 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FD6A9FDC for ; Wed, 2 Nov 2022 15:02:46 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id k5so9947174pjo.5 for ; Wed, 02 Nov 2022 15:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tDdQ76HTuetM+x0U50OZVmoiEGjK/pNJ2DGCTRImjr8=; b=KQiJkZtePhI2flEsUJPvJWcVFKJ+OroKKLIqrw7gi+MX+q2049MD3JdT/HnYDFu9WR zLFsSCKGQMStyQIn1lzgksLz8eM0HdHrRUXnS3XiBPbgf+cvVwhSqUXkg1CPQQjS8peH VqixHIIJaqwe+pLijCFPO7sKai856yU/ibvqI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tDdQ76HTuetM+x0U50OZVmoiEGjK/pNJ2DGCTRImjr8=; b=O0ZQx7qHy2tSB0xn+fo+8TC3N7VS7tpa70Hy4z/FH1rhqew83FrnfoE9zqr3Jbde7z /GbWPjhb0NuQlMuocyh8DJtTOePPkzdm8/9NZTzAZu47xUj+VfTDgiOnZJoRMuQXrbsw 11z3hhYrXzsChUQ/AVnw70AGrSQcSWiCwy+O2KqW2aanVxyvJz/qs+cijV2HCzv2vBBI kDXE/la3hzZY4NikYyfUWTgEcCyFafUYpHGVrLIBAUoqmqR2fQw5kGUq2pHFP+tUafU1 ecE3enqdG3TR4YbJQMElceWp03yQqadLTgiS9iwpjS9bZAmqe25cQQ8UfgcRFYc1PKMn SaHw== X-Gm-Message-State: ACrzQf3RPGX5wUi/4t3kC463lfa8BHlklvcNwjMLAD3tOyRVj8R+xZ7X /9uWbbaEAAln3T6lrnTwKd8UGFUfEO5uTg== X-Received: by 2002:a17:90b:1095:b0:213:ee6a:f268 with SMTP id gj21-20020a17090b109500b00213ee6af268mr16266724pjb.213.1667426566071; Wed, 02 Nov 2022 15:02:46 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a20-20020a621a14000000b0056c6e59fb69sm8926019pfa.83.2022.11.02.15.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 15:02:45 -0700 (PDT) Date: Wed, 2 Nov 2022 15:02:44 -0700 From: Kees Cook To: Nathan Chancellor Cc: William Breathitt Gray , linux-iio@vger.kernel.org, Nick Desaulniers , Tom Rix , Sami Tolvanen , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Patrick Havelange , Jarkko Nikula , Oleksij Rempel , Pengutronix Kernel Team , Fabrice Gasnier , Vignesh Raghavendra , Julien Panis , David Lechner , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-omap@vger.kernel.org Subject: Re: [PATCH 1/4] counter: Adjust final parameter type in function and signal callbacks Message-ID: <202211021501.88D8147@keescook> References: <20221102172217.2860740-1-nathan@kernel.org> <202211021216.FF49E84C69@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 02, 2022 at 01:23:51PM -0700, Nathan Chancellor wrote: > Right, I am not the biggest fan of this change myself and it is entirely > possible that I am misreading the warnings from the commit message but I > do not see how > > comp_node.comp.signal_u32_read = counter->ops->signal_read; > > and > > comp_node.comp.count_u32_read = counter->ops->function_read; > > in counter_add_watch(), > > comp.signal_u32_read = counter->ops->signal_read; > > in counter_signal_attrs_create(), and > > comp.count_u32_read = counter->ops->function_read; > comp.count_u32_write = counter->ops->function_write; > > in counter_count_attrs_create() are currently safe under kCFI, since the > final parameter type of the prototypes in 'struct counter_ops' does not > match the final parameter type of the prototypes in 'struct > counter_comp'. I would expect the indirect calls in counter_get_data() > and counter_comp_u32_show() to fail currently. Ah! Thank you -- those were the places I couldn't find. -- Kees Cook