Skip to content

Commit f010c75

Browse files
jic23djbw
authored andcommitted
cxl/pmem: Fix failure to account for 8 byte header for writes to the device LSA.
Writes to the device must include an offset and size as defined in CXL 2.0 8.2.9.5.2.4 Set LSA (Opcode 4103h) Fixes tag is non obvious as this code has been through several reworks and variable names + wasn't in use until the addition of the region code. Due to a bug in QEMU CXL emulation this overrun resulted in QEMU crashing. Reported-by: Bobo WL <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Fixes: 60b8f17 ("cxl/pmem: Translate NVDIMM label commands to CXL label commands") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 2816e24 commit f010c75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/pmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int cxl_pmem_get_config_size(struct cxl_dev_state *cxlds,
107107

108108
*cmd = (struct nd_cmd_get_config_size) {
109109
.config_size = cxlds->lsa_size,
110-
.max_xfer = cxlds->payload_size,
110+
.max_xfer = cxlds->payload_size - sizeof(struct cxl_mbox_set_lsa),
111111
};
112112

113113
return 0;

0 commit comments

Comments
 (0)