netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action()
@ 2020-10-20 15:34 Guillaume Nault
  2020-10-21  0:37 ` Cong Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Nault @ 2020-10-20 15:34 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski
  Cc: netdev, Jamal Hadi Salim, Cong Wang, Jiri Pirko, Po Liu

We need to jump to the "err_out_locked" label when
tcf_gate_get_entries() fails. Otherwise, tc_setup_flow_action() exits
with ->tcfa_lock still held.

Fixes: d29bdd69ecdd ("net: schedule: add action gate offloading")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
 net/sched/cls_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 41a55c6cbeb8..faeabff283a2 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3712,7 +3712,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
 			entry->gate.num_entries = tcf_gate_num_entries(act);
 			err = tcf_gate_get_entries(entry, act);
 			if (err)
-				goto err_out;
+				goto err_out_locked;
 		} else {
 			err = -EOPNOTSUPP;
 			goto err_out_locked;
-- 
2.21.3


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

* Re: [PATCH net] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action()
  2020-10-20 15:34 [PATCH net] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action() Guillaume Nault
@ 2020-10-21  0:37 ` Cong Wang
  2020-10-21  4:04   ` Jakub Kicinski
  2020-10-21  7:52   ` Guillaume Nault
  0 siblings, 2 replies; 4+ messages in thread
From: Cong Wang @ 2020-10-21  0:37 UTC (permalink / raw)
  To: Guillaume Nault
  Cc: David Miller, Jakub Kicinski, Linux Kernel Network Developers,
	Jamal Hadi Salim, Jiri Pirko, Po Liu

On Tue, Oct 20, 2020 at 8:34 AM Guillaume Nault <gnault@redhat.com> wrote:
>
> We need to jump to the "err_out_locked" label when
> tcf_gate_get_entries() fails. Otherwise, tc_setup_flow_action() exits
> with ->tcfa_lock still held.
>
> Fixes: d29bdd69ecdd ("net: schedule: add action gate offloading")
> Signed-off-by: Guillaume Nault <gnault@redhat.com>

Looks like the err_out label can be just removed after this patch?
If any compiler complains, you have to fix it in v2, otherwise can be in a
separate patch.

Other than this,

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks!

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

* Re: [PATCH net] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action()
  2020-10-21  0:37 ` Cong Wang
@ 2020-10-21  4:04   ` Jakub Kicinski
  2020-10-21  7:52   ` Guillaume Nault
  1 sibling, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2020-10-21  4:04 UTC (permalink / raw)
  To: Cong Wang
  Cc: Guillaume Nault, David Miller, Linux Kernel Network Developers,
	Jamal Hadi Salim, Jiri Pirko, Po Liu

On Tue, 20 Oct 2020 17:37:22 -0700 Cong Wang wrote:
> On Tue, Oct 20, 2020 at 8:34 AM Guillaume Nault <gnault@redhat.com> wrote:
> >
> > We need to jump to the "err_out_locked" label when
> > tcf_gate_get_entries() fails. Otherwise, tc_setup_flow_action() exits
> > with ->tcfa_lock still held.
> >
> > Fixes: d29bdd69ecdd ("net: schedule: add action gate offloading")
> > Signed-off-by: Guillaume Nault <gnault@redhat.com>  
> 
> Looks like the err_out label can be just removed after this patch?
> If any compiler complains, you have to fix it in v2, otherwise can be in a
> separate patch.
> 
> Other than this,
> 
> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied, thank you!

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

* Re: [PATCH net] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action()
  2020-10-21  0:37 ` Cong Wang
  2020-10-21  4:04   ` Jakub Kicinski
@ 2020-10-21  7:52   ` Guillaume Nault
  1 sibling, 0 replies; 4+ messages in thread
From: Guillaume Nault @ 2020-10-21  7:52 UTC (permalink / raw)
  To: Cong Wang
  Cc: David Miller, Jakub Kicinski, Linux Kernel Network Developers,
	Jamal Hadi Salim, Jiri Pirko, Po Liu

On Tue, Oct 20, 2020 at 05:37:22PM -0700, Cong Wang wrote:
> On Tue, Oct 20, 2020 at 8:34 AM Guillaume Nault <gnault@redhat.com> wrote:
> >
> > We need to jump to the "err_out_locked" label when
> > tcf_gate_get_entries() fails. Otherwise, tc_setup_flow_action() exits
> > with ->tcfa_lock still held.
> >
> > Fixes: d29bdd69ecdd ("net: schedule: add action gate offloading")
> > Signed-off-by: Guillaume Nault <gnault@redhat.com>
> 
> Looks like the err_out label can be just removed after this patch?

That'd require reworking the error path, as err_out is used there. I
don't feel that doing so would improve readability much.

> If any compiler complains, you have to fix it in v2, otherwise can be in a
> separate patch.
> 
> Other than this,
> 
> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks.


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

end of thread, other threads:[~2020-10-21  7:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 15:34 [PATCH net] net/sched: act_gate: Unlock ->tcfa_lock in tc_setup_flow_action() Guillaume Nault
2020-10-21  0:37 ` Cong Wang
2020-10-21  4:04   ` Jakub Kicinski
2020-10-21  7:52   ` Guillaume Nault

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).