OpenCloudOS-Kernel/drivers/cxl
Ben Widawsky 88ff5d466c cxl/mem: Fix potential memory leak
When submitting a command for userspace, input and output payload bounce
buffers are allocated. For a given command, both input and output
buffers may exist and so when allocation of the input buffer fails, the
output buffer must be freed too.

As far as I can tell, userspace can't easily exploit the leak to OOM a
machine unless the machine was already near OOM state.

Fixes: 583fa5e71c ("cxl/mem: Add basic IOCTL interface")
Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Link: https://lore.kernel.org/r/20210221035846.680145-1-ben.widawsky@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2021-02-22 14:44:39 -08:00
..
Kconfig cxl/mem: Add a "RAW" send command 2021-02-16 20:36:38 -08:00
Makefile cxl/mem: Register CXL memX devices 2021-02-16 20:36:38 -08:00
bus.c cxl/mem: Register CXL memX devices 2021-02-16 20:36:38 -08:00
cxl.h cxl/mem: Enable commands via CEL 2021-02-16 20:36:38 -08:00
mem.c cxl/mem: Fix potential memory leak 2021-02-22 14:44:39 -08:00
pci.h