]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md/raid10: initialize r10_bio->read_slot before use.
authorKevin Vigor <kvigor@gmail.com>
Fri, 6 Nov 2020 22:20:34 +0000 (14:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:44:58 +0000 (14:44 +0100)
commitf8bd479859c9431bf0e951948f76c75e8953d6bd
tree98dd1dde5030082ca3e14070959b81aa20276729
parent3207316b3beec7e38e5dbe2f463df0cec71e0b97
md/raid10: initialize r10_bio->read_slot before use.

commit 93decc563637c4288380912eac0eb42fb246cc04 upstream.

In __make_request() a new r10bio is allocated and passed to
raid10_read_request(). The read_slot member of the bio is not
initialized, and the raid10_read_request() uses it to index an
array. This leads to occasional panics.

Fix by initializing the field to invalid value and checking for
valid value in raid10_read_request().

Cc: stable@vger.kernel.org
Signed-off-by: Kevin Vigor <kvigor@gmail.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid10.c