Checking executables before running them in L4re/fiasco

Masti Ramya Jayaram rmasti at inf.ethz.ch
Fri Sep 5 14:29:15 CEST 2014


Hey Adam,

Thanks for the information. I have two issues/questions:

a. I looked at the move_modules (which does not do much in my case) and I tried to replace the linux.cfg from

Compiled in version:
--------------------------------------------------
------vim:set ft=lua:

L4.default_loader:start({ caps = {
      log = L4.Env.log:m("rws"),
    },
    l4re_dbg = L4.Dbg.Warn,
    log = { "l4linux", "yellow" },
  }, "rom/vmlinuz mem=128M console=ttyLv0,115200 l4x_rd=rom/ramdisk-x86.rd root=1:0 ramdisk_size=4000 l4ser.vkey_enable=1");


Replaced version: (just the memory changes but this results in a difference in the length!)
---------------------------------------------------
--vim:set ft=lua:
L4.default_loader:start({ caps = {
      log = L4.Env.log:m("rws"),
    },
    l4re_dbg = L4.Dbg.Warn,
    log = { "l4linux", "yellow" },
  }, "rom/vmlinuz mem=64M console=ttyLv0,115200 l4x_rd=rom/ramdisk-x86.rd root=1:0 ramdisk_size=4000 l4ser.vkey_enable=1");


I achieve this with the following code that runs immediately after construct_mbi:

a. Copy the placed version into the start address of the linux_cfg module (this happens correctly as I can see the memory dump).
b. Change the compressed and uncompressed lengths in mod_info to reflect the smaller size.

The process runs until ned  which fails to parse the config file (unexpected symbol error) and the problem seems to be the difference in length of the two configs. For example, if the 2nd config is "mem=064M" instead of "mem=64M", then it works. I change the length appropriately in mod_info of the mbi. What am I missing?


a. The "MODE = sigma0" suggestion: I tried this by changing bootstrap/server/src/Make.rules but I get an error saying: "ld: cannot find -ll4util". The relevant part in the linker line that differs from the default working build (with "MODE = lib") is:

 ==> Linking bootstrap.elf

..............
-Tbootstrap.ld --start-group   -ll4util -ll4sys -luc_c -static -nostdlib -ldrivers_uart  -lcxx_base -lcxx_io  -luc_c /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32/libgcc.a --end-group --warn-common -Ttext=0x2d0000 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32//crtend.o /home/rmasti/fiasco/r33-new/src/l4/build/lib/x86_pentium/crtn.o


The linker line with "MODE = lib" (the difference seems to be that l4util, l4sys, etc are not really there in the commandline)

==> Linking bootstrap.elf
..............
-Tbootstrap.ld  --start-group    -static -nostdlib -ldrivers_uart  -lcxx_base -lcxx_io  -luc_c /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32/libgcc.a --end-group --warn-common -Ttext=0x2d0000 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32//crtend.o  /home/rmasti/fiasco/r33-new/src/l4/build/lib/x86_pentium/crtn.o

Why does this happen? What is the relevant modules.list entry for this mode?

Thanks,
ramya

________________________________________
From: l4-hackers [l4-hackers-bounces at os.inf.tu-dresden.de] on behalf of Adam Lackorzynski [adam at os.inf.tu-dresden.de]
Sent: 05 September 2014 00:39
To: l4-hackers at os.inf.tu-dresden.de
Subject: Re: Checking executables before running them in L4re/fiasco
                   ││                             │
│                             ││                             │
│                             ││                             │
│                             ││                             │
│                             ││                             │
│                             ││                             │
│                             ││                             
On Wed Sep 03, 2014 at 14:43:59 +0000, Masti  Ramya Jayaram wrote:
> >You mean binaries that are started?
> Yes but some modules have dependencies (like the Io server and
> examples of target dependencies include libsigma). Is there a way to
> find all of them?

Ok, you mean all the libraries that are linked to a program. One way to
find that out is to build the program with "make V=1", see the linker
step and look for all the -lxxx options. The lib directory in the build
tree has all the libraries and those are links to the actual package
directory so you see the package there.

> Finally, on a related note, could you explain to me how all the
> modules get merged to create the elfimage? I ask because I have to
> access the modules (vmlinux, l4linux.cfg and ramdisk) from bootstrap
> in order to modify/check them. For example, I would like to load the
> modules encrypted and decrypt them in bootstrap before continuing. I
> can do decryption in place but again, I am not sure about module
> sizes, etc.
>
> I see that some of this information is included during the image
> creation process in l4/pkg/bootstrap/server/src/build.pl but I cannot
> quite get the entire picture. Could you point me to any documentation
> about it?

In bootstrap, there's a move_modules() function that iterates over all
the modules and should show you how how to do that.





Adam
--
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

_______________________________________________
l4-hackers mailing list
l4-hackers at os.inf.tu-dresden.de
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers


More information about the l4-hackers mailing list