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]
Date:	Wed, 27 Jun 2007 00:15:26 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	jchapman@...alix.com
Cc:	netdev@...r.kernel.org
Subject: Re: resend [PATCH 1/5 2.6.21] UDP: Introduce UDP encapsulation
 type for L2TP

From: James Chapman <jchapman@...alix.com>
Date: Sat, 26 May 2007 18:47:24 +0100

> This patch adds a new UDP_ENCAP_L2TPINUDP encapsulation type for UDP
> sockets. When a UDP socket's encap_type is UDP_ENCAP_L2TPINUDP, the
> skb is delivered to a function pointed to by udp_encap_l2tp_rcv. If
> the skb isn't wanted by L2TP, it returns >0, which causes it to be
> passed through to UDP. A funcptr is used for udp_encap_l2tp_rcv to 
> allow L2TP to be implemented as a kernel module.
> 
> Previously, the only user of UDP encap sockets was ESP, so when
> CONFIG_XFRM was not defined, some of the encap code was compiled 
> out. This patch changes that. As a result, udp_encap_rcv() will
> now do a little more work when CONFIG_XFRM is not defined. 
> 
> Signed-off-by: James Chapman <jchapman@...alix.com>
> 
> ---
> There are some magic numbers returned by udp_encap_rcv() that
> should perhaps now be made #defines. I chose not to do so in
> this patch.

I have no problem with the magic numbers in an initial version
of this stuff, but I do not like the function pointer.

It's error prone, invites mis-use, and will be difficult to safely
register/deregister properly.

Perhaps one good idea would be to store the encap handler in
the UDP socket info directly.  In this manner, the code which
sets up->encap_type can set the callback in the socket and
do appropriate locking and reference counting.
-
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