• Mikulas Patocka's avatar
    dm flakey: clone pages on write bio before corrupting them · 1d9a9438
    Mikulas Patocka authored
    dm-flakey has an option to corrupt write bios. It corrupts the memory that
    is being written. This can cause system crashes or security bugs - for
    example, if the user writes a shared library code with O_DIRECT flag to a
    dm-flakey device, it corrupts the memory for all users that have the
    shared library mapped.
    
    Fix this bug by cloning the bio and corrupting the clone rather than
    the original.
    
    Also drop the test for ZERO_PAGE(0) - it can't happen because we write
    the cloned pages.
    Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
    1d9a9438
dm-flakey.c 14.5 KB