Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp564351pxb; Thu, 15 Apr 2021 00:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzofv7DTFQaCySIocn1B6zFGGlpdxGeLG6utRgYWjmUtt3ND3pQT8fSlrObg5DXgCRVhNX X-Received: by 2002:a17:90a:bb13:: with SMTP id u19mr2434335pjr.96.1618473334025; Thu, 15 Apr 2021 00:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618473334; cv=none; d=google.com; s=arc-20160816; b=CRybAL4mr8dVDHeM97CC/XedI5erC/h4gGh5cMUwbz4UcCo5oF6suCoRTJlavu6ahX QrGDh3t+mp+XNK+Paf/29HxFN4GUs3I4925IIkrOpCbJABSmc1uMEBv+DllvWWRlLG2p pXL6aQff8pXKvueZv/K7GGnoxPGGakR53zWFOAJlxcDB2nyD3okO5qkWJQvc+v/54NG+ 2HN4wyeD/U6VgIpRrLn1oEhsnBRn4rgAwRPjL3KbA4HBgavW61rtzySNZ2PKwcv3hwpJ T3wqXxwd1gwPxGVfC+L64J6haAU98P+F0ILVsolXoYrC35r1XC1lJlsMGEsLH7m3VvCB HK0Q== 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=fQSaKqfHXsydzEO757KlFYiV/nEVO1igCa5PgxiPGBo=; b=Hi9FnhutUxly/I/MXS5FtkcJmlafzxzHW2z1OYTI2EiQgXTb7sDnGsEYvizcuiUOAr wb3GcqC7BP6ouQ3TPoZHhz86DC9afoBPSg53EBcD6oEPN9Es9DG8WVwPCtGpC6W15E/K eCzrex/80e+FPWnt64pEA0nYv33wj+XdYQBcxkIXZefUIsHsKG6F1cOrBh301JjGMrRr 6hL3Q7DohfvsLeXgUMim/HQQeolqypNYnvCg8S/55DgajS+taUSKj2A+8Dq1xiFOmRTd dPJBobNBqNvWV18GPvn6q4AE2My6iNgqJckoKHjEwYb6iqK2X6z4DDhZwZuvLoQaC1ku 19aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pnJGXgH2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x126si2445144pgx.252.2021.04.15.00.55.20; Thu, 15 Apr 2021 00:55:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=pnJGXgH2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231483AbhDOHyz (ORCPT + 99 others); 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.