GNOME Bugzilla – Bug 691213
Handle IPv6 accept_ra value '2' at startup
Last modified: 2013-02-20 20:00:24 UTC
Created attachment 232845 [details] [review] make valgrind happy This trivial patch is from the same series as 691212. If fixes the following valgrind issue: Syscall param open(filename) points to unaddressable byte(s) at 0x32CBC1038D: ??? (in /lib64/libpthread-2.16.so) by 0x457ED8: nm_utils_do_sysctl (in /usr/sbin/NetworkManager) by 0x4821ED: nm_ip6_manager_prepare_interface (in /usr/sbin/NetworkManager) by 0x42B33E: real_act_stage3_ip6_config_start (in /usr/sbin/NetworkManager) by 0x42E2A5: nm_device_activate_stage3_ip_config_start (in /usr/sbin/NetworkManager) by 0x3C57848D74: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.3) by 0x3C578490A7: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.3) by 0x3C57849491: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.3) by 0x427838: main (in /usr/sbin/NetworkManager) Address 0x0 is not stack'd, malloc'd or (recently) free'd That's because in update_accept_ra_save() (nm-device.c) the function nm_utils_get_proc_sys_net_value_with_bounds() is called with the last parameter '1' (max possible value for /proc/sys/net/ipv6/conf/$iface/accept_ra), which in my case is not sufficient since I have '2' in there: $ cat /proc/sys/net/ipv6/conf/wlan0/accept_ra 2 and as per https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt, '2' is a valid value.
Looks fine.
The patch doesn't solve the valgrind problem. The stack is completely different. The problem was in open (path,...) in nm_utils_do_sysctl(), where path was NULL. It is solved by these commit: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/src/NetworkManagerUtils.c?id=a021e40e3324e9a24702564227fb884b73bfadad So, you may not use the latest code. As for the patch, I'm not sure we want number '2'.
(In reply to comment #2) > As for the patch, I'm not sure we want number '2'. I'm almost sure we do. Value 2 means true, value 0 means false and value 1 means maybe.
Yeah, we do want the '2' here. Adjusting the bug title to reflect what the actual issue was. We really should make accept_ra_path valid no matter what, even if we fail to read it.
Patch pushed, thanks.