]> git.ipfire.org Git - thirdparty/linux.git/commit
firmware: arm_ffa: Fix memory corruption in ffa_msg_send2()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 24 Apr 2024 11:40:43 +0000 (14:40 +0300)
committerSudeep Holla <sudeep.holla@arm.com>
Wed, 24 Apr 2024 13:19:45 +0000 (14:19 +0100)
commitddfade88f49d49b04930ae006ab0974eb547529c
tree1ae5cfb2ec17930cb19e6cd4891d0d57cad09b00
parent02c19d84c7c5026624d181b8e4cdc8488134d013
firmware: arm_ffa: Fix memory corruption in ffa_msg_send2()

The "msg" pointer is a struct and msg->offset is the sizeof(*msg).  The
pointer here math means the memcpy() will write outside the bounds.
Cast "msg" to a u8 pointer to fix this.

Fixes: 02c19d84c7c5 ("firmware: arm_ffa: Add support for FFA_MSG_SEND2")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/cd5fb6b5-81fa-4a6d-b2b8-284ca704bbff@moroto.mountain
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_ffa/driver.c