]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mac: validate mac_partition is within sector
authorKees Cook <keescook@chromium.org>
Fri, 20 Nov 2015 01:18:54 +0000 (17:18 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Mar 2016 11:45:57 +0000 (12:45 +0100)
commit69aad7e01c8e883e9d2f8dc5523bd419bd02d2aa
tree5d0571bd0d616f6ce7805f39a1acddb39538060c
parent7c721f4cc915db3556339e39c906d6877d02a90f
mac: validate mac_partition is within sector

commit 02e2a5bfebe99edcf9d694575a75032d53fe1b73 upstream.

If md->signature == MAC_DRIVER_MAGIC and md->block_size == 1023, a single
512 byte sector would be read (secsize / 512). However the partition
structure would be located past the end of the buffer (secsize % 512).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
block/partitions/mac.c