netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/2] RDS: memory allocated must be align to 8
@ 2016-04-07 11:57 Shamir Rabinovitch
  2016-04-07 11:57 ` [PATCH v4 2/2] RDS: fix congestion map corruption for PAGE_SIZE > 4k Shamir Rabinovitch
  2016-04-08 19:44 ` [PATCH v4 1/2] RDS: memory allocated must be align to 8 santosh shilimkar
  0 siblings, 2 replies; 6+ messages in thread
From: Shamir Rabinovitch @ 2016-04-07 11:57 UTC (permalink / raw)
  To: rds-devel, netdev; +Cc: davem, shamir.rabinovitch, santosh.shilimkar

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>
---
 net/rds/page.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rds/page.c b/net/rds/page.c
index 616f21f..e2b5a58 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;
 			}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-08 20:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 11:57 [PATCH v4 1/2] RDS: memory allocated must be align to 8 Shamir Rabinovitch
2016-04-07 11:57 ` [PATCH v4 2/2] RDS: fix congestion map corruption for PAGE_SIZE > 4k Shamir Rabinovitch
2016-04-08 19:39   ` santosh shilimkar
2016-04-08 19:44 ` [PATCH v4 1/2] RDS: memory allocated must be align to 8 santosh shilimkar
2016-04-08 20:10   ` David Miller
2016-04-08 20:55     ` santosh shilimkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).