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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=KRAcoonwFHKNaptap2LQHDswRCGpect82aHzx@mail.gmail.com>
Date:	Thu, 28 Oct 2010 20:51:43 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Balazs Scheidler <bazsi@...abit.hu>,
	KOVACS Krisztian <hidden@...abit.hu>,
	Patrick McHardy <kaber@...sh.net>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	netfilter-devel@...r.kernel.org
Subject: Re: tproxy: added IPv6 support to the socket match

On Sat, Oct 23, 2010 at 21:23, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/b64c9256a9b76fc9f059f71bd08ba88fb0cbba2e
> Commit:     b64c9256a9b76fc9f059f71bd08ba88fb0cbba2e
> Parent:     6ad7889327a5ee6ab4220bd34e4428c7d0de0f32
> Author:     Balazs Scheidler <bazsi@...abit.hu>
> AuthorDate: Thu Oct 21 16:19:42 2010 +0200
> Committer:  Patrick McHardy <kaber@...sh.net>
> CommitDate: Thu Oct 21 16:19:42 2010 +0200
>
>    tproxy: added IPv6 support to the socket match
>
>    The ICMP extraction bits were contributed by Harry Mason.
>
>    Signed-off-by: Balazs Scheidler <bazsi@...abit.hu>
>    Signed-off-by: KOVACS Krisztian <hidden@...abit.hu>
>    Signed-off-by: Patrick McHardy <kaber@...sh.net>
> ---
>  net/netfilter/xt_socket.c |  165 ++++++++++++++++++++++++++++++++++++++++++---
>  1 files changed, 154 insertions(+), 11 deletions(-)
>
> diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
> index 266faa0..2dbd4c8 100644
> --- a/net/netfilter/xt_socket.c
> +++ b/net/netfilter/xt_socket.c

> +static bool
> +socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)
> +{
> +       struct ipv6hdr *iph = ipv6_hdr(skb);
> +       struct udphdr _hdr, *hp = NULL;
> +       struct sock *sk;
> +       struct in6_addr *daddr, *saddr;
> +       __be16 dport, sport;
> +       int thoff;
> +       u8 tproto;

tproto is unsigned...

> +       const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo;
> +
> +       tproto = ipv6_find_hdr(skb, &thoff, -1, NULL);

but ipv6_find_hdr() returns int, and negative values for errors...

> +       if (tproto < 0) {

which it can never catch.

> +               pr_debug("unable to find transport header in IPv6 packet, dropping\n");
> +               return NF_DROP;
> +       }

net/netfilter/xt_socket.c:256: warning: comparison is always false due
to limited range of data type

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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