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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2368C4332F for ; Wed, 2 Nov 2022 22:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=qrvyBu09rzbc081FDeeCiyrGXFGwgNkxqxkLwPQa9cc=; b=Zq2sqVkItazM25 b/fiav6LOW7QGasWLjthURn/8VwTqEpCCuwAemBq1KmC+hcm14q1UtiBm1b1pSejk6+/NjVKSYXf4 RXegy4ghfTa/8GDWL8kb8MFXeQDGEr+Yt9NPPb/9imXsnN1H0bmjeihGl45X8HNzSHVkYQpPsZkqr qSSv21F/I4z9dgwxap8veuHWBURcM6ZADiUXO2PT5XOeUh4bpuCWaNZ6Y1lZRG2fPIJmkx++36Q62 Kgzxc/DQOawKEwOIdYTxWtxZc65cnKVNNCh4/sy31axwiIJ+0NiAJMNMOCHNi58KwFVjMKPMo9yP1 WUU/rxJSlwN8tZxFpmgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqLoy-00EdKW-7V; Wed, 02 Nov 2022 22:02:52 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqLov-00EdJC-CD for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 22:02:50 +0000 Received: by mail-pj1-x1030.google.com with SMTP id h14so17503701pjv.4 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=0x1HFdXGOuAuLBG5prLOGSJdODVvhaP/0CqRHez05t2K1wUHeMvFjv88GCetGQWMed Sx67fwLBQKxPj+nG0TzJ6F55QRuedd7C7xnq1yHUwqPR1nXocKqZUsU9srMZTRoUm/FZ zVQftOMkKrTPJCB408A2UijaxDvEpq9ukLTkgvmU7LGmVvkJkjXecjDzIveiPzxxoHE6 PJbU1BxQR+k0J72duwXuaHcppGAexvmLDp5Gd4Phwln6dwJdULPSmciipIjR/db+8ngd C2iuXteV/jsDeKoJ+2kdoN9mwoGipvbvzZxKjd36S1bupNrjqJB9PytKiFjOJn1v5R3A 68mw== X-Gm-Message-State: ACrzQf3fVElSqVij3wzvnURX1VYp7KZ3YJiIG4QhOEp4bRt92R5UHeZj K3wauLFQMmn5V33tDTw3zuybcA== X-Google-Smtp-Source: AMsMyM4WkfzMykXnG15VA0dkbaFs2pJjZSHDWxSbgybvMUsbX2OvhgJaXXTBVFr7hoOw8Zjy6TVn2g== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_150249_671280_7C04B809 X-CRM114-Status: GOOD ( 14.96 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel