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

Commit f5180407 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Lee Jones
Browse files

UPSTREAM: nvmet-tcp: Fix a possible UAF in queue intialization setup



commit d920abd1e7c4884f9ecd0749d1921b7ab19ddfbd upstream.

From Alon:
"Due to a logical bug in the NVMe-oF/TCP subsystem in the Linux kernel,
a malicious user can cause a UAF and a double free, which may lead to
RCE (may also lead to an LPE in case the attacker already has local
privileges)."

Hence, when a queue initialization fails after the ahash requests are
allocated, it is guaranteed that the queue removal async work will be
called, hence leave the deallocation to the queue removal.

Also, be extra careful not to continue processing the socket, so set
queue rcv_state to NVMET_TCP_RECV_ERR upon a socket error.

Bug: 310114968
Cc: stable@vger.kernel.org
Reported-by: default avatarAlon Zahavi <zahavi.alon@gmail.com>
Tested-by: default avatarAlon Zahavi <zahavi.alon@gmail.com>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarDragos-Marian Panait <dragos.panait@windriver.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4e53bab1)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Ifd7ec8294182a6bf6d8c261aeda5d989e909f7ff
parent 0581932d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment