Skip to content

Commit cf00b33

Browse files
jic23djbw
authored andcommitted
cxl/mbox: Add a check on input payload size
A bug in the LSA code resulted in transfers slightly larger than the mailbox size. Let us make it easier to catch similar issues in future by adding a low level check. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 9abf231 commit cf00b33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/core/mbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in,
174174
};
175175
int rc;
176176

177-
if (out_size > cxlds->payload_size)
177+
if (in_size > cxlds->payload_size || out_size > cxlds->payload_size)
178178
return -E2BIG;
179179

180180
rc = cxlds->mbox_send(cxlds, &mbox_cmd);

0 commit comments

Comments
 (0)