Linus Lüssing wrote:
Hi everyone,
By accident I've typed in a mesh interface name for batman-adv which already existed as a real interface. This produces a null pointer dereference in orig_hash_add_if(): http://www.open-mesh.org/ticket/146
The attached patch shall illustrate the problem, but I'm not quite satisfied with it. Although it seems to "fix" the problem and gets rid of the call trace, it is probably still very racy. Does anyone have an idea for a more sane but equally easy check to fix the issue? Or is the only sane solution to hold an rcu-lock and compare the hard_iface->soft_iface in hardif_enable_interface() with every hard-iface->net_dev from the hardif_list?
Cheers, Linus
Oh, it doesn't fix anything - it just works by accident. :) You are just happy that bat_priv->orig_hash is still memory that is accessible by us and is zero.
Let me suggest another patch (may take a while).
Best regards, Sven