All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinseob Kim <kimjinseob88@gmail.com>
To: yury.norov@gmail.com
Cc: linux@rasmusvillemoes.dk, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] bitmap: keep unused tail bits out of bitmap_cut() results
Date: Mon, 23 Nov 2026 13:31:52 +0900	[thread overview]
Message-ID: <cover.1795407826.git.kimjinseob88@gmail.com> (raw)

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(-)


             reply	other threads:[~2026-11-23  4:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  4:31 Jinseob Kim [this message]
2026-11-23  4:31 ` [PATCH 1/2] bitmap: ignore unused tail bits in bitmap_cut() Jinseob Kim
2026-11-23  4:31 ` [PATCH 2/2] lib/test_bitmap: cover " Jinseob Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1795407826.git.kimjinseob88@gmail.com \
    --to=kimjinseob88@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.