linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: user-mode-linux-devel
	<user-mode-linux-devel@lists.sourceforge.net>,
	Thomas Meyer <thomas@m3y3r.de>
Subject: Re: [uml-devel] current_thread_info() returns invalid pointer in early UML boot code
Date: Sun, 12 Jun 2016 23:05:07 +0200	[thread overview]
Message-ID: <575DCE83.9090203@nod.at> (raw)
In-Reply-To: <CAOMGZ=Ha+Wwb4wbsa+yNC9HL1ZT4BYMZdGdVbGDVPb2t9AuY-w@mail.gmail.com>

Am 12.06.2016 um 22:59 schrieb Vegard Nossum:
> On 12 June 2016 at 22:11, Richard Weinberger
> <richard.weinberger@gmail.com> wrote:
>>> I wonder why setup_env_path() ends up calling the kernel's snprintf(),
>>> I thought that it would be using the glibc snprintf() at this point?
>>
>> That early you cannot use current() nor any other core kernel stuff
>> since the kernel has not started so far.
>> So, the current thread info struct points to garbage.
> 
> Yes, I know. I think setup_env_path() should call the libc snprintf
> rather than the kernel one, can you explain how to do that properly?

Currently UML sets up nasty maps for known namespaces clashes.
i.e.
KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
        $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap      \
        -Din6addr_loopback=kernel_in6addr_loopback \
        -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr

A much better approach would be having a real linker scope.
Some time ago I posted some thoughts on that:
https://lkml.org/lkml/2015/11/19/758

Due to -ENOTIME this never materialized, though. ;-(

Thanks,
//richard

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


  reply	other threads:[~2016-06-12 21:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21 13:51 [uml-devel] current_thread_info() returns invalid pointer in early UML boot code Vegard Nossum
2016-05-21 18:18 ` Thomas Meyer
2016-05-22 15:39   ` Vegard Nossum
2016-05-23 18:42     ` Thomas Meyer
2016-06-12 20:11     ` Richard Weinberger
2016-06-12 20:59       ` Vegard Nossum
2016-06-12 21:05         ` Richard Weinberger [this message]
2016-06-12 21:41           ` Vegard Nossum
2016-06-12 22:55             ` Richard Weinberger
2016-05-21 21:49 ` Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=575DCE83.9090203@nod.at \
    --to=richard@nod.at \
    --cc=thomas@m3y3r.de \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).