Skip to content

Commit 64466c4

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Release bridge info once packet escapes the br_netfilter path, from Florian Westphal. 2) Revert incorrect fix for the SCTP connection tracking chunk iterator, also from Florian. First path fixes a long standing issue, the second path addresses a mistake in the previous pull request for net. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: Revert "netfilter: conntrack: fix bug in for_each_sctp_chunk" netfilter: br_netfilter: disable sabotage_in hook after first suppression ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents afc2336 + bd0e06f commit 64466c4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

net/bridge/br_netfilter_hooks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ static unsigned int ip_sabotage_in(void *priv,
871871
if (nf_bridge && !nf_bridge->in_prerouting &&
872872
!netif_is_l3_master(skb->dev) &&
873873
!netif_is_l3_slave(skb->dev)) {
874+
nf_bridge_info_free(skb);
874875
state->okfn(state->net, state->sk, skb);
875876
return NF_STOLEN;
876877
}

net/netfilter/nf_conntrack_proto_sctp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
142142
}
143143
#endif
144144

145+
/* do_basic_checks ensures sch->length > 0, do not use before */
145146
#define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \
146147
for ((offset) = (dataoff) + sizeof(struct sctphdr), (count) = 0; \
147-
((sch) = skb_header_pointer((skb), (offset), sizeof(_sch), &(_sch))) && \
148-
(sch)->length; \
148+
(offset) < (skb)->len && \
149+
((sch) = skb_header_pointer((skb), (offset), sizeof(_sch), &(_sch))); \
149150
(offset) += (ntohs((sch)->length) + 3) & ~3, (count)++)
150151

151152
/* Some validity checks to make sure the chunks are fine */

0 commit comments

Comments
 (0)