]> git.baikalelectronics.ru Git - kernel.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)
committerSong Liu <songliubraving@fb.com>
Mon, 30 Nov 2020 18:12:28 +0000 (10:12 -0800)
commit51f79d3f4ee8e303e4a142d5613b20cf2e79a524
tree90c3383f0d46040d1e66f7ec1febeb93f58d451f
parent4b99458be0c3c8089d58f1742c7d34eea5b60897
md/raid10: initialize r10_bio->read_slot before use.

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>
drivers/md/raid10.c