]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ibmvnic: Handle DMA unmapping of login buffs in release functions
authorNick Child <nnac123@linux.ibm.com>
Wed, 9 Aug 2023 22:10:36 +0000 (17:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:22:02 +0000 (18:22 +0200)
commit555e126dd30b886f0f8934da8f01a79653d944d3
tree6651990d3108cc526e45044b43819e612aa2391e
parent34fcc823823af4750377851554171b0a0afaf42f
ibmvnic: Handle DMA unmapping of login buffs in release functions

commit d78a671eb8996af19d6311ecdee9790d2fa479f0 upstream.

Rather than leaving the DMA unmapping of the login buffers to the
login response handler, move this work into the login release functions.
Previously, these functions were only used for freeing the allocated
buffers. This could lead to issues if there are more than one
outstanding login buffer requests, which is possible if a login request
times out.

If a login request times out, then there is another call to send login.
The send login function makes a call to the login buffer release
function. In the past, this freed the buffers but did not DMA unmap.
Therefore, the VIOS could still write to the old login (now freed)
buffer. It is for this reason that it is a good idea to leave the DMA
unmap call to the login buffers release function.

Since the login buffer release functions now handle DMA unmapping,
remove the duplicate DMA unmapping in handle_login_rsp().

Fixes: dff515a3e71d ("ibmvnic: Harden device login requests")
Signed-off-by: Nick Child <nnac123@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230809221038.51296-3-nnac123@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/ibm/ibmvnic.c