[KPhotoAlbum] Patch to speed up scanning for new images

Shawn Willden shawn-kimdaba at willden.org
Fri May 11 13:51:20 BST 2007


On Friday 11 May 2007 03:28:29 am Jan Kundrát wrote:
> Please see the lcg-rollout ML archive that I linked to in my first
> message. I'm worried by use of MAXNAMELEN as it's a constant from the
> system that performs the compilation. 

Assuming the platform has a maximum filename length and assuming that the 
headers set MAXNAMLEN appropriately for the platform, it would be okay unless 
the platform changed.  AFAICT, however, these assumptions are not necessarily 
met on Linux, and may not be met on other platforms as well.

As I said in my other post, it appears there are no file systems in common use 
on any platform that allow file names longer than 4k, so using a 4k buffer 
would probably make it safe.  Allocating the buffer on the heap would make 
the vulnerability very difficult to exploit even if KPA were used on a system 
that:

1)  Allowed filenames longer than 4k
2) Had file permissions set such that the attacker could insert files in the 
user's image directory

Given a heap-based allocation, it's likely that the most an attacker could 
achieve in this unlikely situation is crash KPA.

I think that level of risk is worth the speedup.

	Shawn.



More information about the Kphotoalbum mailing list