Florian Westphal d38a65125f rtnetlink: init handler refcounts to 1
If using CONFIG_REFCOUNT_FULL=y we get following splat:
 refcount_t: increment on 0; use-after-free.
WARNING: CPU: 0 PID: 304 at lib/refcount.c:152 refcount_inc+0x47/0x50
Call Trace:
 rtnetlink_rcv_msg+0x191/0x260
 ...

This warning is harmless (0 is "no callback running", not "memory
was freed").

Use '1' as the new 'no handler is running' base instead of 0 to avoid
this.

Fixes: 019a316992ee ("rtnetlink: add reference counting to prevent module unload while dump is in progress")
Reported-by: Sabrina Dubroca <sdubroca@redhat.com>
Reported-by: kernel test robot <fengguang.wu@intel.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-08-10 09:50:22 -07:00
..
2017-04-12 22:02:40 +02:00
2017-08-09 22:43:50 -07:00
2017-08-01 15:26:19 -07:00
2017-07-18 11:13:41 -07:00
2017-08-01 15:26:19 -07:00
2017-07-21 16:26:01 -07:00
2017-08-03 09:13:51 -07:00
2017-06-15 12:12:40 -04:00
2017-06-15 12:12:40 -04:00