Socket AF_UNIX missing fs mapping check

Open
#1,260 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start by tracing ql_unix_socket_path and its call to ql.os.path.virtual_to_host_path for AF_UNIX sockets. Check how ql.add_fs_map entries are represented and applied, then verify that the socket path honors the user-provided mapping instead of defaulting to rootfs/var/run/dbus/socketname. Done means the mapped path is returned for the reported socket case.

Written by the indexing model from the issue text.

Description

My emulated program is using AF_UNIX socket. the path used in the program is /var/run/dbus/socketname and Qiling maps it to rootfs/var/run/dbus/socketname

Even ql.add_fs_map('/var/run/dbus/socketname', '/var/run/dbus/socketname'), Qiling tries to connect socket rootfs/var/run/dbus/socketname. I think the issue here is caused by ql_unix_socket_path which returns hpath = ql.os.path.virtual_to_host_path(vpath) without checking fs_mapping by user.

Expected behavior
If socket.family == AF_UNIX, the socket path should check the fs mapping and should return accordingly.

Dominant language
Python
Stars
6.1k
Forks
798
Avg merge
1d 1h
Merged PRs (30d)
9

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qilingframework/qiling

All issues in qilingframework/qiling

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.