|
From: SourceForge.net <no...@so...> - 2005-03-21 15:00:47
|
Patches item #1030243, was opened at 2004-09-18 01:46 Message generated for change (Comment added) made by nosnilmot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1030243&group_id=235 Category: segfault Group: None >Status: Pending Resolution: None Priority: 5 Submitted By: rian hunter (chrono86) Assigned to: Ethan Blanton (eblanton) Summary: DNS child bad IPC on 64-bit Big endian Initial Comment: in the host_resolved function (parent) of src/proxy.c, it receives the dns information like this --------- int rc, err; (4 bytes on LP64) size_t addrlen; (8 bytes on some LP64 unices) operation, size read(childfd, &err, sizeof(err)); 4 read(childfd, &addrlen, sizeof(addrlen)); 8 read(childfd, &addr, addrlen); varies read(childfd, &addrlen, sizeof(addrlen)); 8 if addrlen == 0 then stop; -------- the child works like this: ----- const int zero = 0; (4 bytes LP64) size_t addrlen; (8 bytes on some LP64 unices); operation, size write(childfd, &zero, sizeof(zero)); 4 write(childfd, &addrlen, sizeof(addrlen)); 8 write(childfd, &addr, addrlen); varies write(childfd, &zero, sizeof(zero)); 4 -------- in the last read of host_resolved only the first 4 bytes are read, and in big endian, these are the MSB then the lower four bytes aren't cleared and addrlen will retain it's lower 32-bit value, and not evaluate to zero when it should. my patch changes err (in host resolved) and zero (in the child) to be size_t datatype. because addrlen in the child must be size_t bytes, so zero must be size_t, and if zero is size_t, then err must be size_t. ---------------------------------------------------------------------- >Comment By: Stu Tomlinson (nosnilmot) Date: 2005-03-21 10:00 Message: Logged In: YES user_id=309779 I think this is the same as what patch 1162827 fixed, right? ---------------------------------------------------------------------- Comment By: rian hunter (chrono86) Date: 2004-10-02 14:52 Message: Logged In: YES user_id=801658 This bug doesn't only affect Big Endian 64-Bit machines, but all 64-Bit machines if that was unclear. The bug is just more obvious on a 64-bit Big Endian machine. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1030243&group_id=235 |