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

Commit 3a381abc authored by Jens Axboe's avatar Jens Axboe Committed by Greg Kroah-Hartman
Browse files

nbd: fix use-after-free of rq/bio in the xmit path



commit 429a787be6793554ee02aacc7e1f11ebcecc4453 upstream.

For writes, we can get a completion in while we're still iterating
the request and bio chain. If that happens, we're reading freed
memory and we can crash.

Break out after the last segment and avoid having the iterator
read freed memory.

Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b9b2002
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