Skip to content

linux_env - FileSystem::resolve_path - wrong resolutions with symbolic link #1115

@Sh3idan

Description

@Sh3idan

My architecture:

file_sb/
├── home
│   └── user
│       └── bin.elf
└── proc
    ├── 1000
    │   └── exe -> /home/bla/[TRUNCATED]/file_sb/home/user/bin.elf
    └── self -> 1000

The function FileSystem::resolve_path returns a wrong path with a symbolic link.

If the target is an absolute path and already a link in the sandbox, resolve_path returns a double sandboxed link. See below:

[syscalls][sys_generic_open][DEBUG]: sys_open('/proc/self/exe', 0, 0)
[environment][resolve_path][DEBUG]: resolve_path(path='/proc/self/exe', follow_link=True)
[environment][resolve_path][DEBUG]: resolve_path(path='/home/bla/[TRUNCATED]/file_sb/home/user/bin.elf', follow_link=True)
[environment][resolve_path][DEBUG]: -> '/home/bla/[TRUNCATED]/file_sb/home/bla/[TRUNCATED]/file_sb/home/user/bin.elf'
[environment][resolve_path][DEBUG]: -> '/home/bla/[TRUNCATED]/file_sb/home/bla/[TRUNCATED]/file_sb/home/user/bin.elf'
[syscalls][syscall_x86_64_exception_handler][DEBUG]: -> ffffffffffffffff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions