linux/drivers/block/drbd
Christoph Böhmwalder 4e8935053b drbd: fix null-pointer dereference on local read error
commit 0d195d3b20 upstream.

In drbd_request_endio(), READ_COMPLETED_WITH_ERROR is passed to
__req_mod() with a NULL peer_device:

  __req_mod(req, what, NULL, &m);

The READ_COMPLETED_WITH_ERROR handler then unconditionally passes this
NULL peer_device to drbd_set_out_of_sync(), which dereferences it,
causing a null-pointer dereference.

Fix this by obtaining the peer_device via first_peer_device(device),
matching how drbd_req_destroy() handles the same situation.

Cc: stable@vger.kernel.org
Reported-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/linux-block/20260104165355.151864-1-islituo@gmail.com
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-03-12 07:09:42 -04:00
..
drbd_actlog.c drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() 2026-03-12 07:09:42 -04:00
drbd_bitmap.c drbd: use __bio_add_page to add page to bio 2023-05-31 09:50:02 -06:00
drbd_buildtag.c drbd: split off drbd_config into separate file 2023-01-29 15:18:33 -07:00
drbd_debugfs.c drbd: drop API_VERSION define 2023-01-29 15:18:33 -07:00
drbd_debugfs.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_int.h drbd: Remove the open-coded page pool 2025-08-11 07:54:27 -06:00
drbd_interval.c drbd: drbd_insert_interval(): Clarify comment 2023-01-29 15:18:33 -07:00
drbd_interval.h drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() 2026-03-12 07:09:42 -04:00
drbd_main.c drbd: always set BLK_FEAT_STABLE_WRITES 2026-02-26 14:59:36 -08:00
drbd_nl.c drbd: always set BLK_FEAT_STABLE_WRITES 2026-02-26 14:59:36 -08:00
drbd_nla.c drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_nla.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_polymorph_printk.h drbd: add context parameter to expect() macro 2022-12-01 11:33:49 -07:00
drbd_proc.c drbd: drop API_VERSION define 2023-01-29 15:18:33 -07:00
drbd_protocol.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_receiver.c drbd: Remove the open-coded page pool 2025-08-11 07:54:27 -06:00
drbd_req.c drbd: fix null-pointer dereference on local read error 2026-03-12 07:09:42 -04:00
drbd_req.h drbd: pass drbd_peer_device to __req_mod 2023-04-01 20:27:55 -06:00
drbd_state.c drbd: Add NULL check for net_conf to prevent dereference in state validation 2024-09-10 13:44:06 -06:00
drbd_state.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_state_change.h drbd: fix function cast warnings in state machine 2024-02-13 08:55:40 -07:00
drbd_strings.c drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_strings.h drbd: use consistent license 2022-11-22 19:38:39 -07:00
drbd_vli.h drbd: remove unnecessary assignment in vli_encode_bits 2023-01-29 15:18:33 -07:00
drbd_worker.c drbd: Remove the open-coded page pool 2025-08-11 07:54:27 -06:00
Kconfig lib/crc: remove CONFIG_LIBCRC32C 2025-04-04 11:31:42 -07:00
Makefile drbd: split off drbd_buildtag into separate file 2023-01-29 15:18:33 -07:00