Subject: Re: RelCache (aka ELF prebinding) news
To: None <tech-kern@netbsd.org, tech-userlevel@netbsd.org>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-userlevel
Date: 12/03/2002 15:42:23
On Wed, Dec 04, 2002 at 03:51:39AM +0900, Bang Jun-Young wrote:
> On Tue, Dec 03, 2002 at 10:25:20AM -0800, Jason R Thorpe wrote:
> > On Wed, Dec 04, 2002 at 03:17:43AM +0900, Bang Jun-Young wrote:
> > 
> >  > Filename can be easily changed, so it won't be used. And using length is
> >  > basically a good idea but you need a bit tricky method to calculate
> >  > actual file length before relcache is appended to the file. 
> > 
> > We're talking "filename and size of library", right?  If so, why would the
> > filename change (that would break DT_NEEDED entries in the binary) and why
> > would the file size be difficult to compute?
> 
> Even if you use the filename, you still have to compare the checksum. But
> if you compare the checksum, you don't have to compare the filename.

That's not really strictly true.  You know the checksum is not perfect,
and you have the filename, size, and the other metadata (whether you
decide to use them or not) readily available to you.  Why *not* use them
to shoot down potential collisions?

-- 
 Thor Lancelot Simon	                                      tls@rek.tjls.com
   But as he knew no bad language, he had called him all the names of common
 objects that he could think of, and had screamed: "You lamp!  You towel!  You
 plate!" and so on.              --Sigmund Freud