[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gw_KZS0ZrWP1rwnrxbUjNJbb-KtgChqutDyYkUZVAMQQ@mail.gmail.com>
Date: Thu, 21 Apr 2022 20:15:22 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Kees Cook <keescook@...omium.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Linux PM <linux-pm@...r.kernel.org>,
Joao Moreira <joao@...rdrivepizza.com>,
Stable <stable@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Chuansheng Liu <chuansheng.liu@...el.com>,
Jiasheng Jiang <jiasheng@...as.ac.cn>,
Sumeet Pawnikar <sumeet.r.pawnikar@...el.com>,
Matthew Garrett <mjg59@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] thermal: int340x: Fix attr.show callback prototype
On Thu, Apr 21, 2022 at 6:55 PM Kees Cook <keescook@...omium.org> wrote:
>
> 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.
>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
> Cc: Amit Kucheria <amitk@...nel.org>
> Cc: Zhang Rui <rui.zhang@...el.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
> Cc: linux-pm@...r.kernel.org
> Reported-and-tested-by: Joao Moreira <joao@...rdrivepizza.com>
> Link: https://lore.kernel.org/lkml/067ce8bd4c3968054509831fa2347f4f@overdrivepizza.com/
> Fixes: 006f006f1e5c ("thermal/int340x_thermal: Export OEM vendor variables")
> Cc: stable@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.org>
Applied as 5.18-rc material, thanks!
> ---
> drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index 4954800b9850..d97f496bab9b 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -68,7 +68,7 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv);
> 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,
> @@ -311,7 +311,7 @@ static int int3400_thermal_get_uuids(struct int3400_thermal_priv *priv)
> 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;
> --
> 2.32.0
>
Powered by blists - more mailing lists