Compare commits

...
8 Commits
Author SHA1 Message Date
Ole André Vadla Ravnås 58c8062f93 subprojects: Prepare for release 2025-06-27 15:59:50 +02:00
Kyle Bouchard a6be95d8ae agent: Disable Exceptor for the emulated realm
Exceptor needs to hook signal() and sigaction(), but they are in libc,
leading to gum_mprotect() aborting because it cannot change libc's
'r--' mapping.

I tested it on AVDs with Android 14 and 15 and it prevents the crash
observed in the upstream version when using frida-server or
frida-inject.
2025-06-27 15:58:12 +02:00
Ole André Vadla Ravnås db258f0d35 subprojects: Bump outdated 2025-06-27 15:50:28 +02:00
Francesco Tamagni bea95d0045 buffer: Fix max_length in read_fixed_string
So it is constrained both within the requested size and the buffer's
size.
2025-06-26 12:25:01 +02:00
Ole André Vadla Ravnås 57d2a83548 subprojects: Prepare for release 2025-06-23 18:44:25 +02:00
Ole André Vadla Ravnås 4474490f9b subprojects: Bump outdated 2025-06-23 18:41:09 +02:00
Ole André Vadla Ravnås a9ba854aa7 package-manager: Fix the dev logic 2025-06-22 10:22:42 +02:00
Ole André Vadla Ravnås 47c265b3df package-manager: Only bump if explicitly requested 2025-06-20 21:37:31 +02:00
4 changed files with 53 additions and 31 deletions

No files matched your search

