unikraft / static-pie-apps

Built Linux applications (static-pie) for Unikraft binary compatibility mode
7 stars 40 forks source link

Add iputils static pie build #86

Open StefanJum opened 1 year ago

StefanJum commented 1 year ago

Add iputils commands as a -static-pie build. Test it natively on Linux and with run-elfloader on Unikraft. In case of issues with Unikraft, post an issue in the Unikraft core repository.

Follow the structure of existing applications or submitted for review applications: create a folder with build.sh script, a README.md file, a rootfs/ subfolder (if required), the -static-pie built executable and other useful files.

Hackathon points: 40

kouk commented 1 year ago

Working on this with @iamgroute and @se7enBit

kouk commented 1 year ago

We are facing two issues with this:

  1. ping defaults to using normal sockets but there's a bug in lwip where the package is sent using UDP protocol instead of ICMP.
  2. https://github.com/unikraft/lib-lwip/pull/2 these are probably related?
kouk commented 1 year ago

We managed to build lwip with LWIP_RAW=1 and then we could ping like this:

./run_elfloader -k ../app-elfloader/build/app-elfloader_kvm-x86_64 -g -n ../static-pie-apps/iputils/ping -n -4 -v -d -e 0 172.44.0.3

The -e 0 option forces use of a RAW socket, instead of the default which is a Ping socket.