Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1375345615.27318.228.camel@eris.loria.fr>
Date: Thu, 01 Aug 2013 10:26:55 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: Solving the recursive memcpy/memset/etc. issue

Am Donnerstag, den 01.08.2013, 10:03 +0200 schrieb Luca Barbato:
> > Well, it would be an ugly heuristic like running cc -S -o - on 
> > src/string/memcpy.c, with -Dmemcpy=noname or something, and grepping 
> > the output for memcpy...
> 
> Indeed.

there might be the word memcpy in comments or whatever, depends on the
assembler format etc. might be really relatively difficult to set up
reliably.

Other options:

 - compile it with that -Dmemcpy=noname trick to a normal .o and use
   nm to look for an undefined symbol "memcpy".

 - use a different name for the implementation of the function from
   the start, __musl_memcpy or so. Then you could do the check for the
   memcpy symbol on the normally compiled .o and (if everything is ok)
   rename the __musl_memcpy to memcpy with some linker trick.

 - put "#define memcpy __musl_memcpy" at the start of string.h
   if __musl_memcpy would refer to memcpy this would give an link time
   error for an undefined symbol.

Jens

-- 
:: INRIA Nancy Grand Est :: http://www.loria.fr/~gustedt/   ::
:: AlGorille ::::::::::::::: office Nancy : +33 383593090   ::
:: ICube :::::::::::::: office Strasbourg : +33 368854536   ::
:: ::::::::::::::::::::::::::: gsm France : +33 651400183   ::
:: :::::::::::::::::::: gsm international : +49 15737185122 ::



Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.