Post

Replies

Boosts

Views

Activity

Reply to Error of invalid code signature
This driver can load and execute on my Mac mini x86 MacOS 12.61 but got invalid of signature on my Mac mini arm64 MacOS13 Translated Report (Full Report Below) Incident Identifier: 41328A83-831A-4BF2-A78A-AACF4F5A5749 CrashReporter Key: 339C68DB-9000-8F1B-DD99-CCBFCD174A7D Hardware Model: Macmini9,1 Process: com.Areca.ArcMSRUserSpaceDriver [659] Path: /Library/SystemExtensions/*/com.Areca.ArcMSRUserSpaceDriver Identifier: com.Areca.ArcMSRUserSpaceDriver Version: 1.5.0 (1.5.0) Code Type: ARM-64 (Native) Role: Default Parent Process: launchd [1] Coalition: com.Areca.ArcMSRUserSpaceDriver [665] Date/Time: 2022-12-23 17:24:56.4811 +0800 Launch Time: 2022-12-23 17:24:56.3300 +0800 OS Version: macOS 13.0 (22A380) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid)) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: CODESIGNING 1 Taskgated Invalid Signature Highlighted by Thread: 0 Backtrace not available No thread state (register information) available Binary Images: Binary images description not available Error Formulating Crash Report: dyld_process_info_create failed with 30 dyld_process_snapshot_get_shared_cache failed Failed to create CSSymbolicatorRef - corpse still valid ¯_(ツ)/¯ thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port EOF Full Report {"app_name":"com.Areca.ArcMSRUserSpaceDriver","timestamp":"2022-12-23 17:24:59.00 +0800","app_version":"1.5.0","slice_uuid":"cff72877-de1e-3ebc-87d0-139ac20f975d","build_version":"1.5.0","platform":0,"bundleID":"com.Areca.ArcMSRUserSpaceDriver","share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 13.0 (22A380)","roots_installed":0,"name":"com.Areca.ArcMSRUserSpaceDriver","incident_id":"41328A83-831A-4BF2-A78A-AACF4F5A5749"} { "uptime" : 48, "procRole" : "Default", "version" : 2, "userID" : 270, "deployVersion" : 210, "modelCode" : "Macmini9,1", "coalitionID" : 665, "osVersion" : { "train" : "macOS 13.0", "build" : "22A380", "releaseType" : "User" }, "captureTime" : "2022-12-23 17:24:56.4811 +0800", "incident" : "41328A83-831A-4BF2-A78A-AACF4F5A5749", "pid" : 659, "translated" : false, "cpuType" : "ARM-64", "roots_installed" : 0, "bug_type" : "309", "procLaunch" : "2022-12-23 17:24:56.3300 +0800", "procStartAbsTime" : 1154811220, "procExitAbsTime" : 1158430980, "procName" : "com.Areca.ArcMSRUserSpaceDriver", "procPath" : "/Library/SystemExtensions/*/com.Areca.ArcMSRUserSpaceDriver", "bundleInfo" : {"CFBundleShortVersionString":"1.5.0","CFBundleVersion":"1.5.0","CFBundleIdentifier":"com.Areca.ArcMSRUserSpaceDriver"}, "parentProc" : "launchd", "parentPid" : 1, "coalitionName" : "com.Areca.ArcMSRUserSpaceDriver", "crashReporterKey" : "339C68DB-9000-8F1B-DD99-CCBFCD174A7D", "sip" : "disabled", "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGKILL (Code Signature Invalid)"}, "termination" : {"flags":66,"code":1,"namespace":"CODESIGNING","indicator":"Taskgated Invalid Signature"}, "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "legacyInfo" : { "threadHighlighted" : 0 }, "reportNotes" : [ "dyld_process_info_create failed with 30", "dyld_process_snapshot_get_shared_cache failed", "Failed to create CSSymbolicatorRef - corpse still valid ¯\(ツ)_/¯", "thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port", "thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port", "thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port" ] }
Dec ’22
Reply to How to access dmaaddress (Physical Address) in DriverKit?
IODMACommandSpecification dmaSpecification; IOAddressSegment dma_physical_address_segment = {0}; IOAddressSegment dma_virtual_address_segment; uint64_t offset, uncached_resource_size, dma_res_Phys, dmaFlags = kIOMemoryDirectionInOut; uint32_t dmaSegmentCount = 1;/* for get Physical Address, we need only one large Segment */ if(IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut, uncached_resource_size /* capacity */, 256 /* alignment */, &ivars->dma_resource_descriptor) != kIOReturnSuccess) { return false; } /* ************************************************************************ ** IOBufferMemoryDescriptor have capacity allocated at Create() ** but no valid data until set with this method. ************************************************************************ */ if(ivars->dma_resource_descriptor->SetLength(uncached_resource_size) != kIOReturnSuccess) { return false; } if(ivars->dma_resource_descriptor->GetAddressRange(&dma_virtual_address_segment) != kIOReturnSuccess) { return false; } /* */ bzero(&dmaSpecification, sizeof(dmaSpecification)); dmaSpecification.options = kIODMACommandSpecificationNoOptions; dmaSpecification.maxAddressBits = 64; if(IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaSpecification, &ivars->dma_resource_iodmacommand) != kIOReturnSuccess) { return false; } if(ivars->dma_resource_iodmacommand->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, ivars->dma_resource_descriptor, 0/*offset*/, uncached_resource_size/*length*/, &dmaFlags, &dmaSegmentCount, &dma_physical_address_segment) != kIOReturnSuccess) { return false; } /* */ dma_res_Phys = (uint64_t)dma_physical_address_segment.address; dma_res->Physical_Address.parts.low = (uint32_t)(dma_res_Phys & 0xFFFFFFFF); dma_res->Physical_Address.parts.high = (uint32_t)(dma_res_Phys >> 32); /* */ dma_res->Virtual_Address = reinterpret_cast <uint8_t *> (dma_virtual_address_segment.address);
Dec ’22
Reply to SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
/* ** UserGetDataBuffer */ if(parallelTask.fCommandDescriptorBlock[0] == SCSI_CMD_INQUIRY) { IOBufferMemoryDescriptor *data_buffer_memory_descriptor = nullptr; /* ****************************************************************************************************************************************** ** virtual kern_return_t UserGetDataBuffer(SCSIDeviceIdentifier fTargetID, uint64_t fControllerTaskIdentifier, IOBufferMemoryDescriptor **buffer); ****************************************************************************************************************************************** */ if((UserGetDataBuffer(parallelTask.fTargetID, parallelTask.fControllerTaskIdentifier, &data_buffer_memory_descriptor) == kIOReturnSuccess) && (data_buffer_memory_descriptor != NULL)) { IOAddressSegment data_buffer_virtual_address_segment = {0}; if(data_buffer_memory_descriptor->GetAddressRange(&data_buffer_virtual_address_segment) == kIOReturnSuccess) { IOAddressSegment data_buffer_physical_address_segment = {0}; IODMACommandSpecification dmaSpecification; IODMACommand *data_buffer_iodmacommand = {0}; bzero(&dmaSpecification, sizeof(dmaSpecification)); dmaSpecification.options = kIODMACommandSpecificationNoOptions; dmaSpecification.maxAddressBits = 64; if(IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaSpecification, &data_buffer_iodmacommand) == kIOReturnSuccess) { uint64_t dmaFlags = kIOMemoryDirectionInOut; uint32_t dmaSegmentCount = 1; pCCB->data_buffer_iodmacommand = data_buffer_iodmacommand; if(data_buffer_iodmacommand->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, data_buffer_memory_descriptor, 0/*offset*/, parallelTask.fRequestedTransferCount/*length*/, &dmaFlags, &dmaSegmentCount, &data_buffer_physical_address_segment) == kIOReturnSuccess) { parallelTask.fBufferIOVMAddr = (uint64_t)data_buffer_physical_address_segment.address; /* data_buffer_physical_address: overwrite original fBufferIOVMAddr */ pCCB->OSDataBuffer = reinterpret_cast <uint8_t *> (data_buffer_virtual_address_segment.address);/* data_buffer_virtual_address */ } } } } } in command completion stage response.fBytesTransferred = dataxferlen; response.version = kScsiUserParallelTaskResponseCurrentVersion1; response.fTargetID = TARGETLUN2SCSITARGET(TargetID, 0); response.fControllerTaskIdentifier = pCCB->fControllerTaskIdentifier; response.fCompletionStatus = taskStatus; response.fServiceResponse = serviceResponse; response.fSenseLength = taskStatus; IOUserSCSIParallelInterfaceController::ParallelTaskCompletion(pCCB->completion, response); pCCB->completion->release(); pCCB->completion = NULL; pCCB->ccb_flags.start = 0;/reset startdone for outstanding ccb check/ if(pCCB->data_buffer_iodmacommand != NULL) { pCCB->data_buffer_iodmacommand->CompleteDMA(kIODMACommandCompleteDMANoOptions); OSSafeReleaseNULL(pCCB->data_buffer_iodmacommand); // pCCB->data_buffer_iodmacommand->free(); pCCB->data_buffer_iodmacommand = NULL; pCCB->OSDataBuffer = NULL; }
Nov ’22
Reply to Is Bug of DriverKit SetPowerState?
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ********************************************************************** \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** 【Get system status notification service】 \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** Call this function to get system "shutdown or restart" notification \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** If our driver gets this service \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** It will cause our IMPL (ArcMSRUserSpaceDriver, Stop) \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** to be called during the system "shutdown or restart" phase \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ********************************************************************** \n", ivars->adapter_index); /* ************************************************************************************************************** ** ** If your system is MacOS11.52 . ** This Function would cause IOSerrvice::ClientCrashed(IOService * client, uint64_t options); ** This Function could supported from MacOS12.03 , ready for shutdown and restart notification from MacOS12.60 ** ** =========================================================================================== ** Obtain the system state notification service ** ** To Let our Stop() is called when the system shuts down or restarts. ** ** IOServiceStateNotificationDispatchSource for got "System Shutdown or Restart Notify" ** ** this function "StateNotificationItemCopy" should be call ** ** values for OSNumber kIOSystemStateHaltDescriptionKey:kIOSystemStateHaltDescriptionHaltStateKey ** ** enum ** { ** kIOServiceHaltStatePowerOff = 0x00000001, ** kIOServiceHaltStateRestart = 0x00000002, ** }; ** ** virtual kern_return_t StateNotificationItemCopy(OSString * itemName, OSDictionary ** value); ** ************************************************************************************************************** */ if(IOService::CopySystemStateNotificationService(&ivars->ArcmsrSystemStateNotificationService) != kIOReturnSuccess)/* Register the service with the system. Obtain the system state notification service */ { goto initialize_fail; }
Oct ’22