mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 09:09:23 +00:00
md/raid10: prevent access of uninitialized resync_pages offset
commit45422b704d
upstream. Due to unneeded multiplication in the out_free_pages portion of r10buf_pool_alloc(), when using a 3-copy raid10 layout, it is possible to access a resync_pages offset that has not been initialized. This access translates into a crash of the system within resync_free_pages() while passing a bad pointer to put_page(). Remove the multiplication, preventing access to the uninitialized area. Fixes:f025061836
("md: raid10: don't use bio's vec table to manage resync pages") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: John Pittman <jpittman@redhat.com> Suggested-by: David Jeffery <djeffery@redhat.com> Reviewed-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f8dc0350d3
commit
a268d985f0
1 changed files with 1 additions and 1 deletions
|
@ -229,7 +229,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data)
|
|||
|
||||
out_free_pages:
|
||||
while (--j >= 0)
|
||||
resync_free_pages(&rps[j * 2]);
|
||||
resync_free_pages(&rps[j]);
|
||||
|
||||
j = 0;
|
||||
out_free_bio:
|
||||
|
|
Loading…
Reference in a new issue