bitmap: keep unused tail bits out of bitmap_cut() results
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bitmap: ignore unused tail bits in bitmap_cut()lib/ lib/ | +3 | 0 replies | |
| 2/2 | lib/test_bitmap: cover unused tail bits in bitmap_cut()lib/ | +90 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] bitmap: keep unused tail bits out of bitmap_cut() results
bitmap_cut() can shift an unused bit from the last storage word into the valid result. Patch 1 masks the copied tail before shifting and corrects the existing test expectation. Patch 2 adds checks for partial words and overlapping buffers.
With identical CONFIG_TEST_BITMAP sources and configuration on x86_64 UML with GCC 13.3.0, the original failed 21 of 391,596 checks and the fixed version passed all 391,596. Clang 18.1.3 compiled both modified objects. A 32-bit kernel and a Clang-built kernel were not booted.
Jinseob Kim (2):
bitmap: ignore unused tail bits in bitmap_cut() lib/test_bitmap: cover unused tail bits in bitmap_cut()
lib/bitmap.c | 2 + lib/test_bitmap.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 2 deletions(-)