Skip to content

jax_fingerprint: Address user arg slot exhaustion#13082

Merged
bneradt merged 1 commit intoapache:masterfrom
bneradt:jax-user-arg-exhaustion-fix-asf
Apr 10, 2026
Merged

jax_fingerprint: Address user arg slot exhaustion#13082
bneradt merged 1 commit intoapache:masterfrom
bneradt:jax-user-arg-exhaustion-fix-asf

Conversation

@bneradt
Copy link
Copy Markdown
Contributor

@bneradt bneradt commented Apr 10, 2026

When multiple jax_fingerprint.so instances are loaded (e.g., one per fingerprinting method), each instance was reserving its own user arg slot. ATS has a limited number of slots (~4 per type), causing methods like JA3 and JA4 to fail silently when slots were exhausted.

Solution: Share a single user arg slot per type (TS_USER_ARGS_VCONN or TS_USER_ARGS_TXN) across all jax_fingerprint instances. A ContextMap stores JAxContext instances keyed by method name.

@bneradt bneradt added this to the 11.0.0 milestone Apr 10, 2026
@bneradt bneradt requested review from Copilot and maskit April 10, 2026 04:38
@bneradt bneradt self-assigned this Apr 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes ATS user-arg slot exhaustion when loading multiple jax_fingerprint.so instances by sharing a single user-arg slot per container type (vconn / txn) and storing per-method JAxContext objects in a shared ContextMap.

Changes:

  • Rework user-arg handling to reserve one shared slot per type and multiplex contexts by method name via ContextMap.
  • Update close-hook cleanup to remove per-method context and delete the shared map when empty.
  • Add a gold test + replay YAML that loads JA3/JA4/JA4H simultaneously and verifies all fingerprint headers are produced.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/gold_tests/pluginTest/jax_fingerprint/jax_fingerprint.test.py Adds an “all methods loaded” integration test run.
tests/gold_tests/pluginTest/jax_fingerprint/jax_fingerprint_all_methods.replay.yaml New replay verifying all method headers are present on a TLS request.
plugins/experimental/jax_fingerprint/userarg.h Adds cleanup API declaration (currently duplicated).
plugins/experimental/jax_fingerprint/userarg.cc Implements shared-slot reservation and ContextMap-backed set/get/cleanup.
plugins/experimental/jax_fingerprint/plugin.cc Switches close handlers to the new cleanup function.
plugins/experimental/jax_fingerprint/context_map.h New shared map container keyed by method name.

Comment thread plugins/experimental/jax_fingerprint/userarg.h Outdated
Comment thread plugins/experimental/jax_fingerprint/context_map.h
@bneradt bneradt force-pushed the jax-user-arg-exhaustion-fix-asf branch from 0002ae0 to ff9dd8e Compare April 10, 2026 15:07
@bneradt bneradt requested a review from Copilot April 10, 2026 15:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread plugins/experimental/jax_fingerprint/context_map.h
Comment thread tests/gold_tests/pluginTest/jax_fingerprint/jax_fingerprint.test.py Outdated
Comment thread tests/gold_tests/pluginTest/jax_fingerprint/jax_fingerprint.test.py
When multiple jax_fingerprint.so instances are loaded (e.g., one per
fingerprinting method), each instance was reserving its own user arg
slot. ATS has a limited number of slots (~4 per type), causing methods
like JA3 and JA4 to fail silently when slots were exhausted.

Solution: Share a single user arg slot per type (TS_USER_ARGS_VCONN or
TS_USER_ARGS_TXN) across all jax_fingerprint instances. A ContextMap
stores JAxContext instances keyed by method name.
@bneradt bneradt force-pushed the jax-user-arg-exhaustion-fix-asf branch from ff9dd8e to 1483538 Compare April 10, 2026 16:55
@bneradt bneradt merged commit 1541fb2 into apache:master Apr 10, 2026
15 checks passed
@bneradt bneradt deleted the jax-user-arg-exhaustion-fix-asf branch April 10, 2026 21:15
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x Apr 10, 2026
@cmcfarlen cmcfarlen moved this from For v10.2.0 to Picked v10.2.0 in ATS v10.2.x Apr 15, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Apr 15, 2026
@cmcfarlen
Copy link
Copy Markdown
Contributor

Cherry-picked to 10.2.x

cmcfarlen pushed a commit that referenced this pull request Apr 15, 2026
When multiple jax_fingerprint.so instances are loaded (e.g., one per
fingerprinting method), each instance was reserving its own user arg
slot. ATS has a limited number of slots (~4 per type), causing methods
like JA3 and JA4 to fail silently when slots were exhausted.

Solution: Share a single user arg slot per type (TS_USER_ARGS_VCONN or
TS_USER_ARGS_TXN) across all jax_fingerprint instances. A ContextMap
stores JAxContext instances keyed by method name.

(cherry picked from commit 1541fb2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

4 participants