Compare commits
4 Commits
0.14.4
...
mesosphere
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b3b08bdeb | ||
|
|
84f17f6a3a | ||
|
|
3b0ed9cdba | ||
|
|
4df583cbb6 |
@@ -1,12 +1,4 @@
|
||||
# Changelog
|
||||
## 0.14.4
|
||||
+ Several bugs were fixed involving the official jit sysmodule added in 10.0.0.
|
||||
+ A Process handle leak was fixed when JitPlugin NRRs were registered with the `ro` sysmodule.
|
||||
+ This prevented processes using jit from being able to exit, causing a full system freeze.
|
||||
+ The `sm` atmosphere extension to not unregister services when the server's connection is closed was special-case disabled for `jit:u`.
|
||||
+ This extension is normally desirable in order to allow more concurrent processes to exist (as only 0x40 sm connections may ever be concurrently open), but official jit sysmodule relies on the behavior.
|
||||
+ This would cause crashes on attempts to launch a program using jit services more than once per reboot.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 0.14.3
|
||||
+ Support was added for 10.2.0.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
|
||||
branch = master
|
||||
commit = f6dac1e67793233cc916f317cf517244dd348a5e
|
||||
parent = 909a1767a6080bab7ea6032c00e1ff4cec993af0
|
||||
commit = 48dbf4808f4f2042de8c45e9ec471a8f60d5d621
|
||||
parent = 47d0d5c6abc1c9957cd05c63b02ee5e712179b80
|
||||
method = merge
|
||||
cmdver = 0.4.1
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 0
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MINOR 14
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 4
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 3
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
|
||||
|
||||
|
||||
@@ -382,13 +382,13 @@ namespace ams::ro::impl {
|
||||
}
|
||||
|
||||
/* Context utilities. */
|
||||
Result RegisterProcess(size_t *out_context_id, os::ManagedHandle process_handle, os::ProcessId process_id) {
|
||||
Result RegisterProcess(size_t *out_context_id, Handle process_handle, os::ProcessId process_id) {
|
||||
/* Validate process handle. */
|
||||
{
|
||||
os::ProcessId handle_pid = os::InvalidProcessId;
|
||||
|
||||
/* Validate handle is a valid process handle. */
|
||||
R_UNLESS(R_SUCCEEDED(os::TryGetProcessId(&handle_pid, process_handle.Get())), ResultInvalidProcess());
|
||||
R_UNLESS(R_SUCCEEDED(os::TryGetProcessId(&handle_pid, process_handle)), ResultInvalidProcess());
|
||||
|
||||
/* Validate process id. */
|
||||
R_UNLESS(handle_pid == process_id, ResultInvalidProcess());
|
||||
@@ -397,7 +397,7 @@ namespace ams::ro::impl {
|
||||
/* Check if a process context already exists. */
|
||||
R_UNLESS(GetContextByProcessId(process_id) == nullptr, ResultInvalidSession());
|
||||
|
||||
*out_context_id = AllocateContext(process_handle.Move(), process_id);
|
||||
*out_context_id = AllocateContext(process_handle, process_id);
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
@@ -413,13 +413,13 @@ namespace ams::ro::impl {
|
||||
}
|
||||
|
||||
/* Service implementations. */
|
||||
Result RegisterModuleInfo(size_t context_id, os::ManagedHandle process_handle, u64 nrr_address, u64 nrr_size, NrrKind nrr_kind, bool enforce_nrr_kind) {
|
||||
Result RegisterModuleInfo(size_t context_id, Handle process_h, u64 nrr_address, u64 nrr_size, NrrKind nrr_kind, bool enforce_nrr_kind) {
|
||||
/* Get context. */
|
||||
ProcessContext *context = GetContextById(context_id);
|
||||
AMS_ABORT_UNLESS(context != nullptr);
|
||||
|
||||
/* Get program id. */
|
||||
const ncm::ProgramId program_id = context->GetProgramId(process_handle.Get());
|
||||
const ncm::ProgramId program_id = context->GetProgramId(process_h);
|
||||
|
||||
/* Validate address/size. */
|
||||
R_TRY(ValidateAddressAndNonZeroSize(nrr_address, nrr_size));
|
||||
|
||||
@@ -30,12 +30,12 @@ namespace ams::ro::impl {
|
||||
bool ShouldEaseNroRestriction();
|
||||
|
||||
/* Context utilities. */
|
||||
Result RegisterProcess(size_t *out_context_id, os::ManagedHandle process_handle, os::ProcessId process_id);
|
||||
Result RegisterProcess(size_t *out_context_id, Handle process_handle, os::ProcessId process_id);
|
||||
Result ValidateProcess(size_t context_id, os::ProcessId process_id);
|
||||
void UnregisterProcess(size_t context_id);
|
||||
|
||||
/* Service implementations. */
|
||||
Result RegisterModuleInfo(size_t context_id, os::ManagedHandle process_h, u64 nrr_address, u64 nrr_size, NrrKind nrr_kind, bool enforce_nrr_kind);
|
||||
Result RegisterModuleInfo(size_t context_id, Handle process_h, u64 nrr_address, u64 nrr_size, NrrKind nrr_kind, bool enforce_nrr_kind);
|
||||
Result UnregisterModuleInfo(size_t context_id, u64 nrr_address);
|
||||
Result MapManualLoadModuleMemory(u64 *out_address, size_t context_id, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size);
|
||||
Result UnmapManualLoadModuleMemory(size_t context_id, u64 nro_address);
|
||||
|
||||
@@ -56,20 +56,12 @@ namespace ams::ro {
|
||||
}
|
||||
|
||||
Result RoService::RegisterProcessHandle(const sf::ClientProcessId &client_pid, sf::CopyHandle process_h) {
|
||||
/* Ensure we manage references to the process handle correctly. */
|
||||
os::ManagedHandle process_handle(process_h.GetValue());
|
||||
|
||||
/* Register the process. */
|
||||
return impl::RegisterProcess(std::addressof(this->context_id), std::move(process_handle), client_pid.GetValue());
|
||||
return impl::RegisterProcess(std::addressof(this->context_id), process_h.GetValue(), client_pid.GetValue());
|
||||
}
|
||||
|
||||
Result RoService::RegisterProcessModuleInfo(const sf::ClientProcessId &client_pid, u64 nrr_address, u64 nrr_size, sf::CopyHandle process_h) {
|
||||
/* Ensure we manage references to the process handle correctly. */
|
||||
os::ManagedHandle process_handle(process_h.GetValue());
|
||||
|
||||
/* Register the module. */
|
||||
R_TRY(impl::ValidateProcess(this->context_id, client_pid.GetValue()));
|
||||
return impl::RegisterModuleInfo(this->context_id, std::move(process_handle), nrr_address, nrr_size, this->nrr_kind, this->nrr_kind == NrrKind_JitPlugin);
|
||||
return impl::RegisterModuleInfo(this->context_id, process_h.GetValue(), nrr_address, nrr_size, this->nrr_kind, this->nrr_kind == NrrKind_JitPlugin);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -350,12 +350,6 @@ namespace ams::sm::impl {
|
||||
return service == ServiceName::Encode("fsp-srv");
|
||||
}
|
||||
|
||||
bool ShouldCloseOnClientDisconnect(ServiceName service) {
|
||||
/* jit sysmodule is closed and relaunched by am for each application which uses it. */
|
||||
constexpr auto JitU = ServiceName::Encode("jit:u");
|
||||
return service == JitU;
|
||||
}
|
||||
|
||||
Result GetMitmServiceHandleImpl(Handle *out, ServiceInfo *service_info, const MitmProcessInfo &client_info) {
|
||||
/* Send command to query if we should mitm. */
|
||||
bool should_mitm;
|
||||
@@ -425,28 +419,6 @@ namespace ams::sm::impl {
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Client disconnection callback. */
|
||||
void OnClientDisconnected(os::ProcessId process_id) {
|
||||
/* Ensure that the process id is valid. */
|
||||
if (process_id == os::InvalidProcessId) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* NOTE: Nintendo unregisters all services a process hosted on client close. */
|
||||
/* We do not do this as an atmosphere extension, in order to reduce the number */
|
||||
/* of sessions open at any given time. */
|
||||
/* However, certain system behavior (jit) relies on this occurring. */
|
||||
/* As such, we will special case the system components which rely on the behavior. */
|
||||
for (size_t i = 0; i < ServiceCountMax; i++) {
|
||||
if (g_service_list[i].name != InvalidServiceName && g_service_list[i].owner_process_id == process_id) {
|
||||
if (ShouldCloseOnClientDisconnect(g_service_list[i].name)) {
|
||||
g_service_list[i].Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Process management. */
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
namespace ams::sm::impl {
|
||||
|
||||
/* Client disconnection callback. */
|
||||
void OnClientDisconnected(os::ProcessId process_id);
|
||||
|
||||
/* Process management. */
|
||||
Result RegisterProcess(os::ProcessId process_id, ncm::ProgramId program_id, cfg::OverrideStatus, const void *acid_sac, size_t acid_sac_size, const void *aci_sac, size_t aci_sac_size);
|
||||
Result UnregisterProcess(os::ProcessId process_id);
|
||||
|
||||
@@ -19,12 +19,6 @@
|
||||
|
||||
namespace ams::sm {
|
||||
|
||||
UserService::~UserService() {
|
||||
if (this->has_initialized) {
|
||||
impl::OnClientDisconnected(this->process_id);
|
||||
}
|
||||
}
|
||||
|
||||
Result UserService::RegisterClient(const sf::ClientProcessId &client_process_id) {
|
||||
this->process_id = client_process_id.GetValue();
|
||||
this->has_initialized = true;
|
||||
|
||||
@@ -26,8 +26,6 @@ namespace ams::sm {
|
||||
bool has_initialized = false;
|
||||
private:
|
||||
Result EnsureInitialized();
|
||||
public:
|
||||
virtual ~UserService();
|
||||
public:
|
||||
/* Official commands. */
|
||||
Result RegisterClient(const sf::ClientProcessId &client_process_id);
|
||||
|
||||
Reference in New Issue
Block a user