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 783FEC4332F for ; Wed, 2 Nov 2022 19:22:28 +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=C68eCJP0guUGXotcd3GBrxJECcYDFq+W1x3jt81ickc=; b=vH9wG2nlWSwV78 HcM9yaO8WrSlYmTfVMcAA7oWzRc6lvFNu1BF9zOiq7i+fqTTyY+NJbBBRuCEohHmE/YyVTGQU0+Qo B/e8BjlkrcDxD3Jx/+IWQQlq8jpuqQA+Mz3baPFTV5E94P8Lv3lKzCiGknsX+HcCc9+wrc923ZfZG QfGsGV74cmbKv6ZyXHkL46g31s+6irRgqm2MBqJ25+ctIu3XOunRX0SthFL4Ggowy+GsRum3I0m9D ilYW+BbbggLBws0TUFQUoEcod0j2BAC2Y2bIYz+nmblqgsCCO+mp/VahvbOlJOSANzOgkyhIYCaG9 QnOIcLTYcr6j3Y+U0C8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqJIo-00Dh2Q-Oc; Wed, 02 Nov 2022 19:21:30 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqJIl-00Dgwr-NT for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 19:21:29 +0000 Received: by mail-pf1-x433.google.com with SMTP id 130so17294025pfu.8 for ; Wed, 02 Nov 2022 12:21:25 -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=B8Kb3FDF2ltCser6k2Boeu2/HvGG8fHolSWZaqKpuWo=; b=fCn72FEK7JqsX/hjTC/1QNdSlH+bbHzR/GBepixStWXFturm+bTiBoBMndtGCZnb5M XsraYqE4sBX2oDxyjcP35OrO6FQDiukWe1SSPop+KaAnoJgDPAy/i9zrWuLR4Ta6mVxW 84EA7ip0h1VgQ0i6pTx8biZigeWK/OyGC6HfA= 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=B8Kb3FDF2ltCser6k2Boeu2/HvGG8fHolSWZaqKpuWo=; b=YTBD9jpfRDoFrPVlQIVdFfQ4GmzpiowKnh2ylqj5SwrtYRHLIMJM7SaFtkSA5qs3EH GrVN93+Evc9t7pW5OWI5p+uPz1MINdyJfHUEPWkutdiLYh6TKsyLU+DT+oSw6g/CICef EE9J2G7iaJzHZw3sdPyOmZEI3TES1E/cxkjNzabAtOpJHfFcw8Um55iapW5h/H68d1jg M2ZCRNghUFZfbIayMqkf5lpZn3yw8obSYmUzC7RD7KKzfiGupVjbD+DzjyH0wV+rwKKm XqIX/C1/jA/3tTeXaXyhP+x1Fz31w6MnkiPTAej0harCVbOQiPCawLJxgd5mN66VSYPo Efjg== X-Gm-Message-State: ACrzQf2FN3AG4NAdIWOXiKHzDX5/8KHGurw8a58gFkmfRhVDYs9K89jq VzumfHHYsNsXVrW/ofXqqYHSeg== X-Google-Smtp-Source: AMsMyM7YtHQImySKSXB+BJJLch8eWsN4QnSQHsUF3i5EKgm8DFqzAM89xVOPYsJc4pOM1Kic66vX+A== X-Received: by 2002:a63:d845:0:b0:44b:d074:97d with SMTP id k5-20020a63d845000000b0044bd074097dmr23393938pgj.32.1667416884681; Wed, 02 Nov 2022 12:21:24 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k28-20020aa7999c000000b0056bfebfa6e4sm8733255pfh.190.2022.11.02.12.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 12:21:24 -0700 (PDT) Date: Wed, 2 Nov 2022 12:21:23 -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: <202211021216.FF49E84C69@keescook> References: <20221102172217.2860740-1-nathan@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221102172217.2860740-1-nathan@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_122127_823618_C42E6D8C X-CRM114-Status: GOOD ( 15.58 ) 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 10:22:14AM -0700, Nathan Chancellor wrote: > The ->signal_u32_read(), ->count_u32_read(), and ->count_u32_write() > callbacks in 'struct counter_comp' expect the final parameter to have a > type of 'u32' or 'u32 *' but the ops functions that are being assigned > to those callbacks have an enumerated type as the final parameter. While > these are compatible from an ABI perspective, they will fail the > aforementioned CFI checks. > > Adjust the type of the final parameter in the ->signal_read(), > ->function_read(), and ->function_write() callbacks in 'struct > counter_ops' and their implementations to match the prototypes in > 'struct counter_comp' to clear up these warnings and CFI failures. I don't understand these changes. Where do 'struct counter_comp' and 'struct counter_ops' get confused? I can only find matching ops/assignments/calls, so I must be missing something. This looks like a loss of CFI granularity instead of having wrappers added if there is an enum/u32 conversion needed somewhere. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel