Explore the core architecture of the operating system, including the kernel, memory management, and process scheduling.

Posts under Core OS subtopic

Post

Replies

Boosts

Views

Activity

Core OS Resources
General: DevForums subtopic: App & System Services > Core OS Core OS is a catch-all subtopic for low-level APIs that don’t fall into one of these more specific areas: Processes & Concurrency Resources Files and Storage Resources Networking Resources Network Extension Resources Security Resources Virtualization Resources Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
1.7k
Aug ’25
Title: PackageKit install fails with PKInstallErrorDomain Code=120 and NSPOSIXErrorDomain Code=1 during _relinkFile operation Body: We are investigating an intermittent package installation failure on macOS Tahoe 26.5 and are trying to understand
We are investigating an intermittent package installation failure on macOS Tahoe 26.5 and are trying to understand the conditions under which PackageKit may return the following errors during an upgrade installation: PKInstallErrorDomain Code=120 NSPOSIXErrorDomain Code=1 ("Operation not permitted") The package successfully passes validation and authorization, and pre-install scripts complete successfully. The failure occurs during the final PackageKit commit phase when PackageKit attempts to move/relink content from the installer sandbox to the destination volume. Relevant log snippets: PackageKit: Shoving /Root to / Error relinking file (primary): .../Contents/_CodeSignature/CodeResources failed _relinkFile(...) Operation not permitted PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=120 NSUnderlyingError: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" The issue is intermittent and only affects a subset of systems. The same package installs successfully on many machines running the same macOS version. Has anyone encountered similar _relinkFile / CodeResources failures during package upgrades? In particular, we are interested in understanding: Common causes of NSPOSIXErrorDomain Code=1 during PackageKit relink operations. Whether existing signed application bundle metadata (CodeResources) can cause relink failures during upgrades. Any Installer or PackageKit changes in recent Tahoe releases that could affect bundle replacement during package installation. Any insights would be appreciated.
4
0
254
1h
Is it possible to run macOS VM (Virtualization API) under a launchd daemon?
Hi, I was trying to run a macOS VM under a launchd daemon as part of a requirement. The parent daemon spawns a macOS VM under root user. Sometimes this is fine, but sometimes I'm getting a security error from VZ library : Unable to access security information. The virtual machine encountered a security error. In system logs, I was able to see this : ctkd: unable to generate key: error e00002e2 for com.apple.Virtualization.VirtualMachine with SepKey ACL I think this indicates Virtualization.framework asked CryptoTokenKit/Secure Enclave to create a key, and the security subsystem rejected it in the current execution context. Is it possible to run VM this way ? If yes, what am I missing ?
1
0
28
3h
Pinpointing dandling pointers in 3rd party KEXTs
I'm debugging the following kernel panic to do with my custom filesystem KEXT: panic(cpu 0 caller 0xfffffe004cae3e24): [kalloc.type.var4.128]: element modified after free (off:96, val:0x00000000ffffffff, sz:128, ptr:0xfffffe2e7c639600) My reading of this is that somewhere in my KEXT I'm holding a reference 0xfffffe2e7c639600 to a 128 byte zone that wrote 0x00000000ffffffff at offset 96 after that particular chunk of memory had been released and zeroed out by the kernel. The panic itself is emitted when my KEXT requests the memory chunk that's been tempered with via the following set of calls. zalloc_uaf_panic() __abortlike static void zalloc_uaf_panic(zone_t z, uintptr_t elem, size_t size) { ... (panic)("[%s%s]: element modified after free " "(off:%d, val:0x%016lx, sz:%d, ptr:%p)%s", zone_heap_name(z), zone_name(z), first_offs, first_bits, esize, (void *)elem, buf); ... } zalloc_validate_element() static void zalloc_validate_element( zone_t zone, vm_offset_t elem, vm_size_t size, zalloc_flags_t flags) { ... if (memcmp_zero_ptr_aligned((void *)elem, size)) { zalloc_uaf_panic(zone, elem, size); } ... } The panic is triggered if memcmp_zero_ptr_aligned(), which is implemented in assembly, detects that an n-sized chunk of memory has been written after being free'd. /* memcmp_zero_ptr_aligned() checks string s of n bytes contains all zeros. * Address and size of the string s must be pointer-aligned. * Return 0 if true, 1 otherwise. Also return 0 if n is 0. */ extern int memcmp_zero_ptr_aligned(const void *s, size_t n); Normally, KASAN would be resorted to to aid with that. The KDK README states that KASAN kernels won't load on Apple Silicon. Attempting to follow the instructions given in the README for Intel-based machines does result in a failure for me on Apple Silicon. I stumbled on the Pishi project. But the custom boot kernel collection that gets created doesn't have any of the KEXTs that were specified to kmutil(8) via the --explicit-only flag, so it can't be instrumented in Ghidra. Which is confirmed as well by running: % kmutil inspect -B boot.kc.kasan boot kernel collection at /Users/user/boot.kc.kasan (AEB8F757-E770-8195-458D-B87CADCAB062): Extension Information: I'd appreciate any pointers on how to tackle UAFs in kernel space.
12
0
1.5k
5h
蓝牙设备是否可以在不同应用状态(后台、锁屏、应用被终止)下唤醒 App?
大家好, 我们正在开发一款基于 CoreBluetooth 的 iOS 应用,希望确认 iOS 在不同应用生命周期状态下的预期行为。 我们主要关注以下几种常见场景: App 在后台运行(未被终止); iPhone 处于锁屏状态,App 在后台运行; iPhone 处于锁屏状态,App 已被系统终止; iPhone 处于锁屏状态,App 已被用户从后台上滑关闭(Force Quit)。 当 BLE Peripheral 发生与该 App 相关的广播、连接或其他蓝牙事件时,我们想确认: 在上述不同场景下,BLE 设备是否能够触发 iOS 唤醒、启动或重新启动 App? 如果可以,不同场景分别需要满足哪些条件(例如 CoreBluetooth Background Modes、State Restoration、连接事件等)? 如果 App 已被用户 Force Quit,是否仍存在任何可以重新启动 App 的官方支持方式? 锁屏状态是否会对上述行为产生额外限制? 我们的目标是了解 iOS 官方支持的能力边界,以及不同应用状态下 BLE 与 App 生命周期的交互行为,而不是具体的实现细节。 感谢大家!
5
0
702
14h
Monterey:Network System Extension OSSystemExtensionRequest.deactivationRequest fails with authorizationRequired = 13
Hello, On Mac OS monterey, OSSystemExtensionRequest.deactivationRequest is failing with deactivation request for com.xxxxxx.networkextensionapp.netextension failed authorization check, error: Error Domain=OSSystemExtensionErrorDomain Code=13 "(null)" Even after providing the correct credentials for authorisation when prompted for.
4
0
1.7k
1d
Kernel Sandbox/System Policy intermittently denies ALL file access (not just mount syscall) on NFS mounts
I'm seeing a recurring issue on macOS 26.5.2 (build 25F84) where the kernel's Sandbox/System Policy layer intermittently denies file access on NFS mount points from local network servers. Posting here in case anyone recognizes this pattern or has a workaround, and flagging it since I've also filed a Feedback Assistant report (with a live-captured sysdiagnose) for the same issue. WHAT HAPPENS Two independent NFS mounts to two separate, unrelated servers on my LAN start failing simultaneously with "Operation not permitted." The kernel log shows: kernel: (Sandbox) System Policy: mount_nfs(PID) deny(1) file-mount /path/to/mount Critically, it's not limited to the mount syscall - within the same few-second window, System Policy also denies ls, perl, diskutil, and even umount -f on the exact same path, for otherwise unrelated processes. So it looks like a transient, path-scoped kernel decision rather than something specific to NFS or the mount syscall. It self-heals anywhere from seconds to ~30 minutes later, then recurs - documented 30-80+ occurrences/day via a background watchdog script. WHAT I'VE RULED OUT Server-side cause: two independent servers on different hardware fail identically at the same instant. Network issue: checked network logs in the same window, no correlated connectivity event. Third-party kext conflict: kextstat shows zero third-party kexts loaded. syspolicyd database corruption: no "ASP: Validation category" signature present. TCC/Full Disk Access: already granted; the denying layer is kernel Sandbox "System Policy," not TCC. QUESTION Has anyone else run into System Policy denying file-mount/file-read-data/file-unmount on network volume paths intermittently like this? Is there any userland way to inspect or reset whatever internal state drives this decision (I haven't found one - no spctl/tccutil/sysctl lever that touches it)? Happy to share more log excerpts if useful.
18
0
1.1k
1d
Does the Channel Sounding have regional restrictions by country?
I'm trying to get the new Bluetooth Channel Sounding distance measurement working between an iPhone 17 running iOS 27 Beta4 and a Nordic nRF54L15DK board. I enabled bonding in the latest ipt_reflector sample from Nordic. Someone get the sample working with iOS 27 beta1. I paired the board with AccessorySetupKit. I suspect that the Channel Sounding feature is subject to regional restrictions by country (China). Here's the code to check if CS is available on my iPhone func centralManagerDidUpdateState(_ central: CBCentralManager) { switch central.state { case .poweredOn: print("central update") if CBCentralManager.supports(.channelSounding) { print("Supports channel sounding - YES") } else { print("Supports channel sounding - NO") } if let id = pendingPeripheralIdentifier, let name = pendingPeripheralName { pendingPeripheralIdentifier = nil pendingPeripheralName = nil retrieveAndConnect(identifier: id, name: name) } case .poweredOff: connectionState = .bluetoothOff case .unauthorized: connectionState = .error("Bluetooth not authorized — check Settings") case .unsupported: connectionState = .error("BLE not supported on this device") default: break } } The console log shows [ASK] Session activated — accessories: 1 central update Supports channel sounding - NO [CS] startChannelSounding skipped — channelSounding not supported Please also check the topic. it's very similar.
1
0
392
1d
Apple Silicon prevents execution of wine for Windows ARM64 binaries due to JIT/W^X restrictions and x18 register reservation
I am porting Wine to macOS to run Windows on ARM (WOA) binaries. Windows PE files place .text and .data in the same page, which macOS’s JIT/W^X model cannot handle. pthread_jit_write_protect_np() cannot be used for foreign ARM64 code. Apple Silicon reserves x18, breaking the Windows ARM64 ABI. Wine also must reserve 0x7FFE0000 for the Windows TEB, but macOS cannot guarantee this address. These issues make it impossible for Wine to load or execute WOA binaries. I am requesting mechanisms to safely execute foreign ARM64 code, support mixed W/X pages, emulate x18, and reserve the Windows TEB region. Branch is here: https://github.com/trcrsired/wine/tree/apple-silicon-mac-woa
1
0
88
2d
Possible change in sysctlbyname() / oldlenp behavior on iOS and iPadOS 27
I am investigating an issue involving sysctlbyname("hw.machine", ...) that became observable after moving to iOS/iPadOS 27. The affected legacy code is essentially the following: void getPlatform(unsigned char machine[]) { size_t size; sysctlbyname("hw.machine", machine, &size, NULL, 0); for (int i = 0; i < size; i++) { if (machine[i] == ',') { machine[i] = '.'; } } } The caller provides a zero-initialized fixed-size buffer: unsigned char machine[20] = {0}; getPlatform(machine); I understand that this implementation is incorrect because size is not initialized. When oldp is non-NULL, oldlenp must provide the available size of the buffer. A correct implementation would therefore initialize it, for example: void getPlatform(unsigned char *machine, size_t capacity) { size_t size = capacity; if (sysctlbyname("hw.machine", machine, &size, NULL, 0) != 0) return; for (size_t i = 0; i < size; i++) { if (machine[i] == ',') machine[i] = '.'; } } with: unsigned char machine[20] = {0}; getPlatform(machine, sizeof(machine)); The question is not whether the original implementation is valid. It clearly relies on an uninitialized value and should be corrected. What I am trying to understand is why the issue became observable specifically on iOS/iPadOS 27, and whether there has been any related implementation or documentation change. Using LLDB, I inspected the arguments at the entry to: sysctlbyname("hw.machine", machine, &size, NULL, 0); Because size is uninitialized, the value referenced by oldlenp varies depending on the contents of the stack location. For example, I observed a call where: *oldlenp = 0 The call then returned: return = -1 errno = 12 (ENOMEM) and the output buffer remained empty. In another execution, the same uninitialized stack location happened to contain a very large value. In that case sysctlbyname() succeeded and returned the expected hardware identifier: iPhone18,2 Adding unrelated code such as printf() can also change whether the original implementation succeeds, which is consistent with the uninitialized value being affected by changes in stack/register layout. There is also a second issue I would like clarification on regarding the documented behavior of oldlenp. The current documentation states that when the amount of data is greater than the value supplied through oldlenp, the function updates it to the required size and returns ENOMEM. It also states: The function doesn’t modify the value if it’s larger than or equal to the amount of available data. However, this does not match what I observed at runtime. For example, in one successful call I observed: Before sysctlbyname(): *oldlenp = 4301365248 The value was clearly much larger than required. After the call returned successfully: return = 0 machine = "iPhone18,2" *oldlenp = actual returned data length In other words, oldlenp was modified on a successful call even though the input value was already much larger than the amount of data being returned. I would appreciate clarification on the following: Was there any implementation change to sysctlbyname(), sysctl(), or the handling of oldlenp in iOS/iPadOS 27? Have there been changes in compiler/runtime behavior on iOS/iPadOS 27 that could make this type of existing uninitialized-variable bug surface more consistently? Is the documented statement that oldlenp is not modified when the supplied value is sufficiently large still accurate for sysctlbyname() on current iOS versions? Has the documentation or intended contract for oldlenp changed recently? Have other developers observed ENOMEM from existing sysctlbyname() code after updating to iOS/iPadOS 27? Again, I understand that the original code is incorrect and should initialize oldlenp before calling sysctlbyname(). The part I am trying to clarify is whether iOS/iPadOS 27 introduced any behavioral change that exposed this latent bug, and whether the currently documented successful-call behavior of oldlenp matches the actual implementation.
2
0
116
2d
Behavior of cblas_zgemv when array contains nan.
In NumPy (actually originally in SciPy), we found a case where multiplying a complex matrix that contains inf+nanj by a complex vector could result in nan in the output vector in positions where the corresponding rows of the inputs did not contain nan. I have a C++ program and data to demonstrate this at https://github.com/WarrenWeckesser/experiments/tree/main/c%2B%2B/accelerate-zgemv-bug. When the full matrix CC is multiplied with the vector weights, the output at element 17 is nan. When just row 17 of CC is multiplied with weights, the result is not nan. The matrix CC does have some occurrences of inf+nanj, but not in the row that produces element 17 of the output. Is this a bug? Is there some way that the value inf+nanj in the input matrix can "contaminate" the output in a position that should give a non-nan value?
3
0
276
5d
Managed Apple ID works for iMessage on bare metal, but fails in macOS VM (same hardware)
Hi all, I'm running 2 macOS VMs on a bare-metal Mac (host is also macOS). I'm seeing inconsistent iMessage sign-in behavior depending on the Apple ID type and whether it's bare metal or virtualized: Managed Apple ID (ABM-issued): signs into iMessage fine on the bare-metal host. Same Managed Apple ID: fails to sign into iMessage inside the VM on the same physical machine. Personal/basic Apple ID: signs in fine in the VM without issue. Has anyone run into this specific combination — MAID working on bare metal but not inside a VM, while a personal ID works fine in both?
2
0
304
5d
Using AppKit and Core Graphics within a CUPS filter context on macOS
Hello, I am currently developing a printed data security feature for a cross-platform DLP system. On other platforms, this functionality relies on a cross-platform third-party library. On macOS, this library depends on the Core Graphics and AppKit frameworks. So, such dependency makes it impossible to use the code within a launch daemon, which is where this mechanism needs to run. As an alternative approach, I am considering implementing the necessary functionality inside a CUPS filter. However, I have some doubts regarding the execution context of the CUPS filter process. Is it safe to use AppKit within a CUPS filter? Thank you in advance.
0
0
129
5d
macOS 27 beta — TCC intermittently blocks file writes during postinstall (I/O errors when unpacking .app)
Our app uses a Distribution.xml-based installer. Within the postinstall script, we attempt to untar a signed and notarized .app to the /Applications directory. On macOS 27 (tested up to Developer Beta 4), the tar command randomly fails to write random unpacked files with an I/O error; in the console there is "spolicyd[721] revoked access to "/Applications/XXX.app/file/within". It can be reproduced approximately every 4th install. Is this happening for anyone else? Any known workaround?
3
1
284
1w
CTCellularPlanStatus.checkValidity(ofToken:) throws Couldn't communicate with a helper application on iOS 26
Hello, We are using the UPI device validation APIs on iOS 26+ in a production banking/UPI app, and we are seeing a recurring failure from CoreTelephony that we need guidance on. API / entitlement Framework: CoreTelephony API: CTCellularPlanStatus.checkValidity(ofToken:) Related: CTCellularPlanStatus.token() Entitlement: com.apple.developer.upi-device-validation Availability: iOS 26.0+ Minimal call site do { let isValid = try await CTCellularPlanStatus.checkValidity(ofToken: token) // isValid == true/false -> expected outcomes } catch { // Unexpected: API throws instead of returning Bool print(error.localizedDescription) } Error error.localizedDescription is: English: Couldn't communicate with a helper application. Same failure also appears with a localized Hindi message on Hindi-locale devices. This is distinct from checkValidity(ofToken:) returning false (token/SIM mismatch). Here the API throws, so we cannot tell whether the token is valid. In production we currently only have this localizedDescription from telemetry. Production observations (large fleet, last few days) Observed only on production user devices so far; we have not reproduced it reliably on lab hardware. Occurs across multiple iOS 26.x builds (notably 26.5.2, 26.5, 26.6; also seen on 26.0-27.0). Not limited to a single patch. Seen on many iPhone models (not one SKU). Latency is bimodal for the same error string: large share fails in under 100 ms (immediate) another large share fails after about 2-10+ seconds (timeout-like) Observed under Wi-Fi, cellular (4G/5G), and No Connection / radio-not-ready conditions. Same device can emit many identical failures within about 1 second when validity is checked from multiple call sites concurrently. Token generation (CTCellularPlanStatus.token()) and successful checkValidity work for the vast majority of users; this throw is a smaller but material failure class. Questions for Apple Is "Couldn't communicate with a helper application." an expected / documented failure mode of checkValidity(ofToken:) (for example CommCenter/XPC unavailable, radio not ready)? What conditions typically trigger this error from checkValidity(ofToken:)? Recommended client handling: retry (with backoff)? treat as transient and skip forcing re-binding? surface to user? Does validation require cellular registration / SIM ready state even when docs indicate internet is not required? Any known issues on specific iOS 26.x builds, dual-SIM, eSIM, or airplane-mode transitions? Is concurrent checkValidity from multiple tasks unsupported / unsafe? Because this is currently production-only and not reliably reproducible on lab devices, we cannot attach a sysdiagnose or Instruments trace at this time. We can share aggregated production telemetry and API details via Feedback Assistant if helpful. Thank you.
1
0
279
1w
CMIO system extension: sysextd "no policy" + code 4 on 26.5 — resolved in 27?
Is macOS 27 Public Beta 2 able to activate new non‑MDM CMIO system extensions that fail on macOS 26.5.2? I'm building a virtual-camera app with a CMIO camera system extension (Developer ID signed + notarized), for personal use on my own Macs — no MDM. On macOS 26.5.2 (25F80) I can't get a new activation to succeed, and I'm trying to find out whether macOS 27 resolves it. Two failure modes I've seen: With SIP enabled, OSSystemExtensionRequest reaches the daemon, then sysextd logs: "no policy, cannot allow apps outside /Applications" — even though the app is in /Applications (verified real path, single copy, running from there). This matches other reports (e.g. LuLu / network extensions). With SIP disabled + systemextensionsctl developer on, it now fails earlier, client-side, with OSSystemExtensionErrorDomain code 4 — "Extension not found in App bundle / Unable to find any matched extension with identifier" — the request never even reaches sysextd. Things I've already verified/ruled out: Product type com.apple.product-type.system-extension; extension embedded at Contents/Library/SystemExtensions/; matching CFBundleIdentifier and Team ID; CMIOExtensionMachServiceName = $(TeamIdentifierPrefix)$(bundle id). App has com.apple.developer.system-extension.install (with authorizing profile); shared App Group + camera entitlement on both app and extension. Valid codesign --deep --strict; notarized + stapled; single LaunchServices registration; running the correct bundle. Reproduces with both Developer ID and Apple Development signing, and running straight from Xcode with a signed-in account. So the app/extension appear structurally correct; this looks like an OS-side regression in 26.5.x. My question: Has anyone successfully activated a new Developer ID (non-MDM) CMIO / system extension on macOS 27 Golden Gate Public Beta 2? Is this sysextd / code‑4 activation regression fixed there, or is it still present? Trying to decide whether upgrading is worth it. Thank you!
1
0
166
1w
App with shallow depth entitlement not appearing in Auto-Launch > When Submerged
I'm building a freediving app for Apple Watch Ultra using the shallow depth entitlement (com.apple.developer.submerged-shallow-depth-and-pressure). My app uses WKExtendedRuntimeSession with the underwater-depth background mode, and it works correctly — the session starts, Water Lock activates automatically, and Crown hold water ejection ends the session as expected. However, the app does not appear in Settings > General > Auto-Launch > When Submerged on the watch. Other third-party apps (including one that hasn't been updated in ~2 years and presumably only has the shallow entitlement) do appear in this list. My configuration: WKBackgroundModes: ["underwater-depth", "workout-processing"] WKSupportsAutomaticDepthLaunch: true (Boolean, in watch app Info.plist) Entitlement verified in both the signed binary and provisioning profile watchOS 26.3, Apple Watch Ultra 2 Tested with: development build, TestFlight, and direct Xcode deploy. Watch restarted after each. The app does not appear in any case. The documentation at https://developer.apple.com/documentation/coremotion/accessing-submersion-data states: "Adding the underwater-depth Background Mode capability also adds your app to the list of apps that the system can autolaunch when the wearer submerges the watch." Does auto-depth-launch require the full depth entitlement (com.apple.developer.submerged-depth-and-pressure), or should the shallow entitlement be sufficient? Is there an additional step required for the app to appear in the When Submerged list? Any guidance appreciated.
3
1
442
1w
User created via VZMacGuestProvisioningOptions is not returned by CSIdentityQueryExecute()
This post applies to Apple Virtualization framework feature to setup a user account during VM setup (VZMacGuestProvisioningOptions) introduced in macOS 27: Issue: Creating a user via VZMacGuestProvisioningOptions during VM setup, results in a user which is not returned by CSidentityQueryExecute(). Same code executed on a macOS 26 VM or a macOS 27 VM where the user was created by hand within the VM (so without VZMacGuestProvisioningOptions) returns the user. How to reproduce: Create an VM via the Apple Virtualization framework and use the VZMacGuestProvisioningOptions to create the user during VM setup. I actually used Virtual Buddy and Tart to do this. Then run the following code: internal enum MyLogger { static let info = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Utils-\(getuid())") } public struct Identity { public let posixUID: id_t public let posixName: String init?(posixUID: id_t, posixName: String) { self.posixUID = posixUID self.posixName = posixName } } class Utils { public static func userIdentities() -> [Identity] { let defaultAuthority = CSGetLocalIdentityAuthority().takeUnretainedValue() let query = CSIdentityQueryCreate(nil, kCSIdentityClassUser, defaultAuthority).takeRetainedValue() guard CSIdentityQueryExecute(query, 0, nil), let identities = CSIdentityQueryCopyResults(query).takeRetainedValue() as? [CSIdentity] else { return [] } for ident in identities { MyLogger.info.log("CSIdentity: \(ident.hashValue, privacy: .public)") } let idents = identities .compactMap { Identity( posixUID: CSIdentityGetPosixID($0), posixName: CSIdentityGetPosixName($0).takeUnretainedValue() as String ) } .sorted { $0.posixName.localizedStandardCompare($1.posixName) == .orderedAscending } for ident in idents { MyLogger.info.log("Identity: \(ident.posixName, privacy: .public), \(ident.posixUID, privacy: .public)") } return idents } } Expected behavior: The code returns the user account created via VZMacGuestProvisioningOptions. Actual behavior: I get no user account When you test the same on a macOS 27 VM where the user is created via the traditional way (Setup assistant), the app shows the account. This also applies to all additional user accounts created after VM setup via System Settings.app. The bug also still exists on a VM created with macOS 27 beta 4. Is anybody having the same issue? Is that a bug in macOS 27? I already created a Feedback for this: FB23716201
3
0
560
1w
FSKit - Retrieve Process ID?
Does FSKit support the ability to get the process information, such as the pid, when a process accesses a resource? Being able have the process context is important for implementing certain access patterns and security logging in some contexts. For instance, we have a system that utilizes (pre-FSKit) a FUSE mount that, depending on the process has different "views" and "access" based on the process id.
3
0
720
1w
Removing or invalidating a BLE bond when the app is the peripheral (CBPeripheralManager)
Our iOS app runs in the peripheral role. A hardware accessory acts as the central: it connects to the app and bonds in order to read and write characteristics we declare with encryption-required permissions. The app advertises so a previously bonded accessory can reconnect on its own. The problem is that the bond lives on both sides and we can only clear one of them. The accessory has its own "forget this phone" function, and it can also be told to do so remotely. iOS keeps its half, and we have not found any way for the app to remove or invalidate it. What we've checked: CBPeripheralManager and CBCentral expose no unpair or unbond operation. A CBCentral is only visible while connected or subscribed, and its identifier is a resolved handle. Questions: Is there a supported way for an app in the peripheral role to remove or invalidate the pairing keys for a bonded central? If we've missed an API, please point us at it. If not, what's the recommended approach when the peer has discarded its keys and the bond is no longer usable? Can a peripheral-role app detect that state — a distinguishable error or connection event when encryption fails — so we can tell the user something accurate instead of a generic connection failure?
3
0
297
1w
Core OS Resources
General: DevForums subtopic: App & System Services > Core OS Core OS is a catch-all subtopic for low-level APIs that don’t fall into one of these more specific areas: Processes & Concurrency Resources Files and Storage Resources Networking Resources Network Extension Resources Security Resources Virtualization Resources Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
Replies
0
Boosts
0
Views
1.7k
Activity
Aug ’25
Title: PackageKit install fails with PKInstallErrorDomain Code=120 and NSPOSIXErrorDomain Code=1 during _relinkFile operation Body: We are investigating an intermittent package installation failure on macOS Tahoe 26.5 and are trying to understand
We are investigating an intermittent package installation failure on macOS Tahoe 26.5 and are trying to understand the conditions under which PackageKit may return the following errors during an upgrade installation: PKInstallErrorDomain Code=120 NSPOSIXErrorDomain Code=1 ("Operation not permitted") The package successfully passes validation and authorization, and pre-install scripts complete successfully. The failure occurs during the final PackageKit commit phase when PackageKit attempts to move/relink content from the installer sandbox to the destination volume. Relevant log snippets: PackageKit: Shoving /Root to / Error relinking file (primary): .../Contents/_CodeSignature/CodeResources failed _relinkFile(...) Operation not permitted PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=120 NSUnderlyingError: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" The issue is intermittent and only affects a subset of systems. The same package installs successfully on many machines running the same macOS version. Has anyone encountered similar _relinkFile / CodeResources failures during package upgrades? In particular, we are interested in understanding: Common causes of NSPOSIXErrorDomain Code=1 during PackageKit relink operations. Whether existing signed application bundle metadata (CodeResources) can cause relink failures during upgrades. Any Installer or PackageKit changes in recent Tahoe releases that could affect bundle replacement during package installation. Any insights would be appreciated.
Replies
4
Boosts
0
Views
254
Activity
1h
Is it possible to run macOS VM (Virtualization API) under a launchd daemon?
Hi, I was trying to run a macOS VM under a launchd daemon as part of a requirement. The parent daemon spawns a macOS VM under root user. Sometimes this is fine, but sometimes I'm getting a security error from VZ library : Unable to access security information. The virtual machine encountered a security error. In system logs, I was able to see this : ctkd: unable to generate key: error e00002e2 for com.apple.Virtualization.VirtualMachine with SepKey ACL I think this indicates Virtualization.framework asked CryptoTokenKit/Secure Enclave to create a key, and the security subsystem rejected it in the current execution context. Is it possible to run VM this way ? If yes, what am I missing ?
Replies
1
Boosts
0
Views
28
Activity
3h
Pinpointing dandling pointers in 3rd party KEXTs
I'm debugging the following kernel panic to do with my custom filesystem KEXT: panic(cpu 0 caller 0xfffffe004cae3e24): [kalloc.type.var4.128]: element modified after free (off:96, val:0x00000000ffffffff, sz:128, ptr:0xfffffe2e7c639600) My reading of this is that somewhere in my KEXT I'm holding a reference 0xfffffe2e7c639600 to a 128 byte zone that wrote 0x00000000ffffffff at offset 96 after that particular chunk of memory had been released and zeroed out by the kernel. The panic itself is emitted when my KEXT requests the memory chunk that's been tempered with via the following set of calls. zalloc_uaf_panic() __abortlike static void zalloc_uaf_panic(zone_t z, uintptr_t elem, size_t size) { ... (panic)("[%s%s]: element modified after free " "(off:%d, val:0x%016lx, sz:%d, ptr:%p)%s", zone_heap_name(z), zone_name(z), first_offs, first_bits, esize, (void *)elem, buf); ... } zalloc_validate_element() static void zalloc_validate_element( zone_t zone, vm_offset_t elem, vm_size_t size, zalloc_flags_t flags) { ... if (memcmp_zero_ptr_aligned((void *)elem, size)) { zalloc_uaf_panic(zone, elem, size); } ... } The panic is triggered if memcmp_zero_ptr_aligned(), which is implemented in assembly, detects that an n-sized chunk of memory has been written after being free'd. /* memcmp_zero_ptr_aligned() checks string s of n bytes contains all zeros. * Address and size of the string s must be pointer-aligned. * Return 0 if true, 1 otherwise. Also return 0 if n is 0. */ extern int memcmp_zero_ptr_aligned(const void *s, size_t n); Normally, KASAN would be resorted to to aid with that. The KDK README states that KASAN kernels won't load on Apple Silicon. Attempting to follow the instructions given in the README for Intel-based machines does result in a failure for me on Apple Silicon. I stumbled on the Pishi project. But the custom boot kernel collection that gets created doesn't have any of the KEXTs that were specified to kmutil(8) via the --explicit-only flag, so it can't be instrumented in Ghidra. Which is confirmed as well by running: % kmutil inspect -B boot.kc.kasan boot kernel collection at /Users/user/boot.kc.kasan (AEB8F757-E770-8195-458D-B87CADCAB062): Extension Information: I'd appreciate any pointers on how to tackle UAFs in kernel space.
Replies
12
Boosts
0
Views
1.5k
Activity
5h
蓝牙设备是否可以在不同应用状态(后台、锁屏、应用被终止)下唤醒 App?
大家好, 我们正在开发一款基于 CoreBluetooth 的 iOS 应用,希望确认 iOS 在不同应用生命周期状态下的预期行为。 我们主要关注以下几种常见场景: App 在后台运行(未被终止); iPhone 处于锁屏状态,App 在后台运行; iPhone 处于锁屏状态,App 已被系统终止; iPhone 处于锁屏状态,App 已被用户从后台上滑关闭(Force Quit)。 当 BLE Peripheral 发生与该 App 相关的广播、连接或其他蓝牙事件时,我们想确认: 在上述不同场景下,BLE 设备是否能够触发 iOS 唤醒、启动或重新启动 App? 如果可以,不同场景分别需要满足哪些条件(例如 CoreBluetooth Background Modes、State Restoration、连接事件等)? 如果 App 已被用户 Force Quit,是否仍存在任何可以重新启动 App 的官方支持方式? 锁屏状态是否会对上述行为产生额外限制? 我们的目标是了解 iOS 官方支持的能力边界,以及不同应用状态下 BLE 与 App 生命周期的交互行为,而不是具体的实现细节。 感谢大家!
Replies
5
Boosts
0
Views
702
Activity
14h
Monterey:Network System Extension OSSystemExtensionRequest.deactivationRequest fails with authorizationRequired = 13
Hello, On Mac OS monterey, OSSystemExtensionRequest.deactivationRequest is failing with deactivation request for com.xxxxxx.networkextensionapp.netextension failed authorization check, error: Error Domain=OSSystemExtensionErrorDomain Code=13 "(null)" Even after providing the correct credentials for authorisation when prompted for.
Replies
4
Boosts
0
Views
1.7k
Activity
1d
Kernel Sandbox/System Policy intermittently denies ALL file access (not just mount syscall) on NFS mounts
I'm seeing a recurring issue on macOS 26.5.2 (build 25F84) where the kernel's Sandbox/System Policy layer intermittently denies file access on NFS mount points from local network servers. Posting here in case anyone recognizes this pattern or has a workaround, and flagging it since I've also filed a Feedback Assistant report (with a live-captured sysdiagnose) for the same issue. WHAT HAPPENS Two independent NFS mounts to two separate, unrelated servers on my LAN start failing simultaneously with "Operation not permitted." The kernel log shows: kernel: (Sandbox) System Policy: mount_nfs(PID) deny(1) file-mount /path/to/mount Critically, it's not limited to the mount syscall - within the same few-second window, System Policy also denies ls, perl, diskutil, and even umount -f on the exact same path, for otherwise unrelated processes. So it looks like a transient, path-scoped kernel decision rather than something specific to NFS or the mount syscall. It self-heals anywhere from seconds to ~30 minutes later, then recurs - documented 30-80+ occurrences/day via a background watchdog script. WHAT I'VE RULED OUT Server-side cause: two independent servers on different hardware fail identically at the same instant. Network issue: checked network logs in the same window, no correlated connectivity event. Third-party kext conflict: kextstat shows zero third-party kexts loaded. syspolicyd database corruption: no "ASP: Validation category" signature present. TCC/Full Disk Access: already granted; the denying layer is kernel Sandbox "System Policy," not TCC. QUESTION Has anyone else run into System Policy denying file-mount/file-read-data/file-unmount on network volume paths intermittently like this? Is there any userland way to inspect or reset whatever internal state drives this decision (I haven't found one - no spctl/tccutil/sysctl lever that touches it)? Happy to share more log excerpts if useful.
Replies
18
Boosts
0
Views
1.1k
Activity
1d
Does the Channel Sounding have regional restrictions by country?
I'm trying to get the new Bluetooth Channel Sounding distance measurement working between an iPhone 17 running iOS 27 Beta4 and a Nordic nRF54L15DK board. I enabled bonding in the latest ipt_reflector sample from Nordic. Someone get the sample working with iOS 27 beta1. I paired the board with AccessorySetupKit. I suspect that the Channel Sounding feature is subject to regional restrictions by country (China). Here's the code to check if CS is available on my iPhone func centralManagerDidUpdateState(_ central: CBCentralManager) { switch central.state { case .poweredOn: print("central update") if CBCentralManager.supports(.channelSounding) { print("Supports channel sounding - YES") } else { print("Supports channel sounding - NO") } if let id = pendingPeripheralIdentifier, let name = pendingPeripheralName { pendingPeripheralIdentifier = nil pendingPeripheralName = nil retrieveAndConnect(identifier: id, name: name) } case .poweredOff: connectionState = .bluetoothOff case .unauthorized: connectionState = .error("Bluetooth not authorized — check Settings") case .unsupported: connectionState = .error("BLE not supported on this device") default: break } } The console log shows [ASK] Session activated — accessories: 1 central update Supports channel sounding - NO [CS] startChannelSounding skipped — channelSounding not supported Please also check the topic. it's very similar.
Replies
1
Boosts
0
Views
392
Activity
1d
Apple Silicon prevents execution of wine for Windows ARM64 binaries due to JIT/W^X restrictions and x18 register reservation
I am porting Wine to macOS to run Windows on ARM (WOA) binaries. Windows PE files place .text and .data in the same page, which macOS’s JIT/W^X model cannot handle. pthread_jit_write_protect_np() cannot be used for foreign ARM64 code. Apple Silicon reserves x18, breaking the Windows ARM64 ABI. Wine also must reserve 0x7FFE0000 for the Windows TEB, but macOS cannot guarantee this address. These issues make it impossible for Wine to load or execute WOA binaries. I am requesting mechanisms to safely execute foreign ARM64 code, support mixed W/X pages, emulate x18, and reserve the Windows TEB region. Branch is here: https://github.com/trcrsired/wine/tree/apple-silicon-mac-woa
Replies
1
Boosts
0
Views
88
Activity
2d
Possible change in sysctlbyname() / oldlenp behavior on iOS and iPadOS 27
I am investigating an issue involving sysctlbyname("hw.machine", ...) that became observable after moving to iOS/iPadOS 27. The affected legacy code is essentially the following: void getPlatform(unsigned char machine[]) { size_t size; sysctlbyname("hw.machine", machine, &size, NULL, 0); for (int i = 0; i < size; i++) { if (machine[i] == ',') { machine[i] = '.'; } } } The caller provides a zero-initialized fixed-size buffer: unsigned char machine[20] = {0}; getPlatform(machine); I understand that this implementation is incorrect because size is not initialized. When oldp is non-NULL, oldlenp must provide the available size of the buffer. A correct implementation would therefore initialize it, for example: void getPlatform(unsigned char *machine, size_t capacity) { size_t size = capacity; if (sysctlbyname("hw.machine", machine, &size, NULL, 0) != 0) return; for (size_t i = 0; i < size; i++) { if (machine[i] == ',') machine[i] = '.'; } } with: unsigned char machine[20] = {0}; getPlatform(machine, sizeof(machine)); The question is not whether the original implementation is valid. It clearly relies on an uninitialized value and should be corrected. What I am trying to understand is why the issue became observable specifically on iOS/iPadOS 27, and whether there has been any related implementation or documentation change. Using LLDB, I inspected the arguments at the entry to: sysctlbyname("hw.machine", machine, &size, NULL, 0); Because size is uninitialized, the value referenced by oldlenp varies depending on the contents of the stack location. For example, I observed a call where: *oldlenp = 0 The call then returned: return = -1 errno = 12 (ENOMEM) and the output buffer remained empty. In another execution, the same uninitialized stack location happened to contain a very large value. In that case sysctlbyname() succeeded and returned the expected hardware identifier: iPhone18,2 Adding unrelated code such as printf() can also change whether the original implementation succeeds, which is consistent with the uninitialized value being affected by changes in stack/register layout. There is also a second issue I would like clarification on regarding the documented behavior of oldlenp. The current documentation states that when the amount of data is greater than the value supplied through oldlenp, the function updates it to the required size and returns ENOMEM. It also states: The function doesn’t modify the value if it’s larger than or equal to the amount of available data. However, this does not match what I observed at runtime. For example, in one successful call I observed: Before sysctlbyname(): *oldlenp = 4301365248 The value was clearly much larger than required. After the call returned successfully: return = 0 machine = "iPhone18,2" *oldlenp = actual returned data length In other words, oldlenp was modified on a successful call even though the input value was already much larger than the amount of data being returned. I would appreciate clarification on the following: Was there any implementation change to sysctlbyname(), sysctl(), or the handling of oldlenp in iOS/iPadOS 27? Have there been changes in compiler/runtime behavior on iOS/iPadOS 27 that could make this type of existing uninitialized-variable bug surface more consistently? Is the documented statement that oldlenp is not modified when the supplied value is sufficiently large still accurate for sysctlbyname() on current iOS versions? Has the documentation or intended contract for oldlenp changed recently? Have other developers observed ENOMEM from existing sysctlbyname() code after updating to iOS/iPadOS 27? Again, I understand that the original code is incorrect and should initialize oldlenp before calling sysctlbyname(). The part I am trying to clarify is whether iOS/iPadOS 27 introduced any behavioral change that exposed this latent bug, and whether the currently documented successful-call behavior of oldlenp matches the actual implementation.
Replies
2
Boosts
0
Views
116
Activity
2d
Behavior of cblas_zgemv when array contains nan.
In NumPy (actually originally in SciPy), we found a case where multiplying a complex matrix that contains inf+nanj by a complex vector could result in nan in the output vector in positions where the corresponding rows of the inputs did not contain nan. I have a C++ program and data to demonstrate this at https://github.com/WarrenWeckesser/experiments/tree/main/c%2B%2B/accelerate-zgemv-bug. When the full matrix CC is multiplied with the vector weights, the output at element 17 is nan. When just row 17 of CC is multiplied with weights, the result is not nan. The matrix CC does have some occurrences of inf+nanj, but not in the row that produces element 17 of the output. Is this a bug? Is there some way that the value inf+nanj in the input matrix can "contaminate" the output in a position that should give a non-nan value?
Replies
3
Boosts
0
Views
276
Activity
5d
Managed Apple ID works for iMessage on bare metal, but fails in macOS VM (same hardware)
Hi all, I'm running 2 macOS VMs on a bare-metal Mac (host is also macOS). I'm seeing inconsistent iMessage sign-in behavior depending on the Apple ID type and whether it's bare metal or virtualized: Managed Apple ID (ABM-issued): signs into iMessage fine on the bare-metal host. Same Managed Apple ID: fails to sign into iMessage inside the VM on the same physical machine. Personal/basic Apple ID: signs in fine in the VM without issue. Has anyone run into this specific combination — MAID working on bare metal but not inside a VM, while a personal ID works fine in both?
Replies
2
Boosts
0
Views
304
Activity
5d
Using AppKit and Core Graphics within a CUPS filter context on macOS
Hello, I am currently developing a printed data security feature for a cross-platform DLP system. On other platforms, this functionality relies on a cross-platform third-party library. On macOS, this library depends on the Core Graphics and AppKit frameworks. So, such dependency makes it impossible to use the code within a launch daemon, which is where this mechanism needs to run. As an alternative approach, I am considering implementing the necessary functionality inside a CUPS filter. However, I have some doubts regarding the execution context of the CUPS filter process. Is it safe to use AppKit within a CUPS filter? Thank you in advance.
Replies
0
Boosts
0
Views
129
Activity
5d
Should SDK developers use UserDefaults?
UserDefaults store app-related settings, and I am just worried that if an SDK also writes to the UserDefaults, that there could be potentially some key collisions between the host app and the SDK. Is the concern just in my head or does it have merit?
Replies
3
Boosts
0
Views
214
Activity
6d
macOS 27 beta — TCC intermittently blocks file writes during postinstall (I/O errors when unpacking .app)
Our app uses a Distribution.xml-based installer. Within the postinstall script, we attempt to untar a signed and notarized .app to the /Applications directory. On macOS 27 (tested up to Developer Beta 4), the tar command randomly fails to write random unpacked files with an I/O error; in the console there is "spolicyd[721] revoked access to "/Applications/XXX.app/file/within". It can be reproduced approximately every 4th install. Is this happening for anyone else? Any known workaround?
Replies
3
Boosts
1
Views
284
Activity
1w
CTCellularPlanStatus.checkValidity(ofToken:) throws Couldn't communicate with a helper application on iOS 26
Hello, We are using the UPI device validation APIs on iOS 26+ in a production banking/UPI app, and we are seeing a recurring failure from CoreTelephony that we need guidance on. API / entitlement Framework: CoreTelephony API: CTCellularPlanStatus.checkValidity(ofToken:) Related: CTCellularPlanStatus.token() Entitlement: com.apple.developer.upi-device-validation Availability: iOS 26.0+ Minimal call site do { let isValid = try await CTCellularPlanStatus.checkValidity(ofToken: token) // isValid == true/false -> expected outcomes } catch { // Unexpected: API throws instead of returning Bool print(error.localizedDescription) } Error error.localizedDescription is: English: Couldn't communicate with a helper application. Same failure also appears with a localized Hindi message on Hindi-locale devices. This is distinct from checkValidity(ofToken:) returning false (token/SIM mismatch). Here the API throws, so we cannot tell whether the token is valid. In production we currently only have this localizedDescription from telemetry. Production observations (large fleet, last few days) Observed only on production user devices so far; we have not reproduced it reliably on lab hardware. Occurs across multiple iOS 26.x builds (notably 26.5.2, 26.5, 26.6; also seen on 26.0-27.0). Not limited to a single patch. Seen on many iPhone models (not one SKU). Latency is bimodal for the same error string: large share fails in under 100 ms (immediate) another large share fails after about 2-10+ seconds (timeout-like) Observed under Wi-Fi, cellular (4G/5G), and No Connection / radio-not-ready conditions. Same device can emit many identical failures within about 1 second when validity is checked from multiple call sites concurrently. Token generation (CTCellularPlanStatus.token()) and successful checkValidity work for the vast majority of users; this throw is a smaller but material failure class. Questions for Apple Is "Couldn't communicate with a helper application." an expected / documented failure mode of checkValidity(ofToken:) (for example CommCenter/XPC unavailable, radio not ready)? What conditions typically trigger this error from checkValidity(ofToken:)? Recommended client handling: retry (with backoff)? treat as transient and skip forcing re-binding? surface to user? Does validation require cellular registration / SIM ready state even when docs indicate internet is not required? Any known issues on specific iOS 26.x builds, dual-SIM, eSIM, or airplane-mode transitions? Is concurrent checkValidity from multiple tasks unsupported / unsafe? Because this is currently production-only and not reliably reproducible on lab devices, we cannot attach a sysdiagnose or Instruments trace at this time. We can share aggregated production telemetry and API details via Feedback Assistant if helpful. Thank you.
Replies
1
Boosts
0
Views
279
Activity
1w
CMIO system extension: sysextd "no policy" + code 4 on 26.5 — resolved in 27?
Is macOS 27 Public Beta 2 able to activate new non‑MDM CMIO system extensions that fail on macOS 26.5.2? I'm building a virtual-camera app with a CMIO camera system extension (Developer ID signed + notarized), for personal use on my own Macs — no MDM. On macOS 26.5.2 (25F80) I can't get a new activation to succeed, and I'm trying to find out whether macOS 27 resolves it. Two failure modes I've seen: With SIP enabled, OSSystemExtensionRequest reaches the daemon, then sysextd logs: "no policy, cannot allow apps outside /Applications" — even though the app is in /Applications (verified real path, single copy, running from there). This matches other reports (e.g. LuLu / network extensions). With SIP disabled + systemextensionsctl developer on, it now fails earlier, client-side, with OSSystemExtensionErrorDomain code 4 — "Extension not found in App bundle / Unable to find any matched extension with identifier" — the request never even reaches sysextd. Things I've already verified/ruled out: Product type com.apple.product-type.system-extension; extension embedded at Contents/Library/SystemExtensions/; matching CFBundleIdentifier and Team ID; CMIOExtensionMachServiceName = $(TeamIdentifierPrefix)$(bundle id). App has com.apple.developer.system-extension.install (with authorizing profile); shared App Group + camera entitlement on both app and extension. Valid codesign --deep --strict; notarized + stapled; single LaunchServices registration; running the correct bundle. Reproduces with both Developer ID and Apple Development signing, and running straight from Xcode with a signed-in account. So the app/extension appear structurally correct; this looks like an OS-side regression in 26.5.x. My question: Has anyone successfully activated a new Developer ID (non-MDM) CMIO / system extension on macOS 27 Golden Gate Public Beta 2? Is this sysextd / code‑4 activation regression fixed there, or is it still present? Trying to decide whether upgrading is worth it. Thank you!
Replies
1
Boosts
0
Views
166
Activity
1w
App with shallow depth entitlement not appearing in Auto-Launch > When Submerged
I'm building a freediving app for Apple Watch Ultra using the shallow depth entitlement (com.apple.developer.submerged-shallow-depth-and-pressure). My app uses WKExtendedRuntimeSession with the underwater-depth background mode, and it works correctly — the session starts, Water Lock activates automatically, and Crown hold water ejection ends the session as expected. However, the app does not appear in Settings > General > Auto-Launch > When Submerged on the watch. Other third-party apps (including one that hasn't been updated in ~2 years and presumably only has the shallow entitlement) do appear in this list. My configuration: WKBackgroundModes: ["underwater-depth", "workout-processing"] WKSupportsAutomaticDepthLaunch: true (Boolean, in watch app Info.plist) Entitlement verified in both the signed binary and provisioning profile watchOS 26.3, Apple Watch Ultra 2 Tested with: development build, TestFlight, and direct Xcode deploy. Watch restarted after each. The app does not appear in any case. The documentation at https://developer.apple.com/documentation/coremotion/accessing-submersion-data states: "Adding the underwater-depth Background Mode capability also adds your app to the list of apps that the system can autolaunch when the wearer submerges the watch." Does auto-depth-launch require the full depth entitlement (com.apple.developer.submerged-depth-and-pressure), or should the shallow entitlement be sufficient? Is there an additional step required for the app to appear in the When Submerged list? Any guidance appreciated.
Replies
3
Boosts
1
Views
442
Activity
1w
User created via VZMacGuestProvisioningOptions is not returned by CSIdentityQueryExecute()
This post applies to Apple Virtualization framework feature to setup a user account during VM setup (VZMacGuestProvisioningOptions) introduced in macOS 27: Issue: Creating a user via VZMacGuestProvisioningOptions during VM setup, results in a user which is not returned by CSidentityQueryExecute(). Same code executed on a macOS 26 VM or a macOS 27 VM where the user was created by hand within the VM (so without VZMacGuestProvisioningOptions) returns the user. How to reproduce: Create an VM via the Apple Virtualization framework and use the VZMacGuestProvisioningOptions to create the user during VM setup. I actually used Virtual Buddy and Tart to do this. Then run the following code: internal enum MyLogger { static let info = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Utils-\(getuid())") } public struct Identity { public let posixUID: id_t public let posixName: String init?(posixUID: id_t, posixName: String) { self.posixUID = posixUID self.posixName = posixName } } class Utils { public static func userIdentities() -> [Identity] { let defaultAuthority = CSGetLocalIdentityAuthority().takeUnretainedValue() let query = CSIdentityQueryCreate(nil, kCSIdentityClassUser, defaultAuthority).takeRetainedValue() guard CSIdentityQueryExecute(query, 0, nil), let identities = CSIdentityQueryCopyResults(query).takeRetainedValue() as? [CSIdentity] else { return [] } for ident in identities { MyLogger.info.log("CSIdentity: \(ident.hashValue, privacy: .public)") } let idents = identities .compactMap { Identity( posixUID: CSIdentityGetPosixID($0), posixName: CSIdentityGetPosixName($0).takeUnretainedValue() as String ) } .sorted { $0.posixName.localizedStandardCompare($1.posixName) == .orderedAscending } for ident in idents { MyLogger.info.log("Identity: \(ident.posixName, privacy: .public), \(ident.posixUID, privacy: .public)") } return idents } } Expected behavior: The code returns the user account created via VZMacGuestProvisioningOptions. Actual behavior: I get no user account When you test the same on a macOS 27 VM where the user is created via the traditional way (Setup assistant), the app shows the account. This also applies to all additional user accounts created after VM setup via System Settings.app. The bug also still exists on a VM created with macOS 27 beta 4. Is anybody having the same issue? Is that a bug in macOS 27? I already created a Feedback for this: FB23716201
Replies
3
Boosts
0
Views
560
Activity
1w
FSKit - Retrieve Process ID?
Does FSKit support the ability to get the process information, such as the pid, when a process accesses a resource? Being able have the process context is important for implementing certain access patterns and security logging in some contexts. For instance, we have a system that utilizes (pre-FSKit) a FUSE mount that, depending on the process has different "views" and "access" based on the process id.
Replies
3
Boosts
0
Views
720
Activity
1w
Removing or invalidating a BLE bond when the app is the peripheral (CBPeripheralManager)
Our iOS app runs in the peripheral role. A hardware accessory acts as the central: it connects to the app and bonds in order to read and write characteristics we declare with encryption-required permissions. The app advertises so a previously bonded accessory can reconnect on its own. The problem is that the bond lives on both sides and we can only clear one of them. The accessory has its own "forget this phone" function, and it can also be told to do so remotely. iOS keeps its half, and we have not found any way for the app to remove or invalidate it. What we've checked: CBPeripheralManager and CBCentral expose no unpair or unbond operation. A CBCentral is only visible while connected or subscribed, and its identifier is a resolved handle. Questions: Is there a supported way for an app in the peripheral role to remove or invalidate the pairing keys for a bonded central? If we've missed an API, please point us at it. If not, what's the recommended approach when the peer has discarded its keys and the bond is no longer usable? Can a peripheral-role app detect that state — a distinguishable error or connection event when encryption fails — so we can tell the user something accurate instead of a generic connection failure?
Replies
3
Boosts
0
Views
297
Activity
1w