Re: Passive OS fingerprint xtables match.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Evgeniy Polyakov
Date: Tuesday, March 10, 2009 - 9:01 am

On Tue, Mar 10, 2009 at 06:13:57PM +0300, Evgeniy Polyakov (zbr@ioremap.net) wrote:

Not the latest version, it misses the following fix from the parallel
tree.

    Fixed TCP header copy to the userspace when given option is enabled.

diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 3114bbd..e619f09 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -83,7 +83,7 @@ static void ipt_osf_send_connector(struct ipt_osf_user_finger *f,
 	struct ipt_osf_message *msg = &per_cpu(ipt_osf_mbuf, smp_processor_id());
 	struct ipt_osf_nlmsg *data = &msg->nlmsg;
 	struct iphdr *iph = ip_hdr(skb);
-	struct tcphdr *tcph = tcp_hdr(skb);
+	struct tcphdr *tcp;
 
 	memcpy(&msg->cmsg.id, &cn_osf_id, sizeof(struct cn_msg));
 	msg->cmsg.seq = osf_seq++;
@@ -92,7 +92,9 @@ static void ipt_osf_send_connector(struct ipt_osf_user_finger *f,
 
 	memcpy(&data->f, f, sizeof(struct ipt_osf_user_finger));
 	memcpy(&data->ip, iph, sizeof(struct iphdr));
-	memcpy(&data->tcp, tcph, sizeof(struct tcphdr));
+	tcp = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(struct tcphdr), &data->tcp);
+	if (tcp)
+		memcpy(&data->tcp, tcp, sizeof(struct tcphdr));
 
 	cn_netlink_send(&msg->cmsg, CN_IDX_OSF, GFP_ATOMIC);
 }


-- 
	Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Passive OS fingerprint xtables match., Evgeniy Polyakov, (Tue Mar 10, 8:13 am)
Re: Passive OS fingerprint xtables match., Evgeniy Polyakov, (Tue Mar 10, 9:01 am)
Re: Passive OS fingerprint xtables match., Jan Engelhardt, (Tue Mar 10, 9:07 am)
Re: Passive OS fingerprint xtables match (iptables), Jan Engelhardt, (Tue Mar 10, 9:12 am)
Re: Passive OS fingerprint xtables match., Jesper Dangaard Brouer, (Tue Mar 10, 2:01 pm)
Re: Passive OS fingerprint xtables match., Evgeniy Polyakov, (Tue Mar 10, 2:54 pm)
Re: Passive OS fingerprint xtables match., Pablo Neira Ayuso, (Wed Mar 11, 2:54 am)
Re: Passive OS fingerprint xtables match., Evgeniy Polyakov, (Wed Mar 11, 3:00 am)
Re: Passive OS fingerprint xtables match., Evgeniy Polyakov, (Wed Mar 11, 2:43 pm)
Re: Passive OS fingerprint xtables match., Patrick McHardy, (Mon Mar 16, 7:40 am)
Re: Passive OS fingerprint xtables match., Patrick McHardy, (Mon Mar 16, 7:42 am)