Skip to content

Remove DEFAULT_DEVICE fallback to prevent cross-domain routing#302

Open
quic-vkatoch wants to merge 2 commits intoqualcomm:developmentfrom
quic-vkatoch:fallback
Open

Remove DEFAULT_DEVICE fallback to prevent cross-domain routing#302
quic-vkatoch wants to merge 2 commits intoqualcomm:developmentfrom
quic-vkatoch:fallback

Conversation

@quic-vkatoch
Copy link
Contributor

@quic-vkatoch quic-vkatoch commented Feb 24, 2026

Remove legacy DEFAULT_DEVICE fallback that could cause incorrect domain routing. Previously, if a requested domain's device nodes were unavailable, the code would fall back to the DEFAULT_DEVICE of the linked library (e.g., ADSP for libadsprpc.so), ignoring the user's domain request.

Now each domain only attempts: secure node -> non-secure node, and fails cleanly if both are unavailable. This ensures device opening respects the user's requested domain.

Consolidate all domain cases (ADSP/MDSP/SDSP/CDSP/GDSP) into unified logic and improve error handling.

Additionally, merge domain device name functions into a unified API by replacing separate get_secure_domain_name() and get_non_secure_domain_name() implementations with a single get_domain_device_names() function that returns both names in one call.

Supersedes #210 due to outdated and stale changes.
Fixes: #164

Remove legacy DEFAULT_DEVICE fallback that could cause incorrect domain
routing. Previously, if a requested domain's device nodes were unavailable,
the code would fall back to the DEFAULT_DEVICE of the linked library
(e.g., ADSP for libadsprpc.so), ignoring the user's domain request.

Now each domain only attempts: secure node -> non-secure node, and fails
cleanly if both are unavailable. This ensures device opening respects
the user's requested domain.

Additionally, replace verbose switch-case statement with IS_VALID_DOMAIN_ID
check for cleaner, more maintainable code. This consolidates all domain
cases (ADSP/MDSP/SDSP/CDSP/CDSP1/GDSP0/GDSP1) into unified logic and
improves error handling.

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
Replace duplicate get_secure_domain_name() and get_non_secure_domain_name()
implementations with a single get_domain_device_names() function.

- Add get_domain_device_names() in fastrpc_apps_user.c
- Remove duplicate implementations from fastrpc_ioctl.c and adsp_default_listener.c
- Remove unused device name macros from adsp_default_listener.c
- Update callers to use unified function
- Fix fastrpc_dev_exists() to accept full paths
- Fix fastrpc_wait_for_device() basename extraction for inotify
- Expose via fastrpc_internal.h

Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
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.

Remove fallback to default device open

4 participants