From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [PATCH net-next v6 11/11] net: sched: change action API to use array of pointers to actions Date: Tue, 7 Aug 2018 16:26:13 -0700 Message-ID: References: <1530800673-12280-1-git-send-email-vladbu@mellanox.com> <1530800673-12280-12-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , Jiri Pirko , Alexei Starovoitov , Daniel Borkmann , Yevgeny Kliteynik To: Vlad Buslov Return-path: Received: from mail-pf1-f194.google.com ([209.85.210.194]:40218 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbeHHBnJ (ORCPT ); Tue, 7 Aug 2018 21:43:09 -0400 Received: by mail-pf1-f194.google.com with SMTP id e13-v6so164458pff.7 for ; Tue, 07 Aug 2018 16:26:25 -0700 (PDT) In-Reply-To: <1530800673-12280-12-git-send-email-vladbu@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: > attr_size = tcf_action_full_attrs_size(attr_size); > > if (event == RTM_GETACTION) > - ret = tcf_get_notify(net, portid, n, &actions, event, extack); > + ret = tcf_get_notify(net, portid, n, actions, event, extack); > else { /* delete */ > - ret = tcf_del_notify(net, n, &actions, portid, attr_size, extack); > + ret = tcf_del_notify(net, n, actions, &acts_deleted, portid, > + attr_size, extack); > if (ret) > goto err; > return ret; > } > err: > - tcf_action_put_lst(&actions); > + tcf_action_put_many(&actions[acts_deleted]); > return ret; How does this even work? You save an index in 'acts_deleted', but you pass &actions[acts_deleted] to tcf_action_put_many(), which seems you want to start from where it fails, but inside tcf_action_put_many() it starts from 0 to TCA_ACT_MAX_PRIO, out-of-bound access at least?