Peter Zijlstra wrote:
> On Mon, Nov 13, 2017 at 08:21:59AM +0100, Florian Westphal wrote:
> > Reason is that some places do this:
> >
> > rtnl_register(pf, RTM_FOO, doit, NULL, 0);
> > rtnl_register(pf, RTM_FOO, NULL, dumpit, 0);
>
> Sure, however,
>
> > (from different call sites in the stack)
On Mon, Nov 13, 2017 at 08:21:59AM +0100, Florian Westphal wrote:
> Reason is that some places do this:
>
> rtnl_register(pf, RTM_FOO, doit, NULL, 0);
> rtnl_register(pf, RTM_FOO, NULL, dumpit, 0);
Sure, however,
> (from different call sites in the stack).
> > - if (doit)
> > - tab[m
Peter Zijlstra wrote:
> On Tue, Nov 07, 2017 at 10:47:51AM +0100, Florian Westphal wrote:
> > I would expect this to trigger all the time, due to
> >
> > rtnl_register(AF_INET, RTM_GETROUTE, ...
> > rtnl_register(AF_INET, RTM_GETADDR, ...
>
> Ah, sure, then something like so then...
>
> There's
On Tue, 7 Nov 2017 15:57:36 +0100
Peter Zijlstra wrote:
> + link = tab[msgindex];
> + rcu_assign_pointer(tab[msgindex], NULL);
It is not necessary (or useful) to use rcu_assign_pointer with NULL.
The rcu_assign_pointer used to special case NULL but doesn't in recent
years.
On Tue, Nov 07, 2017 at 10:47:51AM +0100, Florian Westphal wrote:
> I would expect this to trigger all the time, due to
>
> rtnl_register(AF_INET, RTM_GETROUTE, ...
> rtnl_register(AF_INET, RTM_GETADDR, ...
Ah, sure, then something like so then...
There's bound to be bugs there too, as I pretty
Peter Zijlstra wrote:
> Something like the below would go some way toward sanitizing this stuff;
> rcu_assign_pointer() is a store-release, meaning it happens after
> everything coming before.
>
> Therefore, when you observe that tab (through rcu_dereference) you're
> guaranteed to see the thing
Peter Zijlstra wrote:
> > rtnetlink_rcv_msg:
> >
> > 4406 dumpit = READ_ONCE(handlers[type].dumpit);
> > 4407 if (!dumpit)
> > 4408 goto err_unlock;
> > 4409 owner = READ_ONCE(handlers[type].ow
On Tue, Nov 07, 2017 at 10:10:04AM +0100, Peter Zijlstra wrote:
> On Tue, Nov 07, 2017 at 07:11:56AM +0100, Florian Westphal wrote:
> > Peter Zijlstra wrote:
> > > On Mon, Nov 06, 2017 at 11:51:07AM +0100, Florian Westphal wrote:
> > > > @@ -180,6 +164,12 @@ int __rtnl_register(int protocol, int m
On Tue, Nov 07, 2017 at 07:11:56AM +0100, Florian Westphal wrote:
> Peter Zijlstra wrote:
> > On Mon, Nov 06, 2017 at 11:51:07AM +0100, Florian Westphal wrote:
> > > @@ -180,6 +164,12 @@ int __rtnl_register(int protocol, int msgtype,
> > > rcu_assign_pointer(rtnl_msg_handlers[protocol],
Peter Zijlstra wrote:
> On Mon, Nov 06, 2017 at 11:51:07AM +0100, Florian Westphal wrote:
> > @@ -180,6 +164,12 @@ int __rtnl_register(int protocol, int msgtype,
> > rcu_assign_pointer(rtnl_msg_handlers[protocol], tab);
> > }
> >
> > + WARN_ON(tab[msgindex].owner && tab[msginde
On Mon, Nov 06, 2017 at 11:51:07AM +0100, Florian Westphal wrote:
> @@ -180,6 +164,12 @@ int __rtnl_register(int protocol, int msgtype,
> rcu_assign_pointer(rtnl_msg_handlers[protocol], tab);
> }
>
> + WARN_ON(tab[msgindex].owner && tab[msgindex].owner != owner);
> +
> +
Add yet another rtnl_register function. It will be used by modules
that can be removed.
The passed module struct is used to take a reference while a netlink
dump is in progress to prevent module unload while netlink core can
invoke registered dumper function again.
Signed-off-by: Florian Westpha
12 matches
Mail list logo