{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/omi/issues/502","repository_url":"https://api.github.com/repos/Microsoft/omi","labels_url":"https://api.github.com/repos/Microsoft/omi/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/omi/issues/502/comments","events_url":"https://api.github.com/repos/Microsoft/omi/issues/502/events","html_url":"https://github.com/Microsoft/omi/issues/502","id":309477348,"number":502,"title":"segfault in InteractionProtocolHandler_Session_Connect in debug builds on failed connections.","user":{"login":"dantraMSFT","id":12105071,"avatar_url":"https://avatars0.githubusercontent.com/u/12105071?v=4","gravatar_id":"","url":"https://api.github.com/users/dantraMSFT","html_url":"https://github.com/dantraMSFT","followers_url":"https://api.github.com/users/dantraMSFT/followers","following_url":"https://api.github.com/users/dantraMSFT/following{/other_user}","gists_url":"https://api.github.com/users/dantraMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/dantraMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantraMSFT/subscriptions","organizations_url":"https://api.github.com/users/dantraMSFT/orgs","repos_url":"https://api.github.com/users/dantraMSFT/repos","events_url":"https://api.github.com/users/dantraMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/dantraMSFT/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-03-28T18:21:25Z","updated_at":"2018-04-10T04:55:49Z","closed_at":"2018-04-10T04:55:49Z","author_association":"MEMBER","body":"Connecting through PowerShell/PSRP using basic auth with invalid credentials causes a segfault in debug builds.\r\n\r\nThe problem is due to an invalid pointer dereference.\r\n\r\nAt the lowest level, when the error is posted, PostResult has the following lines at the end:\r\n\r\nMessage_AddRef(&errorMsg->base);\r\nStrand_ScheduleAux(&self->strand, PROTOCOLSOCKET_STRANDAUX_POSTMSG);\r\nPostResultMsg_Release(errorMsg);\r\n\r\nAfter calling Strand_ScheduleAux, the operation that was passed into InteractionProtocolHandler_Session_Connect has been freed (in debug builds, the memory block is filled with 0xdddddddddddddddd). This causes the seg fault for the following reason:\r\n\r\n1: MI_RESULT_ACCESS_DEFINED gets returned to WsmanClient_New_Connector\r\n\r\n2: WsmanClient_New_Connector jumps to finished2 and posts another error result but then returns MI_RESULT_OK to the caller.\r\n\r\n3: InteractionProtocolHandler_Session_Connect receives the MI_RESULT_OK and attempts to continue but it is referencing a stale memory pointer; it checks for a non-null pointer in one of the fields. In release builds, this check succeeds, the memory block is zero filled. In debug builds, the field is non-null (0xdddddddddddddddd) and the pointer is dereferenced causing a segfault.\r\n\r\n\r\nReturning MI_RESULT_OK appears to be suspect since it requires dereferencing a stale memory pointer.  Alternatively, the operation is getting deleted when it should not be."},"comment":{"url":"https://api.github.com/repos/Microsoft/omi/issues/comments/379973696","html_url":"https://github.com/Microsoft/omi/issues/502#issuecomment-379973696","issue_url":"https://api.github.com/repos/Microsoft/omi/issues/502","id":379973696,"user":{"login":"JumpingYang001","id":16585827,"avatar_url":"https://avatars0.githubusercontent.com/u/16585827?v=4","gravatar_id":"","url":"https://api.github.com/users/JumpingYang001","html_url":"https://github.com/JumpingYang001","followers_url":"https://api.github.com/users/JumpingYang001/followers","following_url":"https://api.github.com/users/JumpingYang001/following{/other_user}","gists_url":"https://api.github.com/users/JumpingYang001/gists{/gist_id}","starred_url":"https://api.github.com/users/JumpingYang001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JumpingYang001/subscriptions","organizations_url":"https://api.github.com/users/JumpingYang001/orgs","repos_url":"https://api.github.com/users/JumpingYang001/repos","events_url":"https://api.github.com/users/JumpingYang001/events{/privacy}","received_events_url":"https://api.github.com/users/JumpingYang001/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T04:55:49Z","updated_at":"2018-04-10T04:55:49Z","author_association":"MEMBER","body":"@dantraMSFT we have verified omi 1.4.1-0 exist this crash issue and it is fixed on omi 1.4.2-2, so I just close it, thank you!\r\nPlease update the submodule of PSRP to omi 1.4.2-2, thanks."}}
{"actor":{"display_login":"JumpingYang001"}}