Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: openvswitch: fixes crash if nf_conncount_init() fails
@ 2020-08-31 9:57 Eelco Chaudron
2020-09-01 13:07 ` [ovs-dev] " Tonghao Zhang
2020-09-01 20:12 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Eelco Chaudron @ 2020-08-31 9:57 UTC (permalink / raw)
To: netdev; +Cc: davem, dev, kuba, pabeni, pshelar
If nf_conncount_init fails currently the dispatched work is not canceled,
causing problems when the timer fires. This change fixes this by not
scheduling the work until all initialization is successful.
Fixes: a65878d6f00b ("net: openvswitch: fixes potential deadlock in dp cleanup code")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
---
net/openvswitch/datapath.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 6e47ef7ef036..78941822119f 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -2476,13 +2476,19 @@ static int __init dp_register_genl(void)
static int __net_init ovs_init_net(struct net *net)
{
struct ovs_net *ovs_net = net_generic(net, ovs_net_id);
+ int err;
INIT_LIST_HEAD(&ovs_net->dps);
INIT_WORK(&ovs_net->dp_notify_work, ovs_dp_notify_wq);
INIT_DELAYED_WORK(&ovs_net->masks_rebalance, ovs_dp_masks_rebalance);
+
+ err = ovs_ct_init(net);
+ if (err)
+ return err;
+
schedule_delayed_work(&ovs_net->masks_rebalance,
msecs_to_jiffies(DP_MASKS_REBALANCE_INTERVAL));
- return ovs_ct_init(net);
+ return 0;
}
static void __net_exit list_vports_from_net(struct net *net, struct net *dnet,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [ovs-dev] [PATCH net-next] net: openvswitch: fixes crash if nf_conncount_init() fails
2020-08-31 9:57 [PATCH net-next] net: openvswitch: fixes crash if nf_conncount_init() fails Eelco Chaudron
@ 2020-09-01 13:07 ` Tonghao Zhang
2020-09-01 20:12 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Tonghao Zhang @ 2020-09-01 13:07 UTC (permalink / raw)
To: Eelco Chaudron
Cc: Linux Kernel Network Developers, ovs dev, Jakub Kicinski,
Paolo Abeni, David Miller
On Mon, Aug 31, 2020 at 5:58 PM Eelco Chaudron <echaudro@redhat.com> wrote:
>
> If nf_conncount_init fails currently the dispatched work is not canceled,
> causing problems when the timer fires. This change fixes this by not
> scheduling the work until all initialization is successful.
>
> Fixes: a65878d6f00b ("net: openvswitch: fixes potential deadlock in dp cleanup code")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> net/openvswitch/datapath.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> index 6e47ef7ef036..78941822119f 100644
> --- a/net/openvswitch/datapath.c
> +++ b/net/openvswitch/datapath.c
> @@ -2476,13 +2476,19 @@ static int __init dp_register_genl(void)
> static int __net_init ovs_init_net(struct net *net)
> {
> struct ovs_net *ovs_net = net_generic(net, ovs_net_id);
> + int err;
>
> INIT_LIST_HEAD(&ovs_net->dps);
> INIT_WORK(&ovs_net->dp_notify_work, ovs_dp_notify_wq);
> INIT_DELAYED_WORK(&ovs_net->masks_rebalance, ovs_dp_masks_rebalance);
> +
> + err = ovs_ct_init(net);
> + if (err)
> + return err;
> +
> schedule_delayed_work(&ovs_net->masks_rebalance,
> msecs_to_jiffies(DP_MASKS_REBALANCE_INTERVAL));
> - return ovs_ct_init(net);
> + return 0;
> }
>
> static void __net_exit list_vports_from_net(struct net *net, struct net *dnet,
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
--
Best regards, Tonghao
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: openvswitch: fixes crash if nf_conncount_init() fails
2020-08-31 9:57 [PATCH net-next] net: openvswitch: fixes crash if nf_conncount_init() fails Eelco Chaudron
2020-09-01 13:07 ` [ovs-dev] " Tonghao Zhang
@ 2020-09-01 20:12 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-09-01 20:12 UTC (permalink / raw)
To: echaudro; +Cc: netdev, dev, kuba, pabeni, pshelar
From: Eelco Chaudron <echaudro@redhat.com>
Date: Mon, 31 Aug 2020 11:57:57 +0200
> If nf_conncount_init fails currently the dispatched work is not canceled,
> causing problems when the timer fires. This change fixes this by not
> scheduling the work until all initialization is successful.
>
> Fixes: a65878d6f00b ("net: openvswitch: fixes potential deadlock in dp cleanup code")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-01 20:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 9:57 [PATCH net-next] net: openvswitch: fixes crash if nf_conncount_init() fails Eelco Chaudron
2020-09-01 13:07 ` [ovs-dev] " Tonghao Zhang
2020-09-01 20:12 ` 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).