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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 8007CC433B4 for ; Thu, 15 Apr 2021 07:54:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 610E360FF1 for ; Thu, 15 Apr 2021 07:54:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbhDOHyz (ORCPT ); Thu, 15 Apr 2021 03:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbhDOHyy (ORCPT ); Thu, 15 Apr 2021 03:54:54 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21F02C061574 for ; Thu, 15 Apr 2021 00:54:32 -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=fQSaKqfHXsydzEO757KlFYiV/nEVO1igCa5PgxiPGBo=; b=pnJGXgH2l6VGfPpcE0duoO0Djk xxGrqle3mNplxviVZI+sBSjyytRGga0YpgNX1d/EvTxsKZLKN1GVlQUtGziilflIAeXqAWOEDL5wK rCLatCfDErPUejS1O6fjE07w1PVgqh1rXRgzMWPFCqzppzmwiAXs9VgymSz4MMsxaK4k/It8Hcpmu gQ6sM87GghIRZfCcwUG1I13BolUTVHAh0s/P0pFcq0yWkjKcUt9u7z2KzY1mNlATXHVW+67YORqAd dGHTLUEx/Dw5ibfDMnFifSb8wwZ0FGLf/EhD4y8ywFCRq9FlcM5o4WAZStfPsKRxQcLL19EpyHm1l jB04gz1A==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lWwoh-008FsS-Db; Thu, 15 Apr 2021 07:53:43 +0000 Date: Thu, 15 Apr 2021 08:53:35 +0100 From: Christoph Hellwig To: Nathan Chancellor Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Sami Tolvanen , Kees Cook , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH 1/2] x86/events/amd/iommu: Fix sysfs type mismatch Message-ID: <20210415075335.GA1954964@infradead.org> References: <20210415001112.3024673-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210415001112.3024673-1-nathan@kernel.org> 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 Wed, Apr 14, 2021 at 05:11:11PM -0700, Nathan Chancellor wrote: > dev_attr_show() calls _iommu_event_show() via an indirect call but > _iommu_event_show()'s type does not currently match the type of the > show() member in 'struct device_attribute', resulting in a Control Flow > Integrity violation. While the fix looks fine I think we need to solve this kind of problem by better type checking. The fact that we can use the wong type here without a compiler warning is the real issue.