[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180124.163716.301711852222011274.davem@davemloft.net>
Date: Wed, 24 Jan 2018 16:37:16 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: eyal.birger@...il.com
Cc: jhs@...atatu.com, xiyou.wangcong@...il.com, netdev@...r.kernel.org,
pablo@...filter.org, shmulik@...anetworks.com,
eyal@...anetworks.com
Subject: Re: [PATCH net-next 2/2] net: sched: add em_ipt ematch for calling
xtables matches
From: Eyal Birger <eyal.birger@...il.com>
Date: Tue, 23 Jan 2018 11:17:32 +0200
> + network_offset = skb_network_offset(skb);
> + skb_pull(skb, network_offset);
> +
> + rcu_read_lock();
> +
> + if (skb->skb_iif)
> + indev = dev_get_by_index_rcu(em->net, skb->skb_iif);
> +
> + nf_hook_state_init(&state, im->hook, im->nfproto, indev ?: skb->dev,
> + skb->dev, NULL, em->net, NULL);
> +
> + acpar.match = im->match;
> + acpar.matchinfo = im->match_data;
> + acpar.state = &state;
> +
> + ret = im->match->match(skb, &acpar);
> +
> + rcu_read_unlock();
> +
> + skb_push(skb, network_offset);
If the SKB is shared in any way, this pull/push around the NF hook
invocation is illegal.
Powered by blists - more mailing lists