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  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]
Date:	Thu, 6 Mar 2008 16:20:57 +0200 (EET)
From:	Pekka J Enberg <>
To:	Patrick McHardy <>
cc:	Netfilter Development Mailinglist 
	Netfilter Development Mailinglist 
Subject: Re: [PATCH] netfilter: replace horrible hack with ksize()

On Thu, 6 Mar 2008, Pekka J Enberg wrote:
> > > -	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?

Ok, it's not equivalent. We have two sizes: object size (8 bytes) and 
buffer size (32 bytes) here. In netfilter, ->real_len is same as object 
size, not buffer size as ksize() is.

But now I am officially even more confused, why does the netfilter code 
decided whether to reallocate based on _object size_ and not _buffer size_ 
(as krealloc() does, for example)?

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists