]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-ddf.c
DDF: validate metadata_update size before using it.
authorNeilBrown <neilb@suse.de>
Thu, 10 Jul 2014 05:59:06 +0000 (15:59 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 10 Jul 2014 05:59:06 +0000 (15:59 +1000)
commit1f17f96b538793a0e665e471f602c6fa490ec167
treee2f88cd10208c5f3899d6d1ecf28789bfa3e66f8
parent5fe6f031d9a21a935f0ef1b1fbdb314b53f2199f
DDF: validate metadata_update size before using it.

process_update already checks update->len, for all but
the 'magic', prepare_update doesn't at all.

So add tests to prepare_update that we don't exceed the buffer.
This will consequently protect process_update from looking
for a 'magic' which isn't there.

Reported-by: Vincent Berg <vberg@ioactive.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c