Re: [PATCH] dm era: fix out-of-bounds memory access for non-zero start sector

Ming Hung Tsai <[email protected]>
Newsgroups dev.linux.lists.dm-devel,org.kernel.vger.linux-kernel
Message-ID <CALjSBEteAnvKTa9nTeK9x+aoN8wZSmA=1fKpqxiwkTTDrxDQzQ@mail.gmail.com>
On Thu, Jul 2, 2026 at 8:34 AM Samuel Moelius
<[email protected]> wrote:
>
> dm-era tracks writes in target-relative blocks, but era_map() calculates
> the writeset block before applying the target offset.  Tables with a
> non-zero start sector can therefore pass an absolute mapped-device block
> to metadata_current_marked().
>
> If the absolute block is beyond the current writeset size,
> writeset_marked() tests past the end of the in-core bitset.  KASAN reports
> this as a vmalloc-out-of-bounds access.
>
> Apply the target offset before calculating the era block so writeset
> lookups use the target-relative block number.
>
> Assisted-by: Codex:gpt-5.5-cyber-preview
> Signed-off-by: Samuel Moelius <[email protected]>

Reviewed-by: Ming-Hung Tsai <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.