linux_dsm_epyc7002/drivers/misc/mic/scif
Wenwen Wang 6b995f4eec misc: mic: fix a DMA pool free failure
In _scif_prog_signal(), the boolean variable 'x100' is used to indicate
whether the MIC Coprocessor is X100. If 'x100' is true, the status
descriptor will be used to write the value to the destination. Otherwise, a
DMA pool will be allocated for this purpose. Specifically, if the DMA pool
is allocated successfully, two memory addresses will be returned. One is
for the CPU and the other is for the device to access the DMA pool. The
former is stored to the variable 'status' and the latter is stored to the
variable 'src'. After the allocation, the address in 'src' is saved to
'status->src_dma_addr', which is actually in the DMA pool, and 'src' is
then modified.

Later on, if an error occurs, the execution flow will transfer to the label
'dma_fail', which will check 'x100' and free up the allocated DMA pool if
'x100' is false. The point here is that 'status->src_dma_addr' is used for
freeing up the DMA pool. As mentioned before, 'status->src_dma_addr' is in
the DMA pool. And thus, the device is able to modify this data. This can
potentially cause failures when freeing up the DMA pool because of the
modified device address.

This patch avoids the above issue by using the variable 'src' (with
necessary calculation) to free up the DMA pool.

Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-15 20:47:40 +02:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scif_api.c misc: mic: SCIF Fix scif_get_new_port() error handling 2018-08-05 16:29:11 +02:00
scif_debugfs.c misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_dma.c misc: mic: scif: remove redundant check on ret < 0 2018-10-11 12:12:55 +02:00
scif_epd.c misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_epd.h the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
scif_fd.c the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
scif_fence.c misc: mic: fix a DMA pool free failure 2018-10-15 20:47:40 +02:00
scif_main.c misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_main.h sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
scif_map.h misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_mmap.c misc: mic: scif: use vma_pages(). 2016-08-30 14:45:50 +02:00
scif_nm.c misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_nodeqp.c misc: mic: fix memory leak 2015-10-17 21:42:29 -07:00
scif_nodeqp.h misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_peer_bus.c misc: mic: SCIF RMA nodeqp and minor miscellaneous changes 2015-10-04 12:54:54 +01:00
scif_peer_bus.h misc: mic: Add support for kernel mode SCIF clients 2015-10-04 12:46:06 +01:00
scif_ports.c misc: mic: SCIF open close bind and listen APIs 2015-05-24 12:13:36 -07:00
scif_rb.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
scif_rb.h
scif_rma_list.c locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE() 2017-10-25 11:01:08 +02:00
scif_rma_list.h misc: mic: SCIF RMA list operations 2015-10-04 12:54:54 +01:00
scif_rma.c iommu/iova: Make dma_32bit_pfn implicit 2017-09-27 17:09:57 +02:00
scif_rma.h misc: mic: SCIF RMA header file 2015-10-04 12:54:54 +01:00