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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1333299322.2325.5277.camel@edumazet-glaptop>
Date:	Sun, 01 Apr 2012 18:55:22 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Pablo Neira Ayuso <pablo@...filter.org>
Cc:	Changli Gao <xiaosuo@...il.com>, Patrick McHardy <kaber@...sh.net>,
	"David S. Miller" <davem@...emloft.net>,
	netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] netfilter: check the length of the data before
 dereferencing it

On Sun, 2012-04-01 at 18:43 +0200, Pablo Neira Ayuso wrote:
> On Sun, Apr 01, 2012 at 10:22:50PM +0800, Changli Gao wrote:
> > We should check the length of the data before dereferencing it when parsing
> > the TCP options.
> > 
> > Signed-off-by: Changli Gao <xiaosuo@...il.com>
> > ---
> >  net/netfilter/nf_conntrack_proto_tcp.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
> > index 361eade..9e446c5 100644
> > --- a/net/netfilter/nf_conntrack_proto_tcp.c
> > +++ b/net/netfilter/nf_conntrack_proto_tcp.c
> > @@ -404,6 +404,8 @@ static void tcp_options(const struct sk_buff *skb,
> >  			length--;
> >  			continue;
> >  		default:
> > +			if (length < 2)
> > +				return;
> >  			opsize=*ptr++;
> >  			if (opsize < 2) /* "silly options" */
> >  				return;
> 
> length is always multiple of 4:
> 
> int length = (tcph->doff*4) - sizeof(struct tcphdr);
> --

initial value yes, but it can change in the loop.


--
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