From: Thomas Meyer <thomas@m3y3r.de>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
user-mode-linux-devel
<user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] current_thread_info() returns invalid pointer in early UML boot code
Date: Mon, 23 May 2016 20:42:40 +0200 [thread overview]
Message-ID: <1464028960.4307.2.camel@m3y3r.de> (raw)
In-Reply-To: <CAOMGZ=H-fi-Wqmc36ts5LULSe=QD9Q-ys7GKryFWRZw_iO-J=A@mail.gmail.com>
Am Sonntag, den 22.05.2016, 17:39 +0200 schrieb Vegard Nossum:
> On 21 May 2016 at 20:18, Thomas Meyer <thomas@m3y3r.de> wrote:
> >
> > Am 21.05.2016 um 15:51 schrieb Vegard Nossum <vegard.nossum@gmail.c
> > om>:
> > >
> > > I'm having some trouble with using current_thread_info() during
> > > UML
> > > early boot. Sometimes it works just fine, but often I get
> > > segfaults
> > > because current_thread_info() is returning an invalid pointer. It
> > > looks random: 0x202118, 0x1003e0003, 0xd33b90b3, 0x6db043, etc.
> > Mhh. Strange. Do you have a stack trace to call to current thread
> > info which ends up with a wrong value. I wonder from were it
> > originates.
> One such trace would be:
>
> #2 0x000000006026652c in snprintf (buf=<optimized out>,
> size=<optimized out>, fmt=<optimized out>) at lib/vsprintf.c:2181
> #3 0x00000000600046f8 in setup_env_path () at arch/um/os-
> Linux/main.c:109
> #4 main (argc=3, argv=0x7ffc3d8c23e8, envp=<optimized out>) at
> arch/um/os-Linux/main.c:125
>
> 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?
Mhh. Good question!
Doing a make ARCH=um V=1 arch/um/os-Linux/main.o
results in:
gcc -Wp,-MD,arch/um/os-Linux/.main.o.d -Wall -Wundef -Wstrict-
prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-
implicit-function-declaration -Wno-format-security -std=gnu89
-mcmodel=large -fno-builtin -m64 -funit-at-a-time -D__arch_um__
-Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
-D_LARGEFILE64_SOURCE -fno-delete-null-pointer-checks -O2 --
param=allow-store-data-races=0 -fno-reorder-blocks -fno-ipa-cp-clone
-fno-partial-inlining -Wframe-larger-than=1024 -fno-stack-protector
-Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-
sibling-calls -fno-var-tracking-assignments -g -gdwarf-4 -Wdeclaration-
after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
-Werror=implicit-int -Werror=strict-prototypes -Werror=date-time
-Werror=incompatible-pointer-types -DCC_HAVE_ASM_GOTO
-I./arch/um/include/shared -I./arch/x86/um/shared
-I./arch/um/include/shared/skas -D_FILE_OFFSET_BITS=64 -idirafter
./include -idirafter ./include -D__KERNEL__ -D__UM_HOST__ -D_GNU_SOURCE
-D_LARGEFILE64_SOURCE -include ./include/linux/kern_levels.h -include
user.h -c -o arch/um/os-Linux/main.o arch/um/os-Linux/main.c
so it includes user.h and is under os-Linux. So I guess it should
actually call the glibc version, I'm not sure why it doesn't.
with kind regards
thomas
>
>
> Vegard
>
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2016-05-23 18:42 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 [this message]
2016-06-12 20:11 ` Richard Weinberger
2016-06-12 20:59 ` Vegard Nossum
2016-06-12 21:05 ` Richard Weinberger
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=1464028960.4307.2.camel@m3y3r.de \
--to=thomas@m3y3r.de \
--cc=richard@nod.at \
--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).