Skip to content

Commit aa56d75

Browse files
committed
Merge tag 'ffa-fixes-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes
Arm FF-A fixes for v6.12 Couple of fixes to avoid string-fortify warnings in export_uuid() and memcpy() from the recently added functions to support FFA_MSG_SEND_DIRECT_REQ2 and FFA_MSG_SEND_DIRECT_RESP2. * tag 'ffa-fixes-6.12' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Avoid string-fortify warning caused by memcpy() firmware: arm_ffa: Avoid string-fortify warning in export_uuid() Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 6f54738 + b079883 commit aa56d75

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,16 @@ static int ffa_msg_send_direct_req2(u16 src_id, u16 dst_id, const uuid_t *uuid,
481481
struct ffa_send_direct_data2 *data)
482482
{
483483
u32 src_dst_ids = PACK_TARGET_INFO(src_id, dst_id);
484+
union {
485+
uuid_t uuid;
486+
__le64 regs[2];
487+
} uuid_regs = { .uuid = *uuid };
484488
ffa_value_t ret, args = {
485-
.a0 = FFA_MSG_SEND_DIRECT_REQ2, .a1 = src_dst_ids,
489+
.a0 = FFA_MSG_SEND_DIRECT_REQ2,
490+
.a1 = src_dst_ids,
491+
.a2 = le64_to_cpu(uuid_regs.regs[0]),
492+
.a3 = le64_to_cpu(uuid_regs.regs[1]),
486493
};
487-
488-
export_uuid((u8 *)&args.a2, uuid);
489494
memcpy((void *)&args + offsetof(ffa_value_t, a4), data, sizeof(*data));
490495

491496
invoke_ffa_fn(args, &ret);
@@ -496,7 +501,7 @@ static int ffa_msg_send_direct_req2(u16 src_id, u16 dst_id, const uuid_t *uuid,
496501
return ffa_to_linux_errno((int)ret.a2);
497502

498503
if (ret.a0 == FFA_MSG_SEND_DIRECT_RESP2) {
499-
memcpy(data, &ret.a4, sizeof(*data));
504+
memcpy(data, (void *)&ret + offsetof(ffa_value_t, a4), sizeof(*data));
500505
return 0;
501506
}
502507

0 commit comments

Comments
 (0)