Skip to content

🔧 Bugfix: Refactor RKP rust migration and fix double-free bug#837

Merged
tryigit merged 1 commit into
masterfrom
bugfix-rust-rkp-and-memory-leaks-4569474389639897470
Jul 7, 2026
Merged

🔧 Bugfix: Refactor RKP rust migration and fix double-free bug#837
tryigit merged 1 commit into
masterfrom
bugfix-rust-rkp-and-memory-leaks-4569474389639897470

Conversation

@tryigit

@tryigit tryigit commented Jul 7, 2026

Copy link
Copy Markdown
Owner
  • Fixed double-free memory leak vulnerability in BinderInterceptor.kt inside onTransact. Changed finally block to catch and properly validated if instances shouldn't be overridden before disposing them.
  • Changed RKP Dummy implementation for a Native implementation running under rust. Modified createProtectedData usages by createProtectedDataNatively and deleted dummy implementations in Kotlin.
  • Removed legacy binder_router.cpp since Frida hooks natively execute using frida-gum crate.

PR created automatically by Jules for task 4569474389639897470 started by @tryigit

- Removed double-free memory leak vulnerability in `BinderInterceptor.kt`. The vulnerability was caused by explicitly tracking `theData` and `theReply` arrays inside a try-catch pattern and disposing them after checking `OverrideData` or `OverrideReply` conditions instead of checking them inside a `finally` block where variables aren't checked properly.
- Replaced dummy Kotlin implementation for `createProtectedData` with a rust implementation. Replaced `ProtectedData(createProtectedData())` with `ProtectedData(createProtectedDataNatively())` in `RkpInterceptor.kt`. Deleted dummy implementation from `RkpInterceptor.kt`.
- Removed `binder_router.cpp` legacy logic because it was replaced with frida-gum bindings implemented natively in Rust.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@tryigit tryigit merged commit 776c9b7 into master Jul 7, 2026
8 of 9 checks passed
@tryigit tryigit deleted the bugfix-rust-rkp-and-memory-leaks-4569474389639897470 branch July 7, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant