Re: [Patch net-next] net_sched: fix a potential out-of-bound access

2018-08-10 Thread Vlad Buslov
On Thu 09 Aug 2018 at 21:43, Cong Wang wrote: > On Thu, Aug 9, 2018 at 12:32 AM Vlad Buslov wrote: >> >> Before version V5 of my action API patchset this functionality was >> implemented in exactly the same way as in your patch. Unfortunately, it >> has a double-free bug. The problem is that if

Re: [Patch net-next] net_sched: fix a potential out-of-bound access

2018-08-09 Thread Cong Wang
On Thu, Aug 9, 2018 at 12:32 AM Vlad Buslov wrote: > > Before version V5 of my action API patchset this functionality was > implemented in exactly the same way as in your patch. Unfortunately, it > has a double-free bug. The problem is that if you have multiple > actions(N) being deleted, and dele

Re: [Patch net-next] net_sched: fix a potential out-of-bound access

2018-08-09 Thread Vlad Buslov
On Wed 08 Aug 2018 at 21:32, Cong Wang wrote: > In tca_action_gd(), when tcf_action_get_1() fails in the middle > of the loop, tcf_action_put_many(&actions[acts_deleted]) is > called to cleanup. > > But inside tcf_action_put_many() it still iterates from > 0 to TCA_ACT_MAX_PRIO, so inside it would

[Patch net-next] net_sched: fix a potential out-of-bound access

2018-08-08 Thread Cong Wang
In tca_action_gd(), when tcf_action_get_1() fails in the middle of the loop, tcf_action_put_many(&actions[acts_deleted]) is called to cleanup. But inside tcf_action_put_many() it still iterates from 0 to TCA_ACT_MAX_PRIO, so inside it would be: &actions[acts_deleted][0]...&actions[acts_deleted][M