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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0803061612290.4202@sbz-30.cs.Helsinki.FI>
Date:	Thu, 6 Mar 2008 16:14:23 +0200 (EET)
From:	Pekka J Enberg <penberg@...helsinki.fi>
To:	Patrick McHardy <kaber@...sh.net>
cc:	Netfilter Development Mailinglist 
	<netfilter-devel@...r.kernel.org>, clameter@....com,
	joe@...ches.com, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org,
	Netfilter Development Mailinglist 
	<netfilter-devel@...r.kernel.org>
Subject: Re: [PATCH] netfilter: replace horrible hack with ksize()

Hi Patrick,

On Thu, 6 Mar 2008, Patrick McHardy wrote:
> > @@ -95,7 +85,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct
> >   newlen = newoff + t->len;
> >   rcu_read_unlock();
> > 
> > -	if (newlen >= ct->ext->real_len) {
> > +	if (newlen >= ksize(ct->ext)) {
> 
> This needs to look at the currently allocated size, otherwise
> it will always realloc when adding new extensions after having
> used up ksize(ct->ext) space.

Lets say you

  p = kmalloc(8, ...);

Then ksize(p) will return the currently allocated size which is 32 bytes 
when page size is 4 KB, and not 8 bytes. So it should be equivalent of 
what the current code does.

What am I missing here?

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