0xricksanchez / like-dbg

Fully dockerized Linux kernel debugging environment
MIT License
737 stars 58 forks source link

Failed to run RootFSBuilder on QubesOS #78

Closed Lophiel closed 2 years ago

Lophiel commented 2 years ago

Describe the bug Building like-dbg throws the error "Failed to run RootFSBuilder"

To Reproduce Steps to reproduce the behavior:

  1. The version is like-dbg v0.0.1
  2. Running ./start-kgdb.py with out any additional flags runs up to src.docker_runner:wait_for_container:109

Expected behavior To actually run RootFSBuilder and extract the RootFS to build like-dbg's docker images.

Screenshots

like-dbg

Desktop (please complete the following information): Fill me in on the specs of your environment:

  1. Operating system: Qubes OS 4.1.1, with like-dbg being run inside a debian 11 Qube
  2. Python version is 3.9.2
  3. Docker version 20.10.17, build 100c701

Additional context Important note is that i'm running ./start-kdbg.py in a non-ctf context! without any additional flags. Docker can pull and build images just fine but the issue occurs when I run the aforementioned script.

0xricksanchez commented 2 years ago

I do not have the means to test and set up QubesOS on my end right now. The steps to reproduce the above shown behavior for anyone willing to help out here should be as follows:

Note: I left out the -p [package list] argument for the root.sh script for brevity reasons. One could add the list as defined in config.ini.

The root cause of the error is not yet clear to me, but it seems that the location (/io/rootfs), in which debootstrap attempts to install the rootfs has not enough permissions. I do not know QubesOS well enough to blindly ship a fix and without a working test-bench I cannot fix this.

I happily take a PR that fixes things on QubesOS, which I can then test again Debian/Fedora/Arch to ensure nothing breaks on those ends.

0xricksanchez commented 2 years ago

The testing for this has become a lot easier and faster with the latest additions to the main branch!

You can now invoke ./start_kgdb.py -v --partial 4 to only run stage 4, which builds the root filesystem.

So we're able to skip the whole kernel building phase.

@Zophike1 If you want to take another crack at it feel free to do so.

My best bet is still on the containers permissions. Maybe playing around with the cap_add flag may help.

References:

0xricksanchez commented 2 years ago

Closing this for now as there seems no activity here. Personally, I'd consider QubeOS support as optional.