Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 6 Mar 2011 15:50:26 +0300
From: Vasiliy Kulikov <segoon@...nwall.com>
To: owl-users@...ts.openwall.com
Subject: Re: vlan support broken?

Piotr,

The patch for the issue is attached to this mail.  It will be applied in
the next kernel package update.

Feel free to report another bugs in Owl ;)

-- 
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments

diff -u linux-2.6.18/net/ipv4/ping.c linux-2.6.18/net/ipv4/ping.c
--- linux-2.6.18/net/ipv4/ping.c	2011-02-10 18:44:33 +0000
+++ linux-2.6.18/net/ipv4/ping.c	2011-03-06 11:12:31 +0000
@@ -485,10 +485,6 @@
 			    &pfh->wcheck))
 			return -EFAULT;
 
-		pfh->wcheck = csum_partial((char *)&pfh->icmph,
-			sizeof(struct icmphdr), pfh->wcheck);
-		pfh->icmph.checksum = csum_fold(pfh->wcheck);
-		memcpy(to, &pfh->icmph, sizeof(struct icmphdr));
 		return 0;
 	}
 	if (offset < sizeof(struct icmphdr))
@@ -500,6 +496,19 @@
 	return 0;
 }
 
+static int ping_push_pending_frames(struct sock *sk, struct pingfakehdr *pfh)
+{
+	struct sk_buff *skb = skb_peek(&sk->sk_write_queue);
+
+	pfh->wcheck = csum_partial((char *)&pfh->icmph,
+		sizeof(struct icmphdr), pfh->wcheck);
+	pfh->icmph.checksum = csum_fold(pfh->wcheck);
+	memcpy(skb->h.icmph, &pfh->icmph, sizeof(struct icmphdr));
+	skb->ip_summed = CHECKSUM_NONE;
+
+	return ip_push_pending_frames(sk);
+}
+
 int ping_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 		 size_t len)
 {
@@ -642,7 +651,7 @@
 	if (err)
 		ip_flush_pending_frames(sk);
 	else
-		err = ip_push_pending_frames(sk);
+		err = ping_push_pending_frames(sk, &pfh);
 	release_sock(sk);
 
 out:
reverted:

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