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: <468D0879.4080903@trash.net>
Date:	Thu, 05 Jul 2007 17:04:25 +0200
From:	Patrick McHardy <kaber@...sh.net>
To:	James Chapman <jchapman@...alix.com>
CC:	derek@...fp.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-2.6.23] UDP: Cleanup UDP encapsulation code

James Chapman wrote:

> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index b9276f8..777d5e8 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -70,7 +70,8 @@
>   *	Alexey Kuznetsov:		allow both IPv4 and IPv6 sockets to bind
>   *					a single port at the same time.
>   *	Derek Atkins <derek@...fp.com>: Add Encapulation Support
> - *	James Chapman		:	Add L2TP encapsulation type.
> + *	James Chapman		:	Use socket's encap_rcv for all encapsulated
> + *					protocols..

We have git for changelogs, please don't add to this.

> -				}
> +		unsigned int len;
>  
> -				/* FALLTHROUGH -- pass up as UDP packet */
> +		/* if we're overly short, let UDP handle it */
> +		len = skb->len - sizeof(struct udphdr);
> +		if (len <= 0)
> +			goto udp;
> +
> +		if (up->encap_rcv != NULL) {
> +			int ret;
> +
> +			ret = (*up->encap_rcv)(sk, skb);
> +			if (ret == 0)
> +				goto out;
> +			if (ret < 0) {
> +				/* Eat the packet .. */
> +				kfree_skb(skb);
> +				goto out;
>  			}


This doesn't seem to handle encapsulated transport mode packets.
In that case xfrm4_rcv_encap returns the negative decapsulated
protocol number, you change it to a positive number again:

> +	ret = xfrm4_rcv_encap(skb, encap_type);
> +	return -ret;

and then continue to process it as UDP. What should happen in
that case is that the negative protocol value is returned to
ip_local_deliver_finish.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