Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2640758rwb; Mon, 7 Aug 2023 00:28:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQDCpsjmBpOCdI9NX+e2i+fOibn6SSXL0yQp+8UD3B8v626+FKuv1pIZCXlIvckjOYIcDO X-Received: by 2002:a17:902:ba8c:b0:1bc:6860:2e5e with SMTP id k12-20020a170902ba8c00b001bc68602e5emr526226pls.26.1691393296549; Mon, 07 Aug 2023 00:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691393296; cv=none; d=google.com; s=arc-20160816; b=LPgQ7AqNV2awUSyRsroyAVVdEno9DeXxe9QVJ3alMj3yxOBVtjvc3RyICj+t/udBs5 vcXpjvDxfaVIZxdme2n7kUn6Pu5gnOfS7weJ+WMnLxoCmVKrhn6LmyB78oF7r5lvBtRk 1zh4wZdgVgFOudYu0xjYjzlZRuij8FDgFFOIa3JWyl6zoqtOgCqhMiiFYunBU9Zkb68L o3/pVYJs2eUqMc0qNTxzBEB798UHx2ybpwNTQkb3q6DrVAXU5SJDDJf/B9Xk+DWV1zyC BrF/I7oujvHgguNQEIaxjqUIsCy52wQqhYpMl+ZP53FyYH+EUegyJyGy2nItwhUmT32k xGHQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1yYYWpBIeVUvblXBfBrS3a8Gs8xexffRfmI8IfwUaR4=; fh=P+B/KNNHaAJrLfH6Gb8tjzR0syD5+//u6oDfTXTa4U0=; b=PLi0e5JRJXlr9xAtuiU6mz2bMwCUoUuZpXrQr3bIHSKd8vilFrrYLBZD7wqrBor/r0 naOWSMHhsP/wgkA5gyUe7WbtB6jlx29piTzyG5yASk2NMlrZGGjVv9Z1dBNxYNDsp5LC ej1fZlcUDFIWiptUkEgXb0EUjq/J1sz/r4S5Opd4BadP9Crm1Rvxgzn2mV73wu9ua5Jw Aggy0shKQtpqq3jmEruzTXG7McSa74tQqU50Jn0nH7gcH2q/7YxSB5vJXTgBPInjX0fR MiX5pihMmol7HNf9KEyi7UxoqebR6tnohIiiXi4A4SHKn4sPzfsc8nUlmoNNp77cjRdB Zuvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pdNQrp4B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t1-20020a170902bc4100b001bc079974dbsi5273152plz.355.2023.08.07.00.28.04; Mon, 07 Aug 2023 00:28:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pdNQrp4B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231268AbjHGGrN (ORCPT + 99 others); Mon, 7 Aug 2023 02:47:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230108AbjHGGrK (ORCPT ); Mon, 7 Aug 2023 02:47:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A66FD1A4; Sun, 6 Aug 2023 23:47:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4463761563; Mon, 7 Aug 2023 06:47:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F3A9C433C7; Mon, 7 Aug 2023 06:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691390828; bh=1jCsoWdlJTQsQF5IZ+gzdQAhBlUO6GA0wb8Hp3Tpm2M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pdNQrp4B3s23/8MXLecBvUwKr11RDoNkw+A8dWesq8YLdLe2VN7yXzb+3UgkJqak1 VzzZHLXonZ5s9m3OATYR/eKxHSeULfMwkOcJ6sHXu/bhV0zAdbtbtDD4tYN0Q+jaJL M3WOIbagKcjn/NDg2t1jRWutVtrMRgIC/feHCJ7E= Date: Mon, 7 Aug 2023 08:47:05 +0200 From: Greg Kroah-Hartman To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Huang Rui , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Jannik Glueckert , Bagas Sanjaya , Linux LLVM Build Support , Nick Desaulniers , Nathan Chancellor , stable@vger.kernel.org Subject: Re: [PATCH] cpufreq: amd-pstate: fix global sysfs attribute type Message-ID: <2023080748-apprehend-carnation-e71c@gregkh> References: <20230807-amd-pstate-cfi-v1-1-0263daa13bc3@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230807-amd-pstate-cfi-v1-1-0263daa13bc3@weissschuh.net> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Mon, Aug 07, 2023 at 08:37:45AM +0200, Thomas Wei?schuh wrote: > In commit 3666062b87ec ("cpufreq: amd-pstate: move to use bus_get_dev_root()") > the "amd_pstate" attributes where moved from a dedicated kobject to the > cpu root kobject. > While the dedicated kobject expects to contain kobj_attributes the root > kobject needs device_attributes. > > As the changed arguments are not used by the callbacks it works most of > the time. > However CFI will detect this issue: > > [ 4947.849350] CFI failure at dev_attr_show+0x24/0x60 (target: show_status+0x0/0x70; expected type: 0x8651b1de) > ... > [ 4947.849409] Call Trace: > [ 4947.849410] > [ 4947.849411] ? __warn+0xcf/0x1c0 > [ 4947.849414] ? dev_attr_show+0x24/0x60 > [ 4947.849415] ? report_cfi_failure+0x4e/0x60 > [ 4947.849417] ? handle_cfi_failure+0x14c/0x1d0 > [ 4947.849419] ? __cfi_show_status+0x10/0x10 > [ 4947.849420] ? handle_bug+0x4f/0x90 > [ 4947.849421] ? exc_invalid_op+0x1a/0x60 > [ 4947.849422] ? asm_exc_invalid_op+0x1a/0x20 > [ 4947.849424] ? __cfi_show_status+0x10/0x10 > [ 4947.849425] ? dev_attr_show+0x24/0x60 > [ 4947.849426] sysfs_kf_seq_show+0xa6/0x110 > [ 4947.849433] seq_read_iter+0x16c/0x4b0 > [ 4947.849436] vfs_read+0x272/0x2d0 > [ 4947.849438] ksys_read+0x72/0xe0 > [ 4947.849439] do_syscall_64+0x76/0xb0 > [ 4947.849440] ? do_user_addr_fault+0x252/0x650 > [ 4947.849442] ? exc_page_fault+0x7a/0x1b0 > [ 4947.849443] entry_SYSCALL_64_after_hwframe+0x72/0xdc > > Reported-by: Jannik Gl?ckert > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217765 > Link: https://lore.kernel.org/lkml/c7f1bf9b-b183-bf6e-1cbb-d43f72494083@gmail.com/ > Fixes: 3666062b87ec ("cpufreq: amd-pstate: move to use bus_get_dev_root()") > Cc: stable@vger.kernel.org > Signed-off-by: Thomas Wei?schuh > --- > Note: > > This was not tested with CFI as I don't have the toolchain available. > Jannik, could you give it a spin? Ah, that was fast, nice! Reviewed-by: Greg Kroah-Hartman