Skip to content

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Jan 4, 2026

Pull request for series with
subject: drbd: fix a null-pointer dereference when the request event in drbd_request_endio() is READ_COMPLETED_WITH_ERROR
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1038240

@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 4, 2026

Upstream branch: aacb0a6
series: https://patchwork.kernel.org/project/linux-block/list/?series=1038240
version: 1

@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 8, 2026

Upstream branch: aacb0a6
series: https://patchwork.kernel.org/project/linux-block/list/?series=1038240
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1038240=>linus-master branch from 5591c78 to b5e0543 Compare January 8, 2026 00:57
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from a2a6d78 to f962a4d Compare January 9, 2026 04:56
…equest_endio() is READ_COMPLETED_WITH_ERROR

In drbd_request_endio(), the request event what can be set to
READ_COMPLETED_WITH_ERROR. In this case, __req_mod() is invoked with a NULL
peer_device:

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

When handling READ_COMPLETED_WITH_ERROR, __req_mod() unconditionally calls
drbd_set_out_of_sync():

  case READ_COMPLETED_WITH_ERROR:
    drbd_set_out_of_sync(peer_device, req->i.sector, req->i.size);

The drbd_set_out_of_sync() macro expands to __drbd_change_sync():

  #define drbd_set_out_of_sync(peer_device, sector, size) \
	__drbd_change_sync(peer_device, sector, size, SET_OUT_OF_SYNC)

However, __drbd_change_sync() assumes a valid peer_device and immediately
dereferences it:

  struct drbd_device *device = peer_device->device;

If peer_device is NULL, this results in a NULL-pointer dereference.

Fix this by adding a NULL check in __req_mod() before calling
drbd_set_out_of_sync().

Signed-off-by: Tuo Li <[email protected]>
@blktests-ci
Copy link
Author

blktests-ci bot commented Jan 9, 2026

Upstream branch: 623fb99
series: https://patchwork.kernel.org/project/linux-block/list/?series=1038240
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1038240=>linus-master branch from b5e0543 to 504689c Compare January 9, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants