In the Linux kernel, the following vulnerability has been resolved: dm-thin: fix data corruption if discard races with regular I/O In the function break_up_discard_bio, if a discard hits the same block as regular I/O, it was intended to skip the discard for the affected range. However, the skip code only advances "data_begin", it doesn't advance "virt_begin". So, the data_begin and virt_begin variables become unsynchronized. process_prepared_discard_passdown_pt1 calculates "data_end = m->data_block + (m->virt_end - m->virt_begin);" - if m->data_block is incremented and m->virt_begin isn't, it will overshoot the intended discard range.
https://git.kernel.org/stable/c/f1341f858a055e7e2f512d1b1ddface0b3bd6898
https://git.kernel.org/stable/c/62ee9c09366cad69410330087d990e469dd92314
https://git.kernel.org/stable/c/29398176771782e9217a4b0cdaac200560d65d00
https://git.kernel.org/stable/c/18bb782c7c10536360042eeba37da9e9268e82df