From: Rhys Kidd Date: Sun, 31 May 2015 03:17:53 +0000 (+0000) Subject: Fix OS X host_create_mach_voucher: UNKNOWN host message [id 222, to mach_host_self... X-Git-Tag: svn/VALGRIND_3_11_0~333 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d289179fd2e7ef97b890f9e92c06ddf780429239;p=thirdparty%2Fvalgrind.git Fix OS X host_create_mach_voucher: UNKNOWN host message [id 222, to mach_host_self(), reply 0x........] bz#343649 Before: == 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == After: == 591 tests, 220 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15299 --- diff --git a/NEWS b/NEWS index 164e1d1e6a..789187bdf3 100644 --- a/NEWS +++ b/NEWS @@ -168,6 +168,8 @@ where XXXXXX is the bug number as listed below. 343525 OS X host_get_special_port: UNKNOWN host message [id 412, to mach_host_self(), reply 0x........] 343597 ppc64le: incorrect use of offseof macro +343649 OS X host_create_mach_voucher: UNKNOWN host message [id 222, to + mach_host_self(), reply 0x........] 343732 Unhandled syscall 144 (setgid) on aarch64 343733 Unhandled syscall 187 (msgctl and related) on aarch64 343802 s390x: Fix false positives "conditional jump or move depends on diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h index 1145ec7f29..090317921c 100644 --- a/coregrind/m_syswrap/priv_syswrap-darwin.h +++ b/coregrind/m_syswrap/priv_syswrap-darwin.h @@ -573,6 +573,7 @@ DECL_TEMPLATE(darwin, host_page_size); DECL_TEMPLATE(darwin, host_get_io_master); DECL_TEMPLATE(darwin, host_get_clock_service); DECL_TEMPLATE(darwin, host_request_notification); +DECL_TEMPLATE(darwin, host_create_mach_voucher); DECL_TEMPLATE(darwin, host_get_special_port); DECL_TEMPLATE(darwin, mach_port_type); DECL_TEMPLATE(darwin, mach_port_extract_member); diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index cca98dcd89..de2f7db3ce 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -4963,6 +4963,45 @@ PRE(host_request_notification) } +PRE(host_create_mach_voucher) +{ +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t recipesCnt; + uint8_t recipes[5120]; + } Request; +#pragma pack() + + Request *req = (Request *)ARG1; + + PRINT("host_create_mach_voucher(count %u)", + req->recipesCnt); + + AFTER = POST_FN(host_create_mach_voucher); +} + + +POST(host_create_mach_voucher) +{ +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t voucher; + /* end of the kernel processed data */ + } Reply; +#pragma pack() + + Reply *reply = (Reply *)ARG1; + + // RK fixme properly parse this return type + PRINT("got voucher %#x ", reply->voucher.name); +} + + PRE(host_get_special_port) { #pragma pack(4) @@ -7848,6 +7887,9 @@ PRE(mach_msg_host) case 217: CALL_PRE(host_request_notification); return; + case 222: + CALL_PRE(host_create_mach_voucher); + return; case 412: CALL_PRE(host_get_special_port);