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 <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20220815154044.24733-2-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 9abf231 commit cf00b33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)