aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpiutil.c
diff options
context:
space:
mode:
authorXiaomeng Tong <[email protected]>2022-04-06 21:04:44 +0200
committerJens Axboe <[email protected]>2022-04-06 13:07:52 -0600
commitae4d37b5df749926891583d42a6801b5da11e3c1 (patch)
tree90cade8b7fa9f51674be457dccd68f53293f7a5a /lib/mpi/mpiutil.c
parentaadb22ba2f656581b2f733deb3a467c48cc618f6 (diff)
drbd: fix an invalid memory access caused by incorrect use of list iterator
The bug is here: idr_remove(&connection->peer_devices, vnr); If the previous for_each_connection() don't exit early (no goto hit inside the loop), the iterator 'connection' after the loop will be a bogus pointer to an invalid structure object containing the HEAD (&resource->connections). As a result, the use of 'connection' above will lead to a invalid memory access (including a possible invalid free as idr_remove could call free_layer). The original intention should have been to remove all peer_devices, but the following lines have already done the work. So just remove this line and the unneeded label, to fix this bug. Cc: [email protected] Fixes: c06ece6ba6f1b ("drbd: Turn connection->volumes into connection->peer_devices") Signed-off-by: Xiaomeng Tong <[email protected]> Reviewed-by: Christoph Böhmwalder <[email protected]> Reviewed-by: Lars Ellenberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions