]> git.openfabrics.org - ~shefty/ibacm.git/commit
ibacm: incorrect ifc_len is specified in SIOCGIFCONF request
authorKaike Wan <kaike.wan@intel.com>
Wed, 3 Dec 2014 19:42:54 +0000 (11:42 -0800)
committerSean Hefty <sean.hefty@intel.com>
Wed, 3 Dec 2014 20:14:51 +0000 (12:14 -0800)
commite874a7ab9111f9bae8f83a95a3717446ce19715f
tree2b8870d416096866fa7415739d3e2f4cbb1db320
parent46099fdf9c7f15ce73add352ac68f0e032021541
ibacm: incorrect ifc_len is specified in SIOCGIFCONF request

The ifc->ifs_len in the ioctl SIOCGIFCONF request should only specify the
associated ifreq buffer length and not include the ifc header length.
This bug was found by running ibacm with Valgrind:

==8201== Syscall param ioctl(SIOCGIFCONF).ifc_buf points to unaddressable byte(s)
==8201==    at 0x3E886DF7B7: ioctl (in /lib64/libc-2.12.so)
==8201==    by 0x40A11A: acm_if_iter_sys (acm_util.c:154)
==8201==    by 0x406979: acm_get_system_ips (acm.c:1584)
==8201==    by 0x4069FD: acm_assign_ep_names (acm.c:1602)
==8201==    by 0x4070D1: acm_ep_up (acm.c:1744)
==8201==    by 0x407799: acm_port_up (acm.c:1896)
==8201==    by 0x407DE1: acm_activate_devices (acm.c:2027)
==8201==    by 0x409CAC: main (acm.c:2728)
==8201==  Address 0x5063470 is 0 bytes after a block of size 2,576 alloc'd
==8201==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
==8201==    by 0x40A0BB: acm_if_iter_sys (acm_util.c:144)
==8201==    by 0x406979: acm_get_system_ips (acm.c:1584)
==8201==    by 0x4069FD: acm_assign_ep_names (acm.c:1602)
==8201==    by 0x4070D1: acm_ep_up (acm.c:1744)
==8201==    by 0x407799: acm_port_up (acm.c:1896)
==8201==    by 0x407DE1: acm_activate_devices (acm.c:2027)
==8201==    by 0x409CAC: main (acm.c:2728)

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm_util.c