Michael Richardson | 17 May 2013 12:43
X-Face
Picon

UML vs ptrace_scope


I have been trying to bring the openswan nightly build system up again
on a newish system.   I started these scripts back in 2002, and it has been running
on and off for many years, and many kernel revisions.  
I started this most recent effort work when 3.5 was stable, so my guest
kernel is a 3.5 kernel running on a debian squeeze host with a 2.6.26
kernel.   I compile things fine.
With 2.6.26, I got:

...
Checking that ptrace can change system call numbers...ptrace: Operation
not permitted
check_ptrace : expected SIGSTOP, got status = 9

I upgraded to wheezy (needed to be done anyway), and then felt that I
ran run into the ptrace_scope problem.  At least, that's what I thought.
I installed a 3.8 debian kernel tree, patched it to enable YAMA, and
booted that finally.  I set:
   kernel.yama.ptrace_scope = 0

but this does not affect the above error.  Is there something else I am
missing?    I tried adding the capability, but it doesn't help.

curley-[~] mcr 10001 %sudo /sbin/setcap cap_sys_ptrace+ep
/btmp/build/HEAD/2013_05_12/openswan-2/UMLPOOL/plain26/linux
[sudo] password for mcr: 
curley-[~] mcr 10002 %sudo /sbin/getcap
/btmp/build/HEAD/2013_05_12/openswan-2/UMLPOOL/plain26/linux

/btmp/build/HEAD/2013_05_12/openswan-2/UMLPOOL/plain26/linux =
(Continue reading)

Toralf Förster | 14 May 2013 18:15
Picon
Picon

trinity fuzzying gave : BUG anon_vma (Not tainted): Redzone overwritten

Although it just happens for the first time I'd like to share this.

Got by fuzzyinga 32bit stable Gentoo guest  with trinity,
guest kernel is linux-v3.10-rc1-36 (strnlen + stub4 patch included) :

2013-05-14T18:06:15.405+02:00 trinity kernel: =============================================================================
2013-05-14T18:06:15.405+02:00 trinity kernel: BUG anon_vma (Not tainted): Redzone overwritten
2013-05-14T18:06:15.405+02:00 trinity kernel: -----------------------------------------------------------------------------
2013-05-14T18:06:15.405+02:00 trinity kernel:
2013-05-14T18:06:15.405+02:00 trinity kernel: Disabling lock debugging due to kernel taint
2013-05-14T18:06:15.405+02:00 trinity kernel: INFO: 0x405084f8-0x405084fb. First byte 0xe8 instead
of 0xcc
2013-05-14T18:06:15.405+02:00 trinity kernel: INFO: Allocated in anon_vma_prepare+0x6a/0x160
age=1631 cpu=0 pid=856
2013-05-14T18:06:15.405+02:00 trinity kernel: INFO: Freed in __put_anon_vma+0x93/0xa0 age=1651
cpu=0 pid=854
2013-05-14T18:06:15.405+02:00 trinity kernel: INFO: Slab 0x0ae47800 objects=46 used=7
fp=0x40508108 flags=0x0081
2013-05-14T18:06:15.405+02:00 trinity kernel: INFO: Object 0x405084d0  <at> offset=1232 fp=0x405084e8
2013-05-14T18:06:15.410+02:00 trinity kernel:
2013-05-14T18:06:15.410+02:00 trinity kernel: Bytes b4 405084c0: 59 03 00 00 00 99 ff ff 5a 5a 5a 5a 5a 5a 5a
5a  Y.......ZZZZZZZZ
2013-05-14T18:06:15.410+02:00 trinity kernel: Object 405084d0: d0 84 50 40 00 00 00 00 01 00 00 00 ad 4e ad de  ..P <at> .........N..
2013-05-14T18:06:15.410+02:00 trinity kernel: Object 405084e0: ff ff ff ff ff ff ff ff e8 84 50 40 e8 84 50 40  ..........P <at> ..P <at> 
2013-05-14T18:06:15.410+02:00 trinity kernel: Object 405084f0: 00 00 00 00 00 00 00 00                          ........
2013-05-14T18:06:15.410+02:00 trinity kernel: Redzone 405084f8: e8 84 50 40                                      ..P <at> 
2013-05-14T18:06:15.410+02:00 trinity kernel: Padding 40508520: 5a 5a 5a 5a 5a 5a 5a 5a                          ZZZZZZZZ
2013-05-14T18:06:15.410+02:00 trinity kernel: CPU: 0 PID: 856 Comm: rc Tainted: G    B       
3.10.0-rc1-00036-g05d129d #9
2013-05-14T18:06:15.410+02:00 trinity kernel: 416a7c1c 416a7c48 080f9da0 083db92c 405084d0
(Continue reading)

Toralf Förster | 12 May 2013 17:47
Picon
Picon

WARNING: at mm/mmap.c:2757 exit_mmap+0x161/0x170()

With recent host and guest kernel trinity often triggers that warning
which refers to this line

WARN_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);

/me wonders if (and how) I can help to identify the root cause (if it is
not already known).

--

