L4Android kernel didn't intialize L4 stack for the server thread.

Mai, Haohui haohui.mai at gmail.com
Sun Apr 1 22:09:11 CEST 2012


It seems that I found a bug in the latest version of L4Android kernel. I'm
familiar enough with the code base so your comments are highly appreciated.

The main thread for L4Linux (i.e., the thread running l4x_server_loop())
didn't initialize l4x_stack before execution. Therefore, this thread
crashes whenever it calls cli() / sti().

Calling vmalloc() and kmalloc() can reproduce this bug reliably. Here is a
patch to fix this problem.


--- a/arch/l4/kernel/main.c
+++ b/arch/l4/kernel/main.c
@@ -2501,6 +2501,8 @@ int __init_refok L4_CV main(int argc, char **argv)
         * for these areas so far */
        //l4x_register_pointer_section(&_edata, 0, "data");

+       l4x_stack_setup(current_thread_info(), l4_utcb(), 0);
        /* Send start message to main thread. */
                    l4_utcb(), l4_msgtag(0, 0, 0, 0), L4_IPC_NEVER);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20120401/b428ee55/attachment.html>

More information about the l4-hackers mailing list