]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/rds: fix unaligned memory access
authorshamir rabinovitch <shamir.rabinovitch@oracle.com>
Fri, 1 May 2015 00:58:07 +0000 (20:58 -0400)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 3 Nov 2016 16:46:21 +0000 (09:46 -0700)
commit938aaa6f8ea32e5adc7828ef5ea96f8d098639df
tree881df3090c932d8f69c93ee7137df93f37701b31
parent28c090204b4dd9ea769ce4715e6f85ceb0d972d1
net/rds: fix unaligned memory access

rdma_conn_param private data is copied using memcpy after headers such
as cma_hdr (see cma_resolve_ib_udp as example). so the start of the
private data is aligned to the end of the structure that come before. if
this structure end with u32 the meaning is that the start of the private
data will be 4 bytes aligned. structures that use u8/u16/u32/u64 are
naturally aligned but in case the structure start is not 8 bytes aligned,
all u64 members of this structure will not be aligned. to solve this issue
we must use special macros that allow unaligned access to those
unaligned members.

Addresses the following kernel log seen when attempting to use RDMA:

Kernel unaligned access at TPC[10507a88] rds_ib_cm_connect_complete+0x1bc/0x1e0 [rds_rdma]

Orabug: 24817685

Acked-by: Chien Yen <chien.yen@oracle.com>
Signed-off-by: shamir rabinovitch <shamir.rabinovitch@oracle.com>
[Minor tweaks for top of tree by:]
Signed-off-by: David Ahern <david.ahern@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c0adf54a10903b59037a4c5fcb933dfeeb7b2624)
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
net/rds/ib_cm.c