+5 -5
View File
@@ -1400,12 +1400,12 @@ namespace Frida.Agent {
if (nb_api.unload_library == null)
parameters.append ("|eternal|sticky");
/*
* Disable ExitMonitor to work around a bug in Android's libndk_translation.so on Android 11.
* We need to avoid modifying libc.so ranges that the translator potentially depends on, to
* avoid blowing up when Interceptor's CPU cache flush results in the translated code being
* discarded, which seems like an edge-case the translator doesn't handle.
* Disable Exceptor and ExitMonitor to work around a bug in Android's libndk_translation.so
* on Android 11. We need to avoid modifying libc.so ranges that the translator potentially
* depends on, to avoid blowing up when Interceptor's CPU cache flush results in the translated
* code being discarded, which seems like an edge-case the translator doesn't handle.
*/
parameters.append ("|exit-monitor:off");
parameters.append ("|exceptor:off|exit-monitor:off");
emulated_bridge_state = new BridgeState (parameters.str);
+1 -1
View File
@@ -446,7 +446,7 @@ namespace Frida {
public string read_fixed_string (size_t offset, size_t size) throws Error {
string * start = (string *) get_pointer (offset, size);
size_t max_length = size - offset;
size_t max_length = size_t.min (size, this.size - offset);
string * end = memchr (start, 0, max_length);
size_t n;
if (end != null)
+46 -24
View File
@@ -161,18 +161,17 @@ namespace Frida {
original_dep.name,
original_dep.version,
original_dep,
original_dep.role,
toplevel_node_modules_root,
project_root,
manifest,
prefer_lockfile_for_this_dep,
cancellable,
dep_link_promise,
tracker,
all_physical_installs,
resolution_cache,
packument_cache,
top_level_placements
top_level_placements,
dep_link_promise,
cancellable
);
}
@@ -193,7 +192,7 @@ namespace Frida {
pkgs.add (new Package (ple.name, ple.version, ple.description));
var original_dep = ple.toplevel_dep;
var version = ple.newly_installed
var version = specs.has_key (ple.name)
? original_dep.derive_version (ple.version)
: original_dep.version;
new_manifest_dependencies.add (new PackageDependency () {
@@ -205,7 +204,8 @@ namespace Frida {
manifest.dependencies = new_manifest_dependencies;
install_progress (FINALIZING_MANIFESTS, 0.99);
yield write_back_manifests (manifest, finished_installs, pkg_json_file, lock_file, cancellable);
yield write_back_manifests (manifest, initial_dep_results, finished_installs, pkg_json_file, lock_file,
cancellable);
install_progress (COMPLETE, 1.0);
@@ -330,6 +330,7 @@ namespace Frida {
}
private class PackageLockEntry {
public string id;
public string name;
public string version;
public string resolved;
@@ -341,7 +342,7 @@ namespace Frida {
public PackageDependencies dependencies;
public PackageDependency toplevel_dep;
public bool newly_installed;
public Gee.Set<PackageRole> roles = new Gee.HashSet<PackageRole> ();
public Gee.List<PackageLockEntry> children = new Gee.ArrayList<PackageLockEntry> ();
}
private async Manifest load_manifest (File pkg_json_file, File lock_file, Cancellable? cancellable) throws Error, IOError {
@@ -444,8 +445,9 @@ namespace Frida {
return m;
}
private async void write_back_manifests (Manifest manifest, Gee.Map<string, PackageLockEntry> installed, File pkg_json_file,
File lock_file, Cancellable? cancellable) throws Error, IOError {
private async void write_back_manifests (Manifest manifest, Gee.List<PackageLockEntry> toplevel_installed,
Gee.Map<string, PackageLockEntry> all_installed, File pkg_json_file, File lock_file,
Cancellable? cancellable) throws Error, IOError {
string? name = null;
Json.Node? root = null;
string? old_pkg_json = null;
@@ -519,7 +521,9 @@ namespace Frida {
write_engines (manifest.engines, b);
b.end_object ();
foreach (var entry in installed.entries) {
var runtime_reach = compute_runtime_reach (toplevel_installed, all_installed);
foreach (var entry in all_installed.entries) {
string lockfile_key = entry.key;
PackageLockEntry e = entry.value;
bool is_root_package = lockfile_key == "";
@@ -539,7 +543,7 @@ namespace Frida {
.set_member_name ("integrity")
.add_string_value (e.integrity);
if (!e.roles.contains (RUNTIME))
if (!runtime_reach.contains (lockfile_key))
b.set_member_name ("dev").add_boolean_value (true);
write_license (e.license, b);
@@ -560,22 +564,43 @@ namespace Frida {
yield FS.write_all_text (lock_file, lock_json, cancellable);
}
private static Gee.Set<string> compute_runtime_reach (Gee.List<PackageLockEntry> toplevel_installed,
Gee.Map<string, PackageLockEntry> all_installed) {
Gee.Set<string> runtime_reach = new Gee.HashSet<string> ();
Gee.Queue<string> q = new Gee.LinkedList<string> ();
foreach (var ple in toplevel_installed)
if (ple.toplevel_dep.role != DEVELOPMENT)
q.offer (ple.id);
while (!q.is_empty) {
string k = q.poll ();
if (!runtime_reach.add (k))
continue;
PackageLockEntry ple = all_installed[k];
foreach (var sub in ple.children)
q.offer (sub.id);
}
return runtime_reach;
}
private async void perform_install (
string name,
PackageVersion version_spec,
PackageDependency toplevel_dep,
PackageRole role,
File parent_node_modules_dir,
File project_root,
Manifest manifest,
bool prefer_lockfile_for_this_dep,
Cancellable? cancellable,
Promise<PackageLockEntry> dep_link_promise,
InstallProgressTracker tracker,
Gee.Map<string, Promise<PackageLockEntry>> all_physical_installs,
Gee.Map<string, Promise<ResolvedPackageData>> resolution_cache,
Gee.Map<string, Promise<Json.Node>> packument_cache,
Gee.Map<string, string> top_level_placements) {
Gee.Map<string, string> top_level_placements,
Promise<PackageLockEntry> dep_link_promise,
Cancellable? cancellable) {
try {
install_progress (RESOLVING_PACKAGE, -1.0, "%s@%s".printf (name, version_spec.spec));
string resolution_id = name + "@" + version_spec.spec;
@@ -660,9 +685,8 @@ namespace Frida {
if (physical_install_promise != null) {
PackageLockEntry existing_ple = yield physical_install_promise.future.wait_async (cancellable);
existing_ple.roles.add (role);
dep_link_promise.resolve (new PackageLockEntry () {
id = actual_install_lockfile_key,
name = existing_ple.name,
version = existing_ple.version,
resolved = existing_ple.resolved,
@@ -674,7 +698,6 @@ namespace Frida {
dependencies = existing_ple.dependencies,
toplevel_dep = toplevel_dep,
newly_installed = existing_ple.newly_installed,
roles = existing_ple.roles,
});
return;
}
@@ -730,6 +753,7 @@ namespace Frida {
}
var ple = new PackageLockEntry () {
id = actual_install_lockfile_key,
name = rpd.name,
version = rpd.effective_version,
resolved = rpd.resolved_url,
@@ -742,7 +766,6 @@ namespace Frida {
toplevel_dep = toplevel_dep,
newly_installed = !already_correctly_installed,
};
ple.roles.add (role);
physical_install_completion.resolve (ple);
@@ -765,22 +788,21 @@ namespace Frida {
d.name,
d.version,
toplevel_dep,
d.role,
sub_deps_parent_node_modules_dir,
project_root,
manifest,
true,
cancellable,
sub_dep_link_promise,
tracker,
all_physical_installs,
resolution_cache,
packument_cache,
top_level_placements
top_level_placements,
sub_dep_link_promise,
cancellable
);
}
foreach (var f in sub_dep_futures)
yield f.wait_async (cancellable);
ple.children.add (yield f.wait_async (cancellable));
dep_link_promise.resolve (ple);
} catch (GLib.Error e) {
+1 -1
View File
@@ -1,6 +1,6 @@
[wrap-git]
url = https://github.com/frida/frida-gum.git
revision = 17.2.4
revision = 17.2.6
depth = 1
[provide]