-- 
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Toralf Förster | 12 May 2013 16:28
Picon
Picon

oom-killer forced by syscall add_key

With
$> trinity --children 2 -c add_key --quiet
it takes only 2 minutes to force an oom-killer at a user mode linux guest.

I'm just wondering if this is a wanted behaviour of the kernel.

2013-05-12T16:26:22.662+02:00 trinity kernel: trinity-child0 invoked oom-killer:
gfp_mask=0x200da, order=0, oom_score_adj=500
2013-05-12T16:26:22.662+02:00 trinity kernel: CPU: 0 PID: 1018 Comm: trinity-child0 Not tainted
3.10.0-rc1-00002-gcaec151 #5
2013-05-12T16:26:22.662+02:00 trinity kernel: 3eb07bd0 3eb07c2c 0835c7bd 3f5a3b3c 3f5a37b0
000200da 00000000 000001f4 
2013-05-12T16:26:22.662+02:00 trinity kernel: 08443920 3eb07c00 08071dfe 00000000 3eb07c0c
083614dc 00000001 3eb07c2c 
2013-05-12T16:26:22.662+02:00 trinity kernel: 08278d45 08443920 00000001 3eb00000 3f5a3600
3f5a3600 3f5a3600 3eb07c70 3eb07ba4:  [<08060d2f>] show_stack+0xcf/0x100
2013-05-12T16:26:22.662+02:00 trinity kernel: 3eb07bc8:  [<0835ed99>] dump_stack+0x26/0x28
2013-05-12T16:26:22.662+02:00 trinity kernel: 3eb07bd8:  [<0835c7bd>] dump_header.isra.12+0x93/0x1c8
2013-05-12T16:26:22.662+02:00 trinity kernel: 3eb07c30:  [<080ce620>] oom_kill_process+0x60/0x310
2013-05-12T16:26:22.662+02:00 trinity kernel: 3eb07c74:  [<080cedcd>] out_of_memory+0x2bd/0x320
2013-05-12T16:26:22.662+02:00 trinity kernel: 3eb07cc0:  [<080d2258>] __alloc_pages_nodemask+0x628/0x750
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07d4c:  [<080e6750>] handle_pte_fault+0x130/0x780
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07da4:  [<080e6e6c>] handle_mm_fault+0xcc/0xe0
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07dd8:  [<08061d87>] handle_page_fault+0x127/0x280
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07e1c:  [<08061fb6>] segv+0xa6/0x2b0
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07ecc:  [<08062233>] segv_handler+0x73/0x80
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07ef4:  [<0807503a>] userspace+0x30a/0x590
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07fec:  [<0805f82c>] fork_handler+0x6c/0x70
2013-05-12T16:26:22.678+02:00 trinity kernel: 3eb07ffc:  [<00000000>] 0x0
2013-05-12T16:26:22.678+02:00 trinity kernel:
(Continue reading)

Toralf Förster | 12 May 2013 16:04
Picon
Picon

trinity triggers often "WARNING: at mm/mmap.c:2757 exit_mmap+0x164/0x170()"

at an UML guest (32 bit stable Gentoo both at host and guest,
host has kernel version 3.9.2, guest has kernel version 3.10-rc1 + 2 patches from -rw-).

The syslog says :

2013-05-12T13:45:38.381+02:00 trinity kernel: ------------[ cut here ]------------
2013-05-12T13:45:38.381+02:00 trinity kernel: WARNING: at mm/mmap.c:2757 exit_mmap+0x164/0x170()
2013-05-12T13:45:38.381+02:00 trinity kernel: CPU: 0 PID: 1193 Comm: trinity-child0 Not tainted
3.10.0-rc1-00002-gcaec151 #5
2013-05-12T13:45:38.381+02:00 trinity kernel: 3f68fd9c 3f68fdc8 0807bfca 083d51bc 083d9a7a
00000ac5 080eb914 080eb914 
2013-05-12T13:45:38.381+02:00 trinity kernel: 000004f0 3f59b8c0 3eaafb3c 3f68fdd8 0807c093
00000009 00000000 3f68fe10 
2013-05-12T13:45:38.381+02:00 trinity kernel: 080eb914 083d9a7a 00000ac5 c0000000 00000000
40716660 3f59b8c0 00000000 3f68fd70:  [<08060d2f>] show_stack+0xcf/0x100
2013-05-12T13:45:38.381+02:00 trinity kernel: 3f68fd94:  [<0835ed99>] dump_stack+0x26/0x28
2013-05-12T13:45:38.381+02:00 trinity kernel: 3f68fda4:  [<0807bfca>] warn_slowpath_common+0x5a/0x80
2013-05-12T13:45:38.381+02:00 trinity kernel: 3f68fdcc:  [<0807c093>] warn_slowpath_null+0x23/0x30
2013-05-12T13:45:38.381+02:00 trinity kernel: 3f68fddc:  [<080eb914>] exit_mmap+0x164/0x170
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68fe14:  [<0807991d>] mmput+0x3d/0xb0
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68fe28:  [<08081086>] do_exit+0x2f6/0x880
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68fe78:  [<080816f9>] do_group_exit+0xa9/0xf0
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68fea0:  [<08081759>] SyS_exit_group+0x19/0x20
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68feac:  [<08062ac2>] handle_syscall+0x82/0xb0
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68fef4:  [<0807519d>] userspace+0x46d/0x590
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68ffec:  [<0805f82c>] fork_handler+0x6c/0x70
2013-05-12T13:45:38.386+02:00 trinity kernel: 3f68fffc:  [<00000000>] 0x0
2013-05-12T13:45:38.386+02:00 trinity kernel: 
2013-05-12T13:45:38.386+02:00 trinity kernel: ---[ end trace ae0a9ee7fbe3a27c ]---

