lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun,  3 Apr 2016 08:24:03 -0400
From:	Shamir Rabinovitch <shamir.rabinovitch@...cle.com>
To:	rds-devel@....oracle.com, netdev@...r.kernel.org
Cc:	davem@...emloft.net, shamir.rabinovitch@...cle.com
Subject: [PATCH v3 1/2] RDS: fix "Kernel unaligned access" on sparc64

Sparc64 expect 64 bit types to be aligned to 8. This patch ensure that
memory allocated by 'rds_page_remainder_alloc' will be aligned to 8.
This patch fix issue found in 'rds_ib_cong_recv' when accessing
unaligned memory using uint64_t pointer.

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@...cle.com>

Reviewed-by: Wengang Wang <wen.gang.wang@...cle.com>
Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@...cle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@...cle.com>
Tested-by: Anand Bibhuti <anand.bibhuti@...cle.com>
---
 net/rds/page.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/rds/page.c b/net/rds/page.c
index 616f21f..4813e1f 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -135,8 +135,9 @@ 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) {
+			/* fix 'Kernel unaligned access' on sparc64 */
+			rem->r_offset += ALIGN(bytes, 8);
+			if (rem->r_offset >= PAGE_SIZE) {
 				__free_page(rem->r_page);
 				rem->r_page = NULL;
 			}
-- 
1.7.1

Powered by blists - more mailing lists