Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbcCLJuh (ORCPT ); Sat, 12 Mar 2016 04:50:37 -0500 Received: from 116.58.164.79.static.zoot.jp ([116.58.164.79]:40068 "EHLO walnut.rhe.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbcCLJue (ORCPT ); Sat, 12 Mar 2016 04:50:34 -0500 X-Greylist: delayed 454 seconds by postgrey-1.27 at vger.kernel.org; Sat, 12 Mar 2016 04:50:34 EST From: Kazuki Yamaguchi Subject: Re: [BUG] sched: leaf_cfs_rq_list use after free In-Reply-To: 20160311182035.GM24046@htj.duckdns.org To: Tejun Heo Cc: Niklas Cassel , Peter Zijlstra , linux-kernel@vger.kernel.org Message-ID: <20216ece-a75c-e3cf-4bae-ccbcf5694e9f@rhe.jp> Date: Sat, 12 Mar 2016 18:42:57 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Thunderbird/47.0a1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4366 Lines: 133 Hello, I got similar kernel crashes after the patch, which went to 4.4: 2e91fa7 cgroup: keep zombies associated with their original cgroups I was just about to report, but maybe this is related? ^^^^^^^[ 0.761718] BUG: unable to handle kernel NULL pointer dereference at 00000000000008b0 [ 0.762860] IP: [] update_blocked_averages+0x80/0x600 [ 0.764020] PGD 3fc067 PUD 3a9067 PMD 0 [ 0.764020] Oops: 0000 [#1] SMP [ 0.764020] CPU: 0 PID: 56 Comm: test Not tainted 4.5.0-rc7 #25 [ 0.764020] task: ffff8800003d2700 ti: ffff8800003e8000 task.ti: ffff8800003e8000 [ 0.764020] RIP: 0010:[] [] update_blocked_averages+0x80/0x600 [ 0.764020] RSP: 0000:ffff880007c03e50 EFLAGS: 00000016 [ 0.764020] RAX: 0000000000000000 RBX: 00000000ffff165e RCX: 000000002d5096e1 [ 0.764020] RDX: 00000000000d281c RSI: ffff880000138200 RDI: 00000000000d281c [ 0.764020] RBP: ffff880007c03eb0 R08: ffffffff811567e0 R09: 0000000000000100 [ 0.764020] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880007c11920 [ 0.764020] R13: 00000000000110c0 R14: afb504000afb5041 R15: ffff880007c110c0 [ 0.764020] FS: 0000000001b69880(0063) GS:ffff880007c00000(0000) knlGS:0000000000000000 [ 0.764020] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 0.764020] CR2: 00000000000008b0 CR3: 00000000003a4000 CR4: 00000000000006b0 [ 0.764020] Stack: [ 0.764020] 0000000080000100 0000000000000286 ffff880007c0c7f8 0000000000000006 [ 0.764020] 0000000007c0c5c0 ffff880000138200 ffffffff8104ce00 00000000ffff165e [ 0.764020] ffff880007c110c0 00000000000110c0 0000000000000007 0000000000000000 [ 0.764020] Call Trace: [ 0.764020] [ 0.764020] [] ? wake_up_process+0x10/0x20 [ 0.764020] [] run_rebalance_domains+0x6d/0x290 [ 0.764020] [] ? run_timer_softirq+0x19b/0x220 [ 0.764020] [] __do_softirq+0xde/0x1e0 [ 0.764020] [] irq_exit+0x5f/0x70 [ 0.764020] [] smp_trace_apic_timer_interrupt+0x68/0x90 [ 0.764020] [] smp_apic_timer_interrupt+0x9/0x10 [ 0.764020] [] apic_timer_interrupt+0x7c/0x90 [ 0.764020] [ 0.764020] [] ? find_vma+0x16/0x70 [ 0.764020] [] __do_page_fault+0xe8/0x360 [ 0.764020] [] do_page_fault+0xc/0x10 [ 0.764020] [] page_fault+0x1f/0x30 [ 0.764020] Code: 00 48 8d b0 28 ff ff ff 49 be 41 50 fb 0a 00 04 b5 af 48 89 74 24 28 48 8b 74 24 28 c7 44 24 24 00 00 00 00 48 8b 86 c8 00 00 00 <48> 8b 90 b0 08 00 00 48 8b 86 a0 00 00 00 48 85 c0 74 46 31 c0 [ 0.764020] RIP [] update_blocked_averages+0x80/0x600 [ 0.764020] RSP [ 0.764020] CR2: 00000000000008b0 [ 0.764020] ---[ end trace 754fbc727003a126 ]--- [ 0.764020] Kernel panic - not syncing: Fatal exception in interrupt [ 0.764020] Shutting down cpus with NMI [ 0.764020] Kernel Offset: disabled [ 0.764020] ---[ end Kernel panic - not syncing: Fatal exception in interrupt I can reproduce it on QEMU (qemu-system-x86_64 -smp 2). enabled config: CONFIG_PID_NS=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_SMP=y init.sh: #!/bin/sh mkdir /testg mount -t cgroup -o cpu cgroup /testg echo /agent.sh > /testg/release_agent echo 1 > /testg/notify_on_release mkdir /temp-mnt while :; do echo -n ^ ./test done agent.sh: #!/bin/sh rmdir /testg$1 test.c: #include #include #include #include #include #include #include #include #include int main(void) { mount("none", "/temp-mnt", "tmpfs", 0, ""); unshare(CLONE_NEWPID); pid_t pid = fork(); if (pid == 0) { fork(); } else { ptrace(PTRACE_SEIZE, pid, 0, PTRACE_O_TRACEFORK); char template[128] = "/testg/XXXXXX"; if (!mkdtemp(template)) abort(); FILE *f = fopen(strcat(template, "/cgroup.procs"), "w"); fprintf(f, "%d\n", pid); fclose(f); wait(NULL); // stopped at fork() kill(pid, SIGKILL); umount("/temp-mnt"); } return 0; } -- Kazuki Yamaguchi