Skip to content

Commit

Permalink
KVM: s390: Fix STHYI buffer alignment for diag224
Browse files Browse the repository at this point in the history
Diag224 requires a page-aligned 4k buffer to store the name table
into. kmalloc does not guarantee page alignment, hence we replace it
with __get_free_page for the buffer allocation.

Cc: stable@vger.kernel.org # v4.8+
Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
  • Loading branch information
Janosch Frank authored and Christian Borntraeger committed Oct 26, 2016
1 parent a5efb6b commit 45c7ee4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/kvm/sthyi.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static void fill_diag(struct sthyi_sctns *sctns)
if (r < 0)
goto out;

diag224_buf = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
diag224_buf = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
if (!diag224_buf || diag224(diag224_buf))
goto out;

Expand Down Expand Up @@ -378,7 +378,7 @@ static void fill_diag(struct sthyi_sctns *sctns)
sctns->par.infpval1 |= PAR_WGHT_VLD;

out:
kfree(diag224_buf);
free_page((unsigned long)diag224_buf);
vfree(diag204_buf);
}

Expand Down

0 comments on commit 45c7ee4

Please sign in to comment.