From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D3DBC433DB for ; Tue, 9 Mar 2021 21:31:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 005EF64F74 for ; Tue, 9 Mar 2021 21:31:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231997AbhCIVbE (ORCPT ); Tue, 9 Mar 2021 16:31:04 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:40198 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbhCIVay (ORCPT ); Tue, 9 Mar 2021 16:30:54 -0500 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lJjwI-002YEr-EK; Tue, 09 Mar 2021 14:30:50 -0700 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lJjwH-00FGKw-E3; Tue, 09 Mar 2021 14:30:50 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Al Viro Cc: Palash Oswal , akpm@linux-foundation.org, dave@stgolabs.net, Kees Cook , linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, rppt@linux.vnet.ibm.com, sds@tycho.nsa.gov, syzkaller-bugs@googlegroups.com References: Date: Tue, 09 Mar 2021 15:30:52 -0600 In-Reply-To: (Al Viro's message of "Tue, 9 Mar 2021 14:25:36 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1lJjwH-00FGKw-E3;;;mid=;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+HjtweDKY1K86sC4DDB32cQP+KXJFBrcI= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: kernel panic: Attempted to kill init! X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Al Viro writes: > On Tue, Mar 09, 2021 at 11:29:14AM +0530, Palash Oswal wrote: > >> I observe the following result(notice the segfault in systemd): >> root@sandbox:~# ./repro >> [ 9.457767] got to 221 >> [ 9.457791] got to 183 >> [ 9.459144] got to 201 >> [ 9.459471] got to 208 >> [ 9.459773] got to 210 >> [ 9.462602] got to 270 >> [ 9.488551] systemd[1]: segfault at 7ffe59fd7fb8 ip >> 000055be8f20b466 sp 00007ffe59fd7fc0 error 6 in >> systemd[55be8f15f000+ed000] >> [ 9.490723] Code: 00 00 00 00 41 57 41 56 41 55 41 54 55 53 89 fd >> 48 81 ec 48 01 00 00 64 48 8b 04 25 28 00 00 00 48 89 84 24 38 01 00 >> 00 31 c0 f5 bf f7 ff 83 f8 01 0f 84 b7 00 00 00 48 8d 9c 240 >> [ 9.492637] Kernel panic - not syncing: Attempted to kill init! >> exitcode=0x0000000b > > Lovely. So something in that sequence of syscalls manages to trigger > segfault in unrelated process. What happens if you put it to sleep > right after open_by_handle_at() (e.g. by read(2) from fd 0, etc.)? There is the creation of at least one file. I wonder if inotify or another notification mechanism is being triggered in systemd, and systemd handling the notification badly and falling over. Eric