Skip to content

Commit 0a5e695

Browse files
author
Sudeep Holla
committed
firmware: arm_ffa: Check for NULL FF-A ID table while driver registration
The bus match callback assumes that every FF-A driver provides an id_table and dereferences it unconditionally. Enforce that contract at registration time so a buggy client driver cannot crash the bus during match. Fixes: 9274307 ("firmware: arm_ffa: Ensure drivers provide a probe function") Link: https://patch.msgid.link/20260428-ffa_fixes-v2-1-8595ae450034@kernel.org Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
1 parent 254f496 commit 0a5e695

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/firmware/arm_ffa

drivers/firmware/arm_ffa/bus.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ static int ffa_device_match(struct device *dev, const struct device_driver *drv)
2626

2727
id_table = to_ffa_driver(drv)->id_table;
2828
ffa_dev = to_ffa_dev(dev);
29+
if (!id_table)
30+
return 0;
2931

3032
while (!uuid_is_null(&id_table->uuid)) {
3133
/*
@@ -123,7 +125,7 @@ int ffa_driver_register(struct ffa_driver *driver, struct module *owner,
123125
{
124126
int ret;
125127

126-
if (!driver->probe)
128+
if (!driver->probe || !driver->id_table)
127129
return -EINVAL;
128130

129131
driver->driver.bus = &ffa_bus_type;

0 commit comments

Comments
 (0)