Received: by 10.223.164.202 with SMTP id h10csp129269wrb; Mon, 6 Nov 2017 03:58:41 -0800 (PST) X-Google-Smtp-Source: ABhQp+QTAL69gpgbNJQcwBJZ+Zugo59Ee4vZix6XZxSK0n4Av7t23CVOIamSEm2u4QCk1yB8O9pz X-Received: by 10.99.49.130 with SMTP id x124mr15050778pgx.367.1509969521143; Mon, 06 Nov 2017 03:58:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509969521; cv=none; d=google.com; s=arc-20160816; b=ohcGxweyie7qLT35bYeRsnYmwLGQdAyywm7OGdyZFFP+hBkOADaEEXJav0cjDuMIyx V6sqcWeJ3sQA3mMY273iMhF4t3LjmlQubuR5bjEzZ1LzkUEPFCihwqqAx5A99su8JDN7 2KvaGMnOTKotCp8+3hxS6DfwoDid0h8CYdnq2JoVeX6XIoEY4Yeq9xZpwikNvwWoDSqR seRxfnsW3JA9fpDh9bL89AytL3qgB20sjxpyLXOyZGg7tA/Oe61+T+3PQH/XmiR2RcUi k1wOXwYDgH6lToeiEt7uAENJbHPO9TUvLyGIYWsYkfhlXMxtkbEk+f42mMeEFNqJlnVd PW+Q== 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=Qxzp1s7/XSqDkQ1HDmEOYdrHzZzPgoV/ttlCUQc1WRY=; b=EPNvfu6TL3WnwE0cwjXifdpj3H06ouyy+Pf8GmJzJXQPtscHbNXo1D+7bF5UXV9KqW Hr3+iQjP9xXloTF3e5mxLDOnKHHefIMDz/BspzguwN6zftoLFhTS+yuYJcqd2DZNLiLz BDspGHa5KomINoVR6I1FwZGo295+S7C84eIB7H9i7zzmv+oIuib7/mMJXFSy5HN0BJOC 6c2bEOeNCfRZeUyg1vl9C9OHjsl2tP983+9o4umvQVGFHyxCvH/JwC+OPFwLN8qxvkDV pGLabG/5FiqJ2+8hkvIo5dMC87k3R1iWFRWqaSyrCgsuVl6ZMJF3o479vdvU+il2SgiO G/3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=c46aOmVB; 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 e92si10136492plb.102.2017.11.06.03.58.27; Mon, 06 Nov 2017 03:58:41 -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=c46aOmVB; 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 S1752585AbdKFL4c (ORCPT + 99 others); Mon, 6 Nov 2017 06:56:32 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:45490 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbdKFL4a (ORCPT ); Mon, 6 Nov 2017 06:56:30 -0500 Received: by mail-it0-f45.google.com with SMTP id n195so4952793itg.0 for ; Mon, 06 Nov 2017 03:56:30 -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=Qxzp1s7/XSqDkQ1HDmEOYdrHzZzPgoV/ttlCUQc1WRY=; b=c46aOmVBtUjfwpm/JNhLPVqSIcqnSPJEpANL2CIjLsnbrzYeIHMMOS0jMgSAEhqAnH ELvQlXqaLFWLCN2uviaeLUZjEmnDP6SRlNhQAMQgy2QaofuLo6vHSVhs1FmqkyFlbHah 7jdaZwGwkBWWX+CAHR81kYRarvsDj1Rt+RvX5NXmcOcsxaew+/i3ftHDGyxeD92S63MV MDdvnyOgOAxfkeN6zxx8Fw9LfwIT2gpTNs8bEy02/gUiaJy3eY8zsZ+9HYjumni2BFlK xPy7rSi9eIOfn7pm+tvaD5r8xQDO3W2fSrBE1lWos40wIbRMa2mZ0T/198SklVL0wsW9 zbcA== 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=Qxzp1s7/XSqDkQ1HDmEOYdrHzZzPgoV/ttlCUQc1WRY=; b=Jmqpg2EFI+j28FGV4GoSGjjA52CMU1TsxsYvW5iqUKQGAcmxCMdqAEB08Esu8rSmet iCpyclkUrCiBnEJQ9uIq8NtnWfxEM5I3wKs1FYx2t0s8XNmZDtK267eihy0diSfuWxFD wylzSRbf51rXkPmipLS/QqbU1v//hm72tL3ZCjBJw+u/wYOy2S7FZ90fAwjqjow86jFN 3YEoUpdl98IORlGn7A8lMomgfsa0ltmQSv8DidQVP2a1VgiF05WwMc1qpaL1iNOUAhOu xONdy5zRi1LavRBHsLEpfeK+Xa1LOZftW7yZJLbJU2wSRFbgGOMqEtmg+VGiuFQDcSqm hjJA== X-Gm-Message-State: AJaThX5hLEZulosDbdWHaflh7v04NidqptK0pbyuZxS5uga05JwJk1F7 9R+4lNtaA+Y+vvLV4lLqTAntX2nYY9y+PfCJz5Lqpg== X-Received: by 10.36.50.208 with SMTP id j199mr9424013ita.52.1509969389624; Mon, 06 Nov 2017 03:56:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.155.231 with HTTP; Mon, 6 Nov 2017 03:56:09 -0800 (PST) In-Reply-To: <20171106112508.lun6eftpj5icnvdy@cedar> References: <94eb2c058c80ea49ed055cc8695e@google.com> <20171031163451.GA30223@redhat.com> <20171102170138.GA13663@redhat.com> <20171106112508.lun6eftpj5icnvdy@cedar> From: Dmitry Vyukov Date: Mon, 6 Nov 2017 12:56:09 +0100 Message-ID: Subject: Re: WARNING in task_participate_group_stop To: Jamie Iles Cc: Oleg Nesterov , 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 12:25 PM, Jamie Iles wrote: > Hi Dmitry, > > On Mon, Nov 06, 2017 at 12:02:19PM +0100, Dmitry Vyukov wrote: >> On Thu, Nov 2, 2017 at 6:01 PM, Oleg Nesterov wrote: >> > On 11/01, Dmitry Vyukov wrote: >> >> >> >> On Tue, Oct 31, 2017 at 7:34 PM, Oleg Nesterov wrote: >> >> > Hmm. I do not see reproducer in this email... >> >> >> >> Ah, sorry. You can see full thread with attachments here: >> >> https://groups.google.com/forum/#!topic/syzkaller-bugs/EUmYZU4m5gU >> > >> > Heh. I can't say I enjoyed reading the reproducer ;) >> > >> >> >> > WARNING: CPU: 0 PID: 1 at kernel/signal.c:340 >> >> >> > task_participate_group_stop+0x1ce/0x230 kernel/signal.c:340 >> >> >> > Kernel panic - not syncing: panic_on_warn set ... >> >> >> > >> >> >> > CPU: 0 PID: 1 Comm: init Not tainted 4.13.0-mm1+ #5 >> >> > >> >> > So this is init process with SIGNAL_UNKILLABLE flag set. And I hope it has >> >> > the pending SIGKILL, otherwise there is something else. >> > >> > From repro.c >> > >> > 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. >> > >> > But how *(uint32_t*)0x20f9cffc can be 1 ? >> > >> > line 108 r[6] = syscall(__NR_fcntl, r[1], 0x10ul, 0x20f9cff8ul); >> > >> > this is F_GETOWN_EX, addr = 0x20f9cff8 == 0x20f9cffc + 4, so if fcntl() >> > actually succeeds then r[7] == f_owner_ex->pid. >> > >> > It _can_ be 1, but the reproducer doesn't work for me. If you can reproduce, >> > could you try the patch below? >> >> Hi, >> >> I would like to understand why you were not able to reproduce it. I >> won't be sitting here all the time, and we are tracking hundreds of >> bugs across different linux kernels and other OSes, so it's >> problematic to do any extensive work on all of them. That's why we try >> to provide reproducers. >> >> I've just tried the repro on the latest upstream >> (39dae59d66acd86d1de24294bd2f343fd5e7a625) and it triggered the >> WARNING within a second. >> Did you use the config provided? Did you use qemu or real hardware? >> Can you try in qemu (with -smp>1)? > > I'm unable to reproduce the warning in qemu with SMP (on a 32 CPU VM). > Instead I get the following instant traceback which is different to what > you report when run as root: Uh, it seems to be racy. I am getting either the WARNING or "attempt to kill init" in ~1/5 proportion. Please try this simplified program, it triggers the WARNING all the time for me: // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include #include #include #include int main() { long r[11]; memset(r, -1, sizeof(r)); r[0] = syscall(__NR_mmap, 0x20000000ul, 0xfec000ul, 0x3ul, 0x32ul, 0xfffffffffffffffful, 0x0ul); r[1] = syscall(__NR_inotify_init1, 0x80000ul); *(uint32_t*)0x20feb000 = (uint32_t)0xc; r[3] = syscall(__NR_getsockopt, 0xfffffffffffffffful, 0x1ul, 0x11ul, 0x2003cff4ul, 0x20feb000ul); if (r[3] != -1) r[4] = *(uint32_t*)0x2003cff4; r[5] = syscall(__NR_fcntl, r[1], 0x8ul, r[4]); r[6] = syscall(__NR_fcntl, r[1], 0x10ul, 0x20f9cff8ul); if (r[6] != -1) r[7] = *(uint32_t*)0x20f9cffc; r[8] = syscall(__NR_ptrace, 0x10ul, r[7]); r[9] = syscall(__NR_ioctl, 0xfffffffffffffffful, 0x4b6aul, 0x20f9e000ul); r[10] = syscall(__NR_ptrace, 0x4200ul, r[7], 0x40000012ul, 0x100012ul); return 0; } From 1583315780407190711@xxx Mon Nov 06 11:26:34 +0000 2017 X-GM-THRID: 1582711532474407023 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread