Skip to content

Commit e98499a

Browse files
srabinovdavem330
authored andcommitted
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>
1 parent a0ca153 commit e98499a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/rds/page.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ int rds_page_remainder_alloc(struct scatterlist *scat, unsigned long bytes,
135135
if (rem->r_offset != 0)
136136
rds_stats_inc(s_page_remainder_hit);
137137

138-
rem->r_offset += bytes;
139-
if (rem->r_offset == PAGE_SIZE) {
138+
rem->r_offset += ALIGN(bytes, 8);
139+
if (rem->r_offset >= PAGE_SIZE) {
140140
__free_page(rem->r_page);
141141
rem->r_page = NULL;
142142
}

0 commit comments

Comments
 (0)