mbox series

[net,0/4] net/sched: Fix a system panic when deleting filters

Message ID 1508142702-3312-1-git-send-email-chrism@mellanox.com
Headers show
Series net/sched: Fix a system panic when deleting filters | expand

Message

Chris Mi Oct. 16, 2017, 8:31 a.m. UTC
If some filters share the same action, when deleting these filters,
system may panic. This patchset fixes this issue. And the test case
finding this issue is also integrated into tc test suite of selftests.

Chris Mi (4):
  net/sched: Change tc_action refcnt and bindcnt to atomic
  net/sched: Use action array instead of action list as parameter
  selftests: Introduce a new script to generate tc batch file
  selftests: Introduce a new test case to tc testsuite

 include/net/act_api.h                              |  11 +-
 net/sched/act_api.c                                | 124 +++++++++++++--------
 net/sched/act_bpf.c                                |   4 +-
 net/sched/act_connmark.c                           |   4 +-
 net/sched/act_csum.c                               |   4 +-
 net/sched/act_gact.c                               |   4 +-
 net/sched/act_ife.c                                |   4 +-
 net/sched/act_ipt.c                                |   4 +-
 net/sched/act_mirred.c                             |   4 +-
 net/sched/act_nat.c                                |   4 +-
 net/sched/act_pedit.c                              |   4 +-
 net/sched/act_police.c                             |   4 +-
 net/sched/act_sample.c                             |   4 +-
 net/sched/act_simple.c                             |   4 +-
 net/sched/act_skbedit.c                            |   4 +-
 net/sched/act_skbmod.c                             |   4 +-
 net/sched/act_tunnel_key.c                         |   4 +-
 net/sched/act_vlan.c                               |   4 +-
 net/sched/cls_api.c                                |  18 +--
 .../tc-testing/tc-tests/filters/tests.json         |  23 +++-
 tools/testing/selftests/tc-testing/tdc.py          |  20 +++-
 tools/testing/selftests/tc-testing/tdc_batch.py    |  62 +++++++++++
 tools/testing/selftests/tc-testing/tdc_config.py   |   2 +
 23 files changed, 222 insertions(+), 102 deletions(-)
 create mode 100755 tools/testing/selftests/tc-testing/tdc_batch.py

Comments

Jamal Hadi Salim Oct. 16, 2017, 11:06 a.m. UTC | #1
Hi Chris,

On 17-10-16 04:31 AM, Chris Mi wrote:
> If some filters share the same action, when deleting these filters,
> system may panic. This patchset fixes this issue. And the test case
> finding this issue is also integrated into tc test suite of selftests.
>

I think this would read better if re-worded as:
---
If some filters share the same action, when deleting these filters,
it is possible to create a system panic. This is because deletions
could be manipulated by many RCU callbacks at the same time.
This patch set fixes these issues.
To reproduce the issue run selftests in patch 3 and 4.
To test if the issue was fixed, apply patches 1 and 2 and
then repeat the tests.
------

Other than that all look good to me and:

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal
Chris Mi Oct. 16, 2017, 11:20 a.m. UTC | #2
Hi Jamal,

> -----Original Message-----

> From: Jamal Hadi Salim [mailto:jhs@mojatatu.com]

> Sent: Monday, October 16, 2017 7:06 PM

> To: Chris Mi <chrism@mellanox.com>; netdev@vger.kernel.org

> Cc: lucasb@mojatatu.com; xiyou.wangcong@gmail.com; jiri@resnulli.us;

> davem@davemloft.net

> Subject: Re: [patch net 0/4] net/sched: Fix a system panic when deleting

> filters

> 

> 

> Hi Chris,

> 

> On 17-10-16 04:31 AM, Chris Mi wrote:

> > If some filters share the same action, when deleting these filters,

> > system may panic. This patchset fixes this issue. And the test case

> > finding this issue is also integrated into tc test suite of selftests.

> >

> 

> I think this would read better if re-worded as:

> ---

> If some filters share the same action, when deleting these filters, it is

> possible to create a system panic. This is because deletions could be

> manipulated by many RCU callbacks at the same time.

> This patch set fixes these issues.

> To reproduce the issue run selftests in patch 3 and 4.

> To test if the issue was fixed, apply patches 1 and 2 and then repeat the tests.

> ------

Done.
> 

> Other than that all look good to me and:

> 

> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

Done. And thanks for your review.

Thanks,
Chris
> 

> cheers,

> jamal