dm: Check for device sector overflow if CONFIG_LBDAF is not set
Reference to a device in device-mapper table contains offset in sectors. If the sector_t is 32bit integer (CONFIG_LBDAF is not set), then several device-mapper targets can overflow this offset and validity check is then performed on a wrong offset and a wrong table is activated. See for example (on 32bit without CONFIG_LBDAF) this overflow: # dmsetup create test --table "0 2048 linear /dev/sdg 4294967297" # dmsetup table test 0 2048 linear 8:96 1 This patch adds explicit check for overflow if the offset is sector_t type. Signed-off-by:Milan Broz <gmazyland@gmail.com> Reviewed-by:
Mikulas Patocka <mpatocka@redhat.com> Signed-off-by:
Mike Snitzer <snitzer@redhat.com>
Showing
- drivers/md/dm-crypt.c 1 addition, 1 deletiondrivers/md/dm-crypt.c
- drivers/md/dm-delay.c 1 addition, 1 deletiondrivers/md/dm-delay.c
- drivers/md/dm-flakey.c 1 addition, 1 deletiondrivers/md/dm-flakey.c
- drivers/md/dm-linear.c 1 addition, 1 deletiondrivers/md/dm-linear.c
- drivers/md/dm-raid1.c 2 additions, 1 deletiondrivers/md/dm-raid1.c
- drivers/md/dm-unstripe.c 1 addition, 1 deletiondrivers/md/dm-unstripe.c
Loading
Please register or sign in to comment