Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4794237iob; Mon, 9 May 2022 01:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3FtWkbCpsIWEzU9qVQ215ghDzKG+zq8bUwwQeOf7qHxJLplUvpVF2FCWq5iF0MGe9HwUz X-Received: by 2002:a65:6d06:0:b0:3c6:890:5609 with SMTP id bf6-20020a656d06000000b003c608905609mr12301825pgb.357.1652085485977; Mon, 09 May 2022 01:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652085485; cv=none; d=google.com; s=arc-20160816; b=mAV7GnRjILv6Vq0QtiMJSI2aOhe1C8A7cBUvrgdEAw0revsWP8gg/5Ztp4OaSg/Zib GzYsvE5Ppw5uj6h5+otrOhylDlbPrikDSyJNG4kVAO89TSxA896copo/JcaSXzKg1zxN 26Au/UnGfT+G5XQNiiUfSSUp+EPsOy7raA4eSoheoll81tuglQLrAXUYRy1C/Xe3y8BV rIV3UzMFxVnxGWtxGoXCpaCtt8B/R+XNrkcoYzEmdgaFkyxaCgYbaa9nfrh5EBMwaDV8 HJ3JGWv+OsSXUWQhnHloSQtDbkpEEWMVo4pBz0oj+gbahxlP/jADRAQptGI+uMsdxipj /Beg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Er6jsd70gosBfdYuYacRHUDHavmvPel+NseZMdPe6ug=; b=qikFLgnyNEA0s/fcKQqF8G9FJuemosCDd1H2NP0MZqnh9UWsxwcHyl1o9SVHpxeVf5 R4+imyQ/ig3Csn6S1e7SJP0riHxBlHKzuYGEPYzJvztRt8bcK03jpfgLDtEQR6T9PNBw GI/hxrD98p/AtTHIa4LjUP94+zkumHSSmbVtqB4UO3UOdgxccTJdv/xsrOyXhumBFF/l sc1wLj39tVB1HeqHohmYX3YktVJh0fclUdrUN3LEqb9MG3OIBcL57caD1qZF6TjZibsM 9G1f2MW4rV2nN6g4Jt4c2Bizpa97yMDp/JwHtgRXqOX9xO32FqVmfly0N1UcI1/eUwV8 06Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iXY5ZZqD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lr1-20020a17090b4b8100b001bf082ef447si15425126pjb.111.2022.05.09.01.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iXY5ZZqD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B02491A3A6; Mon, 9 May 2022 01:21:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355681AbiEDRIj (ORCPT + 99 others); Wed, 4 May 2022 13:08:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355663AbiEDRAT (ORCPT ); Wed, 4 May 2022 13:00:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA59F4BBB3; Wed, 4 May 2022 09:52:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1E2461701; Wed, 4 May 2022 16:52:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4B75C385A5; Wed, 4 May 2022 16:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683120; bh=UvbEPPP0Phld+EI24rEyUua/Umh4MxaId4S52B0wD58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iXY5ZZqDPTaI8jANtx/IbxaGa4RRqtGNgeAIVVrULlA+FFzj+qW6FGe0TCOSKdt4Y glomw9NFJ2GDWPwMaamCx0WUHiHGn9ag6eihjCbXLSreOh1T2imBZmBRFjubNZnXAT TrleYsJfNTEw7BDMHq5PpU2nbr9vW7JlwUn3/NoU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , "Rafael J. Wysocki" , Joao Moreira Subject: [PATCH 5.10 111/129] thermal: int340x: Fix attr.show callback prototype Date: Wed, 4 May 2022 18:45:03 +0200 Message-Id: <20220504153030.088795829@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook commit d0f6cfb2bd165b0aa307750e07e03420859bd554 upstream. Control Flow Integrity (CFI) instrumentation of the kernel noticed that the caller, dev_attr_show(), and the callback, odvp_show(), did not have matching function prototypes, which would cause a CFI exception to be raised. Correct the prototype by using struct device_attribute instead of struct kobj_attribute. Reported-and-tested-by: Joao Moreira Link: https://lore.kernel.org/lkml/067ce8bd4c3968054509831fa2347f4f@overdrivepizza.com/ Fixes: 006f006f1e5c ("thermal/int340x_thermal: Export OEM vendor variables") Cc: 5.8+ # 5.8+ Signed-off-by: Kees Cook Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -67,7 +67,7 @@ static int evaluate_odvp(struct int3400_ struct odvp_attr { int odvp; struct int3400_thermal_priv *priv; - struct kobj_attribute attr; + struct device_attribute attr; }; static ssize_t data_vault_read(struct file *file, struct kobject *kobj, @@ -269,7 +269,7 @@ static int int3400_thermal_run_osc(acpi_ return result; } -static ssize_t odvp_show(struct kobject *kobj, struct kobj_attribute *attr, +static ssize_t odvp_show(struct device *dev, struct device_attribute *attr, char *buf) { struct odvp_attr *odvp_attr;