diff options
author | Florian Westphal | 2023-06-27 14:38:12 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-07-19 16:22:01 +0200 |
commit | 946edfb7d436df99e02d3d18bc8972b5542354d9 (patch) | |
tree | 081d5667b05c17287c8e42e508f303e039ffd69f /drivers | |
parent | a6c9b0f7ba95311d797b6c5341b4e3ecdb920796 (diff) |
net/sched: act_ipt: add sanity checks on skb before calling target
[ Upstream commit b2dc32dcba08bf55cec600caa76f4afd2e3614df ]
Netfilter targets make assumptions on the skb state, for example
iphdr is supposed to be in the linear area.
This is normally done by IP stack, but in act_ipt case no
such checks are made.
Some targets can even assume that skb_dst will be valid.
Make a minimum effort to check for this:
- Don't call the targets eval function for non-ipv4 skbs.
- Don't call the targets eval function for POSTROUTING
emulation when the skb has no dst set.
v3: use skb_protocol helper (Davide Caratti)
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions