Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5df4223a authored by Ralph Campbell's avatar Ralph Campbell Committed by Roland Dreier
Browse files

IB/qib: Clear eager buffer memory for each new process



The eager buffers are not being cleared before being mmapped into a
new user address space.  This is a potential security risk and should
be fixed.  Note that the eager header queue is already being cleared.

Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent b9e03e04
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1472,6 +1472,9 @@ int qib_setup_eagerbufs(struct qib_ctxtdata *rcd)
		dma_addr_t pa = rcd->rcvegrbuf_phys[chunk];
		unsigned i;

		/* clear for security and sanity on each use */
		memset(rcd->rcvegrbuf[chunk], 0, size);

		for (i = 0; e < egrcnt && i < egrperchunk; e++, i++) {
			dd->f_put_tid(dd, e + egroff +
					  (u64 __iomem *)