|
| 1 | +From 7718fa6355d6f395d0822e824c943f74750500b4 Mon Sep 17 00:00:00 2001 |
| 2 | +From: AkarshHCL <v-akarshc@microsoft.com> |
| 3 | +Date: Tue, 17 Jun 2025 05:45:34 +0000 |
| 4 | +Subject: [PATCH] Address CVE-2025-47712 |
| 5 | + |
| 6 | +Upstream Patch reference: https://gitlab.com/nbdkit/nbdkit/-/commit/a486f88d1eea653ea88b0bf8804c4825dab25ec7 |
| 7 | + |
| 8 | +--- |
| 9 | + filters/blocksize/blocksize.c | 5 +++-- |
| 10 | + tests/Makefile.am | 2 ++ |
| 11 | + 2 files changed, 5 insertions(+), 2 deletions(-) |
| 12 | + |
| 13 | +diff --git a/filters/blocksize/blocksize.c b/filters/blocksize/blocksize.c |
| 14 | +index 09195ce..e5c8b74 100644 |
| 15 | +--- a/filters/blocksize/blocksize.c |
| 16 | ++++ b/filters/blocksize/blocksize.c |
| 17 | +@@ -482,8 +482,9 @@ blocksize_extents (nbdkit_next *next, |
| 18 | + return -1; |
| 19 | + } |
| 20 | + |
| 21 | +- if (nbdkit_extents_aligned (next, MIN (ROUND_UP (count, h->minblock), |
| 22 | +- h->maxlen), |
| 23 | ++ if (nbdkit_extents_aligned (next, |
| 24 | ++ MIN (ROUND_UP ((uint64_t) count, h->minblock), |
| 25 | ++ h->maxlen), |
| 26 | + ROUND_DOWN (offset, h->minblock), flags, |
| 27 | + h->minblock, extents2, err) == -1) |
| 28 | + return -1; |
| 29 | +diff --git a/tests/Makefile.am b/tests/Makefile.am |
| 30 | +index 9233c37..429ba11 100644 |
| 31 | +--- a/tests/Makefile.am |
| 32 | ++++ b/tests/Makefile.am |
| 33 | +@@ -1481,12 +1481,14 @@ test_layers_filter3_la_LIBADD = $(IMPORT_LIBRARY_ON_WINDOWS) |
| 34 | + TESTS += \ |
| 35 | + test-blocksize.sh \ |
| 36 | + test-blocksize-extents.sh \ |
| 37 | ++ test-blocksize-extents-overflow.sh \ |
| 38 | + test-blocksize-default.sh \ |
| 39 | + test-blocksize-sharding.sh \ |
| 40 | + $(NULL) |
| 41 | + EXTRA_DIST += \ |
| 42 | + test-blocksize.sh \ |
| 43 | + test-blocksize-extents.sh \ |
| 44 | ++ test-blocksize-extents-overflow.sh \ |
| 45 | + test-blocksize-default.sh \ |
| 46 | + test-blocksize-sharding.sh \ |
| 47 | + $(NULL) |
| 48 | +-- |
| 49 | +2.45.2 |
| 50 | + |
0 commit comments