]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
firmware: arm_ffa: Fix the race around setting ffa_dev->properties
authorLevi Yun <yeoreum.yun@arm.com>
Tue, 3 Dec 2024 14:31:08 +0000 (14:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:01:57 +0000 (14:01 +0100)
commit891c43f4f9a8c67fd743eaac1106fec04da2f6c4
treecfba7910cb7be54e7c3c52eff458b00739cf312c
parente385c781a3052b817a23dc22ca103daeeb402f48
firmware: arm_ffa: Fix the race around setting ffa_dev->properties

[ Upstream commit 6fe437cfe2cdc797b03f63b338a13fac96ed6a08 ]

Currently, ffa_dev->properties is set after the ffa_device_register()
call return in ffa_setup_partitions(). This could potentially result in
a race where the partition's properties is accessed while probing
struct ffa_device before it is set.

Update the ffa_device_register() to receive ffa_partition_info so all
the data from the partition information received from the firmware can
be updated into the struct ffa_device before the calling device_register()
in ffa_device_register().

Fixes: e781858488b9 ("firmware: arm_ffa: Add initial FFA bus support for device enumeration")
Signed-off-by: Levi Yun <yeoreum.yun@arm.com>
Message-Id: <20241203143109.1030514-2-yeoreum.yun@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/arm_ffa/bus.c
drivers/firmware/arm_ffa/driver.c
include/linux/arm_ffa.h