lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6d6a94c50704160302n14f8bf14l3c9f2a380f74dd3f@mail.gmail.com>
Date:	Mon, 16 Apr 2007 18:02:09 +0800
From:	"Aubrey Li" <aubreylee@...il.com>
To:	"Stephen Hemminger" <shemminger@...ux-foundation.org>
Cc:	"Herbert Xu" <herbert@...dor.apana.org.au>,
	"Matt Mackall" <mpm@...enic.com>, netdev@...r.kernel.org,
	"Linux Kernel" <linux-kernel@...r.kernel.org>
Subject: Re: udp checksum issue in netpoll mode.

On 4/12/07, Stephen Hemminger <shemminger@...ux-foundation.org> wrote:
> Aubrey Li wrote:
> > I think we discussed this issue before.
> >
> > The current checksum function doesn't consider the kind of packet
> > which is padded to reach a specific minimum length. I believe that's
> > the problem caused my test case failed. Is this issue fixed? Or is it
> > acceptable if I make a patch not calculating this kind of packet?
> >
> > Thanks,
> > -Aubrey
> The caller should be trimming the packet and updating the hardware checksum
> value (like the normal UDP path).
>
OK, the following patch fixed the problem.

Signed-off-by: Aubrey.Li <aubreylee@...il.com>
---
 net/core/netpoll.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 823215d..522e441 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -471,6 +471,13 @@ int __netpoll_rx(struct sk_buff *skb)
 	if (skb->len < len || len < iph->ihl*4)
 		goto out;

+	/*
+	 * Our transport medium may have padded the buffer out.
+	 * Now We trim to the true length of the frame.
+	 */
+	if (pskb_trim_rcsum(skb, len))
+		goto out;
+
 	if (iph->protocol != IPPROTO_UDP)
 		goto out;

-- 
1.5.1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