Received: by 10.223.164.202 with SMTP id h10csp938560wrb; Tue, 7 Nov 2017 18:02:24 -0800 (PST) X-Google-Smtp-Source: ABhQp+S80xk7qAARYZV/Ea8zphxN/bwJf+EC4Q+MTVlpvgYbN3+lv2Pbui3A+Eqb24DPCTDz0t7S X-Received: by 10.99.56.82 with SMTP id h18mr678111pgn.281.1510106544692; Tue, 07 Nov 2017 18:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510106544; cv=none; d=google.com; s=arc-20160816; b=L2y58026EBnqTCXT9O112q4lEFTnF0E4jyEOQYngDXkgDblfI8p3LZNS0gtlJ/qw6P 9ZEQMhJAl9W/j45pv4CYpXjIzvfxN8+qV2CIrUj4jnRazV5VIEgQDpoIFen1HFNjTytx DlBl7VA5fp8eqUCwiQaz3C7/M5oKqYI4MmaWf87QXR8RnDbVwqmbKixRYRzkyme+i4xF bpnHZ3I1tm6Z5cxV8YRgMluDREHmhMW2Lhr55MDlNmapLPE953H98TZ+rllKV3kh/t36 5WHyaX0ERi96xfB6Tia9EFmWNWoTeq8MDEG0hk/fx0JTi9kNxMNnkRrnpTdEtIyg0AEE FvSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=uD/GRhn0IKYXejjOfU6CdVT2pF6Q205ShaLp9P+zlbo=; b=lf/dzwMbLIlbvOkeoaTzKCUTGVBpk/7Gof5IDHopTYLXrAoJ87T4LxTkyeB2gb8Ujb +zEhRqlKSZuZZJ4vJwX44vjxACF5vcL+1cCxOXLYh09ZC7fbhs+J0nQkv2kpR6QAxGQx dk5qFGInJwYD2RmZWd48Tj+s7Ha7DwTXqtE8T0MwNDaKO3HxF3p357/LzDdhU6Xd/8uj OHABXpO6dOyDDUnZbj6jsk+D+gVNcnL7Y8h1a68V5b3Y2MVAoTkkoJ3+hMxYj5gK1hX4 TB41j8zBSf92Ke1Xxw3Lva+VWWKbE3/Pjd+mGYeIFhN4+Qy0udOktqYFuTfSWp9LVxlD 7NsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=atoGCi7/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n74si2622878pfi.253.2017.11.07.18.02.11; Tue, 07 Nov 2017 18:02:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=atoGCi7/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758575AbdKGRbf (ORCPT + 92 others); Tue, 7 Nov 2017 12:31:35 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:48750 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753321AbdKGRbd (ORCPT ); Tue, 7 Nov 2017 12:31:33 -0500 Received: by mail-it0-f68.google.com with SMTP id c3so3404332itc.3 for ; Tue, 07 Nov 2017 09:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uD/GRhn0IKYXejjOfU6CdVT2pF6Q205ShaLp9P+zlbo=; b=atoGCi7/2i2VPY5IiS7tcSzWKYMSv01QaixGTSmM3u62NIeL3vyxEeBxI0MmFSVNr8 X0eBIjR5XDNDK3fPnQ7z6ED60rhMhuLKFdDGLUhcN5HEJL8TwCmx4J0plIy1gXr5MIt3 4J8MrdvC/PiivvhvSwfIYVptI/9fBaDGSmvOZX2suG4zoPnD1nVkGTpTCiq4o380O40A o2pX2XaW8b8CnVSsrbvh2AFpXEamXW9lhgZL2K650xOb93b47+/KvAE6lyp+RLsoE/mN ysG5aQ3ZFuQKp+0x3e9QUanZTgum5jNArMf43YvAcBwmR26oeTxN0xcYET2JwSFexdGV D4aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uD/GRhn0IKYXejjOfU6CdVT2pF6Q205ShaLp9P+zlbo=; b=hb/cWveyQhq2VNtWgddH9Vopb7ewdemGHYw0kpA1pMoXWl/yWojs2+ogZ+M+vFD+Kf XZ3iaQOGoNGFhkAIW+b5PHda2T2W0QP4DR0y9Gyt34AOi7NahZdZEgKcgZBmwjf0f4/j 8wiRPC4IP5/GHoVsfhZvyVxTOUd2u8UyL2E0Unmy4YLor9RuqCfsmMbmEc0Wl/2sKq78 5LRf8w1PE13mnxlqMW+1Z2LtQU7KIdtFk3++xaqVg/p6enCHmOGA0Ao3zYIjTe8thIjd J40GrGlfRnkG5TPhr/giTeuaDju4Yr/40uQzjlaLZbtCUjiIiTUJ2L//KEcJA5fjwJI/ 5y4Q== X-Gm-Message-State: AJaThX5fkg0v3bwjeR87f0p6hVjhfNcZ81HcmOo14joRt52bnalR3y/R XrhQzACs862E+4ibIvRH+OmNcWXInjuY1A6cPAyWlQ== X-Received: by 10.36.175.11 with SMTP id t11mr3183267ite.85.1510075892852; Tue, 07 Nov 2017 09:31:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.155.231 with HTTP; Tue, 7 Nov 2017 09:31:12 -0800 (PST) In-Reply-To: <20171106143138.GA17423@redhat.com> References: <94eb2c058c80ea49ed055cc8695e@google.com> <20171031163451.GA30223@redhat.com> <20171102170138.GA13663@redhat.com> <20171106112508.lun6eftpj5icnvdy@cedar> <20171106143138.GA17423@redhat.com> From: Dmitry Vyukov Date: Tue, 7 Nov 2017 18:31:12 +0100 Message-ID: Subject: Re: WARNING in task_participate_group_stop To: Oleg Nesterov Cc: Jamie Iles , syzbot , Andrew Morton , Arvind Yadav , Mark Brown , "Eric W. Biederman" , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , LKML , "Martin K. Petersen" , mchehab@kernel.org, Ingo Molnar , mpe@ellerman.id.au, syzkaller-bugs@googlegroups.com, Al Viro , Kyle Huey , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 6, 2017 at 3:31 PM, Oleg Nesterov wrote: > On 11/06, Jamie Iles wrote: >> >> I'm unable to reproduce the warning in qemu with SMP (on a 32 CPU VM). > > Neither me. Perhaps because I tried this test-case on the minimal system > with /bin/sh running as init process. > >> Instead I get the following instant traceback which is different to what >> you report when run as root: >> >> [ 45.018469] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000013 >> [ 45.018469] >> [ 45.019669] CPU: 19 PID: 1 Comm: systemd Not tainted 4.14.0-rc8 #7 >> [ 45.021094] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 04/01/2014 >> [ 45.022768] Call Trace: >> [ 45.023076] dump_stack+0x12e/0x188 >> [ 45.023481] panic+0x1e4/0x417 > > This is fine and hopefully confirms the theory. let me quote my previous email: > > line 111 r[8] = syscall(__NR_ptrace, 0x10ul, r[7]); > > this is PTRACE_ATTACH > > line 115 syscall(__NR_ptrace, 0x4200ul, r[7], 0x40000012ul, 0x100012ul); > > this is PTRACE_SETOPTIONS and "data" includes PTRACE_O_EXITKILL. > > r[7] is initialized at > > line 110 r[7] = *(uint32_t*)0x20f9cffc; > > so if it is eq to 1 then it can attach to init and in this case the problem > can be explained by the wrong SIGNAL_UNKILLABLE/SIGKILL logic. > > So, if it is eq to 1 then init will be killed after the child process created > by loop() function exits (see PTRACE_O_EXITKILL above). > > This is correct, only the warning is not. > > For example, this command does ptrace(PTRACE_SEIZE, 1,0, PTRACE_O_EXITKILL) > > # perl -e 'syscall 101, 0x4206, 1, 0, 0x100000' > > and crashes the kernel the same way, this is correct. Oleg, I've tested the patch and I don't see the WARNING with it. Only attempt to kill init, which is fine, we test inside of pid namespace and test process is not able to reach init. Tested-by: Dmitry Vyukov From 1583327554334917573@xxx Mon Nov 06 14:33:43 +0000 2017 X-GM-THRID: 1582711532474407023 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread