netfilter: major amanda helper update
Subsystems (2)
PATCH 1/1 netfilter: major amanda helper update
Hi Dave!
This mail contains the third netfilter patch, please apply.
Author: Patrick McHardy <[email protected]>
Fix various issues with the amanda conntrack+NAT helpers
ip_conntrack_amanda:
- udp checksum checked even if not set
- memory not validated to be inside packet at all or validated like
this: if (*data and data < data_limit)
- would create expectation with port 0 which makes nat-helper throw away packet (which makes exploiting the race-condition trivial even on UP)
- expectation had no mask.src.* set so connections were accepted from anywhere
- helper_unregister called after failed helper_register
ip_nat_amanda:
- drops packet if amanda_data_fixup fails without clearing the offset field in the expectation which is used as a flag to indicate that the current packet needs mangling. Problem arises from the fact that the conntrack helper creates multiple expectations at once and even if it clears the offset field for the current expectation the following expectations will not have it cleared and will mangle the next packet they see.
- same unregister after failed register problem
include/linux/netfilter_ipv4/ip_conntrack_amanda.h +2 -19
@@ -2,28 +2,11 @@#define _IP_CONNTRACK_AMANDA_H/* AMANDA tracking. */ -#ifdef __KERNEL__ - -#include <linux/netfilter_ipv4/lockhelp.h> - -/* Protects amanda part of conntracks */ -DECLARE_LOCK_EXTERN (ip_amanda_lock); - -#endif - -struct conn { -char * match; -int matchlen; -}; - -#define NUM_MSGS 3 - -struct ip_ct_amanda_expect {u_int16_t port;/* port number of this expectation */ -u_int16_t offset;/* offset of the port specification in ctrl packet */ -u_int16_t len;/* the length of the port number specification */ +u_int16_t offset;/* offset of port in ctrl packet */ +u_int16_t len;/* length of the port number string */ };#endif /* _IP_CONNTRACK_AMANDA_H */
net/ipv4/netfilter/ip_conntrack_amanda.c +57 -148
269 lines not on this page · raw message
net/ipv4/netfilter/ip_nat_amanda.c +42 -120
254 lines not on this page · raw message
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
David S. Miller
AppliedQuoted 3 lines · On Sun, 30 Nov 2003 18:20:33 +0530 Harald Welte <[email protected]> wrote:
Author: Patrick McHardy <[email protected]>
Fix various issues with the amanda conntrack+NAT helpers
Applied, thanks.