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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0404DC433F5 for ; Wed, 20 Apr 2022 22:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382831AbiDTWbQ (ORCPT ); Wed, 20 Apr 2022 18:31:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245378AbiDTWbN (ORCPT ); Wed, 20 Apr 2022 18:31:13 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AB141FA2; Wed, 20 Apr 2022 15:28:25 -0700 (PDT) Received: (Authenticated sender: joao@overdrivepizza.com) by mail.gandi.net (Postfix) with ESMTPA id 4514A20002; Wed, 20 Apr 2022 22:28:20 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 20 Apr 2022 15:28:20 -0700 From: Joao Moreira To: Kees Cook Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, peterz@infradead.org, jpoimboe@redhat.com, andrew.cooper3@citrix.com, samitolvanen@google.com, mark.rutland@arm.com, hjl.tools@gmail.com, alyssa.milburn@linux.intel.com, ndesaulniers@google.com, gabriel.gomes@linux.intel.com, rick.p.edgecombe@intel.com Subject: Re: [RFC PATCH 11/11] driver/int3400_thermal: Fix prototype matching In-Reply-To: <202204191946.2843CF71@keescook> References: <20220420004241.2093-1-joao@overdrivepizza.com> <20220420004241.2093-12-joao@overdrivepizza.com> <202204191946.2843CF71@keescook> Message-ID: <06435f0b44681588052d145a17d60316@overdrivepizza.com> X-Sender: joao@overdrivepizza.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Where/why is the mismatch happening? Mismatch happens in dev_attr_show from drivers/base/core.c. There, kobject * is cast to device * before the call, probably because attr is also cast to device_attribute, which may have a mismatching hook prototype, I guess. I haven't tried it with any other CFI scheme other than my own implementation and I did not run this on GDB or anything... I'm just reporting based on the violation that FineIBT logged and in the fact that this patch fixed it, so I'm unsure if there is anything buried here.