[NETFILTER]: Backport fixes for ip6t_multiport
Linux Kernel Mailing List <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.2-4 |
|---|---|
| Message-ID | <[email protected]> |
ChangeSet 1.1545, 2004/12/21 17:45:41+01:00, [email protected] [NETFILTER]: Backport fixes for ip6t_multiport This patch fixes following bugs in ip6t_multiport.c: - missing check the size of the preference data. - IP6T_INV_PROTO should check with not ip->flags but ip->invflags. Signed-off-by: Yasuyuki KOZAKAI <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> ip6t_multiport.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) diff -Nru a/net/ipv6/netfilter/ip6t_multiport.c b/net/ipv6/netfilter/ip6t_multiport.c --- a/net/ipv6/netfilter/ip6t_multiport.c 2005-01-15 07:04:46 -08:00 +++ b/net/ipv6/netfilter/ip6t_multiport.c 2005-01-15 07:04:46 -08:00 @@ -74,9 +74,12 @@ { const struct ip6t_multiport *multiinfo = matchinfo; + if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_multiport))) + return 0; + /* Must specify proto == TCP/UDP, no unknown flags or bad count */ return (ip->proto == IPPROTO_TCP || ip->proto == IPPROTO_UDP) - && !(ip->flags & IP6T_INV_PROTO) + && !(ip->invflags & IP6T_INV_PROTO) && matchsize == IP6T_ALIGN(sizeof(struct ip6t_multiport)) && (multiinfo->flags == IP6T_MULTIPORT_SOURCE || multiinfo->flags == IP6T_MULTIPORT_DESTINATION