(Continue reading)

Sebastian b | 1 May 2013 16:56
Picon
Favicon

Good afternoon!

http://showgeki.info/wp-content/plugins/tv1mod/brain.php?zmuuxra792fdawg





















































































































.........................
Adam was the only man who, when he said a good thing, knew that nobody had said it before him. -- Mark Twain
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Earlence Fernandes | 30 Apr 2013 18:12
Picon

UML Hardware Virt Support

The book (2004) states that work was going on for hardware assisted virt.
Has there been progress on it? Where do I find information on it?
The UML source tree still comes with the original modes of operation.

-Earlence
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Earlence Fernandes | 30 Apr 2013 01:23
Picon

SKAS mode and UML code

From the book by Jeff Dike, I get the impression that the UML kernel is placed in a reserved memory section in every process it virtualizes. Is this a correct interpretation?

-Earlence
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Earlence Fernandes | 28 Apr 2013 17:43
Picon

Code for tracing thread

I keep reading that there is a tracing thread that intercepts process syscalls and I've been grepping thru the kernel sources to find this.

Can anyone point me in the right direction?
I've looked at os-Linux/ and arch/um/kernel/

-Earlence
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Richard Weinberger | 15 Apr 2013 19:53
Picon

[PATCH] um: Use generic idle loop

Signed-off-by: Richard Weinberger <richard <at> nod.at>
---
 arch/um/Kconfig.common   |  1 +
 arch/um/kernel/process.c | 27 ++-------------------------
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index bceee66..5783406 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
 <at>  <at>  -12,6 +12,7  <at>  <at>  config UML
 	select GENERIC_CPU_DEVICES
 	select GENERIC_IO
 	select GENERIC_CLOCKEVENTS
+	select GENERIC_IDLE_LOOP
 	select TTY # Needed for line.c

 config MMU
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index b462b13..4d64860 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
 <at>  <at>  -210,33 +210,10  <at>  <at>  void initial_thread_cb(void (*proc)(void *), void *arg)
 	kmalloc_ok = save_kmalloc_ok;
 }

-void default_idle(void)
-{
-	unsigned long long nsecs;
-
-	while (1) {
-		/* endless idle loop with no priority at all */
-
-		/*
-		 * although we are an idle CPU, we do not want to
-		 * get into the scheduler unnecessarily.
-		 */
-		if (need_resched())
-			schedule();
-
-		tick_nohz_idle_enter();
-		rcu_idle_enter();
-		nsecs = disable_timer();
-		idle_sleep(nsecs);
-		rcu_idle_exit();
-		tick_nohz_idle_exit();
-	}
-}
-
-void cpu_idle(void)
+void arch_cpu_idle(void)
 {
 	cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
-	default_idle();
+	local_irq_enable();
 }

 int __cant_sleep(void) {
--

-- 
1.8.1.4

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
richard -rw- weinberger | 11 Apr 2013 23:19
Picon

Re: Endless page fault for the same miss address in my UML

On Thu, Apr 11, 2013 at 10:14 PM, Terry Hsu <terry.shoes <at> gmail.com> wrote:
> The page fault loop for the same address happens in my UML. But for both my
> UML and the mainline (I am using 3.7.1) kernel, the addresses that trigger
> the page fault (in the child thread) are covered by certain vm areas. I use
> gdb to trace the function call and notice that mmap_region() is never called
> during the execution of the child task. I am guessing it's because the child
> task does not use large enough memory space to have the UML installed
> mapping for it.

Okay, let's try to figure out what happens here.
The UML _guest_ process has some vmas installed, upon access the host
kernel finds
out that there is no memory mapping installed in the _host_ side of
UML and sends SIGSEGV
to the process. UML's host part catches the SIGSEGV and tries to fix it.
Usually it does so by mmap()'ing the faulting page into the UML guest process.
This is where the SKAS stub magic happens. It write the to be fixed
address into STUB_DATA
and sets EIP/RIP to STUB_CODE such that the process itself calls mmap().
After the stub has finished it traps itself and the UML emulation continues.

Now we need to figure out a) What address is faulting and why? b) What
does the UML _host_ side
code to fix it? i.e. What are the mmap() parameters? c) Does this mmap() fail?

To me it looks like UML is unable to fix the fault and therefore it
faults over and over again.

--
Thanks,
//richard

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

Gmane