summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2020-09-22 20:56:24 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-14 10:33:06 +0200
commit22e6625babfc1fe349032cd46237085b91aae076 (patch)
tree23781c50d8797a5c29e231ad82dfeb7d3e0126f7 /Makefile
parenta5de4ee6d055899b67bfb41722bbeb5c6e0fba70 (diff)
net_sched: commit action insertions together
commit 0fedc63fadf0404a729e73a35349481c8009c02f upstream. syzbot is able to trigger a failure case inside the loop in tcf_action_init(), and when this happens we clean up with tcf_action_destroy(). But, as these actions are already inserted into the global IDR, other parallel process could free them before tcf_action_destroy(), then we will trigger a use-after-free. Fix this by deferring the insertions even later, after the loop, and committing all the insertions in a separate loop, so we will never fail in the middle of the insertions any more. One side effect is that the window between alloction and final insertion becomes larger, now it is more likely that the loop in tcf_del_walker() sees the placeholder -EBUSY pointer. So we have to check for error pointer in tcf_del_walker(). Reported-and-tested-by: syzbot+2287853d392e4b42374a@syzkaller.appspotmail.com Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Cc: Vlad Buslov <vladbu@mellanox.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions