netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] hsr: fix several bugs in generic netlink callback
@ 2020-03-13  6:49 Taehee Yoo
  2020-03-16  8:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Taehee Yoo @ 2020-03-13  6:49 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: ap420073

This patchset is to fix several bugs they are related in
generic netlink callback in hsr module.

1. The first patch is to add missing rcu_read_lock() in
hsr_get_node_{list/status}().
The hsr_get_node_{list/status}() are not protected by RTNL because
they are callback functions of generic netlink.
But it calls __dev_get_by_index() without acquiring RTNL.
So, it would use unsafe data.

2. The second patch is to avoid failure of hsr_get_node_list().
hsr_get_node_list() is a callback of generic netlink and
it is used to get node information in userspace.
But, if there are so many nodes, it fails because of buffer size.
So, in this patch, restart routine is added.

3. The third patch is to set .netnsok flag to true.
If .netnsok flag is false, non-init_net namespace is not allowed to
operate generic netlink operations.
So, currently, non-init_net namespace has no way to get node information
because .netnsok is false in the current hsr code.

Change log:
v1->v2:
 - Preserve reverse christmas tree variable ordering in the second patch.

Taehee Yoo (3):
  hsr: use rcu_read_lock() in hsr_get_node_{list/status}()
  hsr: add restart routine into hsr_get_node_list()
  hsr: set .netnsok flag

 net/hsr/hsr_framereg.c |  9 ++----
 net/hsr/hsr_netlink.c  | 70 +++++++++++++++++++++++++-----------------
 2 files changed, 44 insertions(+), 35 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net v2 0/3] hsr: fix several bugs in generic netlink callback
  2020-03-13  6:49 [PATCH net v2 0/3] hsr: fix several bugs in generic netlink callback Taehee Yoo
@ 2020-03-16  8:46 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-16  8:46 UTC (permalink / raw)
  To: ap420073; +Cc: kuba, netdev

From: Taehee Yoo <ap420073@gmail.com>
Date: Fri, 13 Mar 2020 06:49:52 +0000

> This patchset is to fix several bugs they are related in
> generic netlink callback in hsr module.
> 
> 1. The first patch is to add missing rcu_read_lock() in
> hsr_get_node_{list/status}().
> The hsr_get_node_{list/status}() are not protected by RTNL because
> they are callback functions of generic netlink.
> But it calls __dev_get_by_index() without acquiring RTNL.
> So, it would use unsafe data.
> 
> 2. The second patch is to avoid failure of hsr_get_node_list().
> hsr_get_node_list() is a callback of generic netlink and
> it is used to get node information in userspace.
> But, if there are so many nodes, it fails because of buffer size.
> So, in this patch, restart routine is added.
> 
> 3. The third patch is to set .netnsok flag to true.
> If .netnsok flag is false, non-init_net namespace is not allowed to
> operate generic netlink operations.
> So, currently, non-init_net namespace has no way to get node information
> because .netnsok is false in the current hsr code.
> 
> Change log:
> v1->v2:
>  - Preserve reverse christmas tree variable ordering in the second patch.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-16  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-13  6:49 [PATCH net v2 0/3] hsr: fix several bugs in generic netlink callback Taehee Yoo
2020-03-16  8:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).