You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ibacm: Copy correct number of address bytes before calling provider
In acm_ep_insert_addr() an attempt to zero out the tmp address buffer
is performed. But the subsequent memcpy(), which uses the supplied
addr_len as argument, copies the whole shebang. This implies that the
provider is called with an address with arbitrary data padded.
This leads to a false mis-compare in the default provider's binary
tree lookup. Here is the stack trace and dump of the address buffer
from gdb (edited for better brevity):
(gdb) where
#0 acmp_compare_dest (dest1=0x18c46a8, dest2=0x18c5d70) at prov/acmp/src/acmp.c:289
linux-rdma#1 tfind () from /lib64/libc.so.6
linux-rdma#2 acmp_get_dest () at prov/acmp/src/acmp.c:336
linux-rdma#3 acmp_acquire_dest () at prov/acmp/src/acmp.c:379
linux-rdma#4 acmp_add_addr () at prov/acmp/src/acmp.c:2385
linux-rdma#5 acm_ep_insert_addr (..., addr_len=addr_len@entry=64, ...) at src/acm.c:2044
linux-rdma#6 acm_ep_insert_addr (..., addr_len=64, ...) at src/acm.c:1325
linux-rdma#7 acm_add_ep_ip (ip_str=0x7ffeeda298e0 "192.168.200.200", ...) at src/acm.c:1326
linux-rdma#8 acm_ipnl_handler () at src/acm.c:1453
linux-rdma#9 acm_server () at src/acm.c:1884
linux-rdma#10 main () at src/acm.c:3245
(gdb) x/20u dest1
0x18c46a8: 192 168 200 200 155 127 0 0
0x18c46b0: 95 184 77 105 155 127 0 0
0x18c46b8: 0 0 64 49
(gdb) x/20u dest2
0x18c5d70: 192 168 200 200 0 0 0 0
0x18c5d78: 0 0 0 0 0 0 0 0
0x18c5d80: 0 0 0 0
The fix is to use the real length of the address in the memcpy() in
acm_ep_insert_addr(). This is derived from the addr_type. Hence, we
can re-factor and remove the addr_len from the call stack.
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
Reviewed-by: Mark Haywood <mark.haywood@oracle.com>
Orabug: 29037270
(cherry picked from commit c73f5d7)
cherry-pick-repo=linux-rdma/rdma-core.git
unmodified-from-upstream: c73f5d7
Signed-off-by: Mark Haywood <mark.haywood@oracle.com>
Signed-off-by: Aron Silverton <aron.silverton@oracle.com>
0 commit comments