Skip to content

Commit d0f6cfb

Browse files
keesrafaeljw
authored andcommitted
thermal: int340x: Fix attr.show callback prototype
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 <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Fixes: 006f006 ("thermal/int340x_thermal: Export OEM vendor variables") Cc: 5.8+ <[email protected]> # 5.8+ Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b2d229d commit d0f6cfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv);
6868
struct odvp_attr {
6969
int odvp;
7070
struct int3400_thermal_priv *priv;
71-
struct kobj_attribute attr;
71+
struct device_attribute attr;
7272
};
7373

7474
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)
311311
return result;
312312
}
313313

314-
static ssize_t odvp_show(struct kobject *kobj, struct kobj_attribute *attr,
314+
static ssize_t odvp_show(struct device *dev, struct device_attribute *attr,
315315
char *buf)
316316
{
317317
struct odvp_attr *odvp_attr;

0 commit comments

Comments
 (0)