summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorshamir rabinovitch <shamir.rabinovitch@oracle.com>2016-04-07 14:57:35 +0300
committerDavid S. Miller <davem@davemloft.net>2016-04-07 23:58:27 +0300
commite98499ac63977c75331b198a18979944a532c9f2 (patch)
tree209abde5dccbc9e0670334555c75f09464fa8b31 /net
parenta0ca153f98db8cf25298565a09e11fe9d82846ad (diff)
downloadlinux-e98499ac63977c75331b198a18979944a532c9f2.tar.xz
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>
Diffstat (limited to '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;
}