After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691213 - Handle IPv6 accept_ra value '2' at startup
Handle IPv6 accept_ra value '2' at startup
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal trivial
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-01-06 04:11 UTC by Mihai Dontu
Modified: 2013-02-20 20:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
make valgrind happy (594 bytes, patch)
2013-01-06 04:11 UTC, Mihai Dontu
none Details | Review

Description Mihai Dontu 2013-01-06 04:11:06 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.
Comment 1 Pavel Simerda 2013-01-08 13:10:59 UTC
Looks fine.
Comment 2 Jiri Klimes 2013-01-10 18:00:52 UTC
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'.
Comment 3 Pavel Simerda 2013-01-11 12:28:43 UTC
(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.
Comment 4 Dan Williams 2013-02-20 19:55:52 UTC
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.
Comment 5 Dan Williams 2013-02-20 20:00:24 UTC
Patch pushed, thanks.