Big Sur: Memory buffers (mbuf) deprecated?

Hello,

we are currently investigating how to migrate our VFS kext (Kernel extension for a virtual file system) to macOS Big Sur.

See related question

As suggested, we plan to replace the deprecated kernel socket API with KEXT Controls. Now we noticed that the callback function (configured in ctl_register) to receive the data sent by the client (from user space) uses a memory buffer (mbuf):

Code Block
typedef errno_t (*ctl_send_func)(kern_ctl_ref kctlref, u_int32_t unit, void *unitinfo, mbuf_t m, int flags);

However, according to the source code documentation, memory buffers are deprecated as well.

Does this mean:
  • Memory buffers won't work on Big Sur as well?

  • Is there a way to avoid using memory buffers when using KEXT Controls?

Thanks and regards
Michael

Is there a way to avoid using memory buffers when using KEXT Controls?

No.

Memory buffers won't work on Big Sur as well?

The mbuf KPI is marked as deprecated but it definitely still works. The tricky question is whether using it will prevent your KEXT from loading. AFAICT that’s not the case (it is not, for example, listed here) but I must admit that I haven’t tried it.

Still, we just seeded 11.0.1rc, so you should be able to test this yourself.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Big Sur: Memory buffers (mbuf) deprecated?
 
 
Q