summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshamir rabinovitch <shamir.rabinovitch@oracle.com>2016-04-07 07:57:35 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-07 16:58:27 -0400
commite98499ac63977c75331b198a18979944a532c9f2 (patch)
tree209abde5dccbc9e0670334555c75f09464fa8b31
parenta0ca153f98db8cf25298565a09e11fe9d82846ad (diff)
downloadlinux-e98499ac63977c75331b198a18979944a532c9f2.tar.bz2
RDS: memory allocated must be align to 8
Fix issue in 'rds_ib_cong_recv' when accessing unaligned memory allocated by 'rds_page_remainder_alloc' using uint64_t pointer. Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/rds/page.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rds/page.c b/net/rds/page.c
index 616f21f4e7d7..e2b5a5832d3d 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -135,8 +135,8 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
if (rem->r_offset != 0)
rds_stats_inc(s_page_remainder_hit);
- rem->r_offset += bytes;
- if (rem->r_offset == PAGE_SIZE) {
+ rem->r_offset += ALIGN(bytes, 8);
+ if (rem->r_offset >= PAGE_SIZE) {
__free_page(rem->r_page);
rem->r_page = NULL;
}