This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch][BZ 14594] Demangle function pointers before testing them


If a gconv module's init function has an address that is the same as the current pointer guard, then the gconv module's init function will not be called.

The problem is find_module tests the *mangled* pointer against NULL; if the pointer is non-NULL, then the initializer code is called.

With the mangling transformation being a simple xor against the pointer guard, if the pointer guard has the same value as the function's real address, then the mangled representation will have the value 0. Thus resulting in the initializer function not getting called.

Inspection shows similar problems in gconv_db.c which I've fixed. There's also an instance in btowc.c, but that merely gates an optimized path and I didn't change that instance (I'm certainly willing to do so, but with limited abilities to test I didn't want to change more than was necessary to fix the correctness issues found.

Jeff

Attachment: patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]