Skip to content

drbd: validate digest size in checksum resync and verify requests - #1474

Open
ghost wants to merge 1 commit into
linus-master_basefrom
series/1189972=>linus-master
Open

ghost wants to merge 1 commit into
linus-master_basefrom
series/1189972=>linus-master

Conversation

@ghost

@ghost ghost commented Oct 20, 2026

Copy link
Copy Markdown

Pull request for series with
subject: drbd: validate digest size in checksum resync and verify requests
version: 2
url: https://patchwork.kernel.org/series/1189972/

@ghost

ghost commented Oct 20, 2026

Copy link
Copy Markdown
Author

Upstream branch: c03c1a1
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost

ghost commented Oct 22, 2026

Copy link
Copy Markdown
Author

Upstream branch: 7be4bc5
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 2cc264a to e2f7353 Compare October 22, 2026 07:34
@ghost
ghost force-pushed the linus-master_base branch from 435b194 to fd67522 Compare October 24, 2026 03:36
@ghost

ghost commented Oct 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: 17bb0e2
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from e2f7353 to b0ee2e3 Compare October 24, 2026 03:50
@ghost
ghost force-pushed the linus-master_base branch from fd67522 to 3b53a63 Compare October 26, 2026 01:52
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 21a7f44
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from b0ee2e3 to 1e627aa Compare October 26, 2026 02:13
@ghost
ghost force-pushed the linus-master_base branch from 3b53a63 to 5d84576 Compare October 26, 2026 07:01
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6b4b543
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 1e627aa to 6599e02 Compare October 26, 2026 07:18
@ghost
ghost force-pushed the linus-master_base branch from 5d84576 to 6582ed2 Compare October 26, 2026 18:11
@ghost

ghost commented Oct 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: fb2c3f4
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 6599e02 to 28204eb Compare October 26, 2026 18:22
@ghost
ghost force-pushed the linus-master_base branch from 6582ed2 to b3a1abc Compare October 26, 2026 23:55
@ghost

ghost commented Oct 27, 2026

Copy link
Copy Markdown
Author

Upstream branch: d135ab4
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 28204eb to 9165b4d Compare October 27, 2026 00:07
@ghost
ghost force-pushed the linus-master_base branch from b3a1abc to 712496f Compare October 28, 2026 23:34
@ghost

ghost commented Oct 28, 2026

Copy link
Copy Markdown
Author

Upstream branch: c339f40
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 9165b4d to b29912c Compare October 28, 2026 23:52
@ghost
ghost force-pushed the linus-master_base branch from 712496f to a186880 Compare October 30, 2026 13:52
@ghost

ghost commented Oct 30, 2026

Copy link
Copy Markdown
Author

Upstream branch: d89e1d1
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from b29912c to e945d5c Compare October 30, 2026 14:15
@ghost
ghost force-pushed the linus-master_base branch from a186880 to 46206a3 Compare November 2, 2026 17:14
@ghost

ghost commented Nov 2, 2026

Copy link
Copy Markdown
Author

Upstream branch: 6628e7d
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from e945d5c to a6798f1 Compare November 2, 2026 17:54
@ghost
ghost force-pushed the linus-master_base branch from 46206a3 to 220bd96 Compare November 3, 2026 23:41
@ghost

ghost commented Nov 4, 2026

Copy link
Copy Markdown
Author

Upstream branch: 05441d6
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from a6798f1 to c63eb97 Compare November 4, 2026 00:08
@ghost
ghost force-pushed the linus-master_base branch from 220bd96 to 6c4625e Compare November 6, 2026 08:02
@ghost

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Author

Upstream branch: f66469d
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from c63eb97 to 341b410 Compare November 6, 2026 08:47
@ghost
ghost force-pushed the linus-master_base branch from 6c4625e to c7f678d Compare November 7, 2026 03:08
@ghost

ghost commented Nov 7, 2026

Copy link
Copy Markdown
Author

Upstream branch: d487237
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 341b410 to 1a5784a Compare November 7, 2026 03:44
@ghost
ghost force-pushed the linus-master_base branch from c7f678d to 6aa6cd1 Compare November 10, 2026 07:53
receive_DataRequest() sizes the digest buffer of P_CSUM_RS_REQUEST and
P_OV_REPLY packets from the length the peer puts in the packet header,
without checking it against the digest size of the negotiated csums-alg
or verify-alg. w_e_end_csum_rs_req() and w_e_end_ov_reply() later
memcmp() crypto_shash_digestsize() bytes of that buffer; the D_ASSERT()
on the size only logs a message.

A peer that sends a shorter digest thus causes a slab-out-of-bounds read
in the worker, and a peer that declares a huge length makes the receiver
attempt an oversized kmalloc() that triggers a page allocator warning.

  BUG: KASAN: slab-out-of-bounds in memcmp (lib/string.c:676)
  Read of size 8 at addr ff11000007b9d630 by task drbd_w_r0/601
  Call Trace:
   memcmp (lib/string.c:676)
   w_e_end_csum_rs_req (drivers/block/drbd/drbd_worker.c:1182)
   drbd_worker (drivers/block/drbd/drbd_worker.c:2189)
   drbd_thread_setup (drivers/block/drbd/drbd_main.c:314)
   kthread (kernel/kthread.c:436)
   ret_from_fork (arch/x86/kernel/process.c:158)
   ret_from_fork_asm (arch/x86/entry/entry_64.S:245)

  Allocated by task 605:
   __kmalloc_noprof (mm/slub.c:5439)
   receive_DataRequest (drivers/block/drbd/drbd_receiver.c:2715)
   drbd_receiver (drivers/block/drbd/drbd_receiver.c:5371)
   drbd_thread_setup (drivers/block/drbd/drbd_main.c:314)
   kthread (kernel/kthread.c:436)

Reject the packet and drop the connection unless the declared digest
length matches the digest size of the corresponding transform, or if
no such transform is configured.

Fixes: b411b36 ("The DRBD driver")
Cc: stable@vger.kernel.org
Reported-by: co+0845f49852fd568f@bugs.sh
Signed-off-by: Yibo Liu <yiboliume@gmail.com>
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: b3dfbde
series: https://patchwork.kernel.org/series/1189972/
version: 2

@ghost
ghost force-pushed the series/1189972=>linus-master branch from 1a5784a to acf1699 Compare November 10, 2026 08:17
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.

1 participant