Commit Graph

3487 Commits

Author SHA1 Message Date
Ariel Abreu
d83d98945a
Update LKM 2020-11-18 11:45:34 -05:00
Ariel Abreu
29ec91879b
Update a few submodules 2020-11-17 23:25:41 -05:00
Ariel Abreu
8a8ba48586
Unexpand vchroot paths returned by get{sock,peer}name 2020-11-17 23:25:20 -05:00
Ariel Abreu
42abab04aa
Use given kqueue in kevent_qos
I'm not quite sure why we used to always create our own kqueue, but that could cause all sorts of issues. For example, if the user decided to add events via a different kevent call and then use kevent_qos to poll, they wouldn't get any events because we're actually listening to a different kqueue. Another example: since the kqueue was always shared between kevent_qos calls, different kqueue fds called on kevent_qos would all operate on the same kqueue.

Of course, in the `kq=-1` case, we still perform the correct behavior of using our default kqueue. But if the user gave us a kqueue, let's use it.
2020-11-17 23:24:04 -05:00
Ariel Abreu
5f4253cd18
Apply Unix socket name fix to connect
See commit 2882e9b1e5
2020-11-16 17:55:18 -05:00
Ariel Abreu
04cde1ce11
Fix O_NONBLOCK for accepted sockets
macOS and BSD make sockets created from `accept` inherit the listening socket's O_NONBLOCK flag (and maybe some others, but that requires further testing).
2020-11-16 13:44:57 -05:00
Ariel Abreu
796582b3e3
Update LKM
This also includes necessary updates to certain functions in the syscall emulation layer that need to be changed due to changes in the LKM.
2020-11-16 13:39:01 -05:00
Ariel Abreu
65f3538d3c
Merge remote-tracking branch 'origin/master' into update-sources 2020-11-10 12:19:22 -05:00
Ariel Abreu
2882e9b1e5
FIx crash with Unix socket in bind
The comment pretty much explains it: we need to make sure we have enough space for the vchroot path fixup. This was causing segfaults when trying to use Unix sockets sometimes (consistently reproducible with the Mio test suite's Unix socket tests).
2020-11-10 10:14:40 -05:00
Ariel Abreu
1f53dcba60
Update ruby
Homebrew now installs again on the update-sources branch!
2020-11-10 00:03:32 -05:00
Ariel Abreu
60be04eddf
Update the LKM 2020-11-09 18:13:57 -05:00
Ariel Abreu
f95484fbf5
Update libxpc 2020-11-07 00:15:42 -05:00
Ariel Abreu
6a41d531eb
Update libxpc and security 2020-11-06 14:48:07 -05:00
Ariel Abreu
4674479e88
Update LKM 2020-11-05 10:43:31 -05:00
Ariel Abreu
767b4082c6
Use our LKM's generated syscall.h in SDK 2020-11-05 10:43:04 -05:00
Ariel Abreu
2eb37cde92
Update security 2020-11-03 11:54:59 -05:00
Ariel Abreu
1b3579e23b
Update some submodules 2020-11-03 11:51:51 -05:00
Ariel Abreu
b913fda18b
Fix some install paths in submodules 2020-11-02 10:42:00 -05:00
Ariel Abreu
cdb212de2a
Re-integrate darling-resolver into libinfo
I deleted it when I updated libinfo, but forgot to add the Darling changes back in
2020-11-02 10:40:04 -05:00
Ariel Abreu
fe89847f8d
Add back libsystem_dnssd stub 2020-11-02 10:38:29 -05:00
Ariel Abreu
d076f2bb46
Update SDK symlinks and submodules
[skip ci]

Skipping CI because I know the build is currently broken with this commit; I'm going to revert our use of mDNSResponder and add back our libsystem_dnssd stub, and then patch up libresolv/libinfo to fix DNS resolution (if necessary)
2020-11-01 23:47:05 -05:00
Ariel Abreu
4e8c677b71
Update configd and use its headers
We still keep our stubs, but we use Apple's own headers to make it easier to build stuff with it
2020-11-01 23:45:07 -05:00
Ariel Abreu
f6978c0c56
Conditionally import Objective-C code in Network framework 2020-11-01 23:43:25 -05:00
Ariel Abreu
cbcf01c0b9
Add CoreUtils stubs
Two of the new headers were imported from mDNSResponder's shared-between-platforms code and modified as necessary
2020-11-01 23:42:45 -05:00
Ariel Abreu
417f10ac21
Update target triplet and emulated OS version 2020-10-29 12:57:07 -04:00
Ariel Abreu
d2bfa2642e
Update some submodules 2020-10-29 12:55:50 -04:00
Ariel Abreu
b2aa87fbf3
Notify LKM when closing with dup2; Update LKM 2020-10-27 14:06:40 -04:00
Ariel Abreu
6eb5b25e1e
Don't race for kqueue when closing descriptors 2020-10-27 09:19:27 -04:00
Ariel Abreu
63f9a0e165
Remove libkqueue and use in-kernel kqueues
This commit pretty much just implements the bridge between userspace and kernel code for kqueues; for the real details of the change, check out the commit in the LKM.
2020-10-27 00:00:43 -04:00
Sergey Bugaev
1d3b099708 Attempt to link more libraries using two-level namespace
See https://github.com/darlinghq/darling/issues/879
2020-10-11 19:13:46 +03:00
Sergey Bugaev
90f72585d6 Update libc++
Fixes https://github.com/darlinghq/darling/issues/879
2020-10-11 12:19:40 +03:00
Sergey Bugaev
de223644de Fix some syscalls not following symlinks when they should
See https://github.com/ClickHouse/ClickHouse/issues/15609
2020-10-10 22:04:17 +03:00
Ariel Abreu
78afae595b
Update libdispatch and libkqueue 2020-10-07 12:50:49 -04:00
Ariel Abreu
93be7064ca
Update libkqueue and LKM 2020-10-06 08:39:26 -04:00
Ariel Abreu
c7ea2eaa4f
Support polling behavior on kevent_qos 2020-10-06 08:39:00 -04:00
Thomas A
755255813f Update libpthread and security 2020-10-04 18:53:48 -07:00
Thomas A
227f890ba5 Update submodules to use architecture abstraction code 2020-10-03 19:14:35 -07:00
Ariel Abreu
fdb80b9304
Implement PROC_PIDREGIONPATH
It's basically a lighter version of `PROC_PIDREGIONPATHINFO` with less information: region address, size, and owner path
2020-09-29 23:26:26 -04:00
Ariel Abreu
4e90a5c964
Remove QoS hack and add another one
See the commit in libdispatch for more information.
2020-09-29 23:22:41 -04:00
Ariel Abreu
2113c6a7bb
Update Security 2020-09-28 21:19:12 -04:00
Ariel Abreu
2ee1d4c6d1
workq_kernreturn: Extract initial flags and fix x86_64 assembly arguments
We need to initialize the flags in case we terminate as soon as we're created (because `_pthread_wqthread` requires valid flags).

This also fixes the x86_64 assembly to ensure that the 6th argument is actually passed (for some reason, the old code was causing the 6th argument to be a copy of the 5th). We don't need to specifically use `rbx`, so just use `r` and let the compiler decide what to use.
2020-09-28 18:00:55 -04:00
Ariel Abreu
01412206a1
ulock_wake: Correct return value on success
Callers expect `0` on success; we were returning Linux's return value (the number of callers awoken)
2020-09-28 13:54:27 -04:00
Ariel Abreu
329fee24bb
workq_kernreturn: Assign to variables when terminating
We were accidentally using NULL by forgetting to assign to `dthread` and `thread_self` when resuming the thread to kill it.
2020-09-28 13:53:35 -04:00
Ariel Abreu
538975f8fe
Update some module CMakeLists to compile again
`Security` will still need to be revised to abstract away architecture details.
2020-09-28 13:52:08 -04:00
Ariel Abreu
8cecb9a630
Add some more Mach port traps
These are for guarded ports. While I believe we don't currently deliver port guard violation exceptions, there are certain updated programs (like `notifyd`) that need to be able to create and destroy Mach ports using `mach_port_{construct,destruct}`. This commit therefore adds some of the necessary plumbing (which is enough to satisfy `notifyd`) and leaves it up to a future commit to add proper support for guarded ports and port guard violation exceptions.
2020-09-28 13:48:21 -04:00
Thomas A
03db084961 Abstract Architecture Detection/Assignment
The main goal of this commit is to make it more easy to add or update any architecture we want to support (such as ARM64). Any changes we want to make would be done in the architectures.cmake file.

The secondary goal of this commit is to encourage a more architecture generic nomenclature. We shouldn't use i368/x86_64 unless we are dealing with code that is specific to those architectures.
2020-09-27 18:54:06 -07:00
Ariel Abreu
2fe7f1ae07
Update libdispatch and libpthread 2020-09-27 21:49:42 -04:00
Ariel Abreu
10d7373f86
Update workq_kernreturn for some API changes
First, libpthread now expects `workq_kernreturn` not to return when called with `WQOPS_THREAD_RETURN`. We have to resume the thread and give it a special value for `nkevents` that tells it to kill itself.

Next, Apple has reworked the priority system into a "Quality of Service" (QoS) system. Unfortunately, since we're building libdispatch with a few different settings than Apple's configuration, it seems that they've forgotten to correctly set QoS in some cases, so we have to it for them so that libdispatch doesn't blow up.

Finally, `WQOPS_SETUP_DISPATCH` has been stubbed so libdispatch thinks everything is fine. In the future, we might want to do something with the values it passes in, but for now we have nothing to do with them.
2020-09-27 21:49:27 -04:00
Ariel Abreu
4cc0178c42
Fix workqueue thread support
I was accidentally clobbering the `stack_addr` arg which is actually the `flags` arg for workqueues.

Also, use `stack_addr` from `args` instead of `rdi` (which is the dthread pointer) because the user could have allocated a custom stack and libpthread passes that in.

Finally, workqueues have a separate flag to indicate that the TSD base has been set.
2020-09-27 21:41:49 -04:00
Ariel Abreu
7a07bbe6e5
Implement _os_cpu_number on top of Linux getcpu 2020-09-27 21:37:56 -04:00