]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:43:14 +0000 (16:43 +0100)
commita9b1f9fb24a938691b91ff50f1b0ae1780eab67d
tree2726830b262de52710e9409419c8044e823109ef
parent16ae7af977268b818fb843ad0f21affa7cf5846a
md/raid10: initialize r10_bio->read_slot before use.

BugLink: https://bugs.launchpad.net/bugs/1912681
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
drivers/md/raid10.c