Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4161535imm; Wed, 5 Sep 2018 11:42:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZpgzITrpkJAeWtGLE9fpW6jdII3D8h/FS+8RoYpGrXo17HWUnCZTvv/pZIBp8KZ102q84w X-Received: by 2002:a17:902:bf46:: with SMTP id u6-v6mr40296960pls.85.1536172947971; Wed, 05 Sep 2018 11:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536172947; cv=none; d=google.com; s=arc-20160816; b=0XyMImoQUdQVqvyeJBW09KyCSgUxPLcsfeFiP32Tv2VYiYT88c0kZgUgCxFIYdAm0z XA99U598iBUdq1zWkbPiV4QB6cmBrG6/G3Tv2DlVoFc0fMYJfrX4ZxoK2iJ/VebU2tcB x/6EO6Oo+gHRmhpsA1x08q8ukKtNUy0z4qIoMJQCiuce5iK78rSoETK/qPwXpRzF8VaU SIHRTDwIMUCKFFy0dMtjuUydJgL1gycQmQY5a/IxXwKAyznRfdytgJiaNwSw8OaFg78B htGvaxfgyR3uY8nVjkFbLxH0kD+BHit2l6/QSv2NArR9todSXXCmiAT2N1k/G0DBw55v 4+Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=y+SqTKknweVJO8q0MhdvHjYBCgdf04YVWyxUcxYzxAA=; b=meNRTaztjqY4u92XOMs1ygQy45STTkBG4eJi8D2XaZ6QzmXji3xAWWhjz3bUiwuXHr VEDM2/fyPkKgxbTc+7VTBp7wObIBnXmSEjx/WjX6Bz051FGmxBumlfSt17pKAM59/JN9 t8rcqj3wExn6CTqekaedBgRLyscd+qfAlaefnpvKdfrWV4lCOgDzUklzaVUbDwkuAFzm dIo3Vi4tyy6/tUzzZ/HA9Ha+TcefkAwN6ha1ksiDu5vyz7GtcJY//4CTUiZu665AYYbB kdUMCMdh1CVzvbcTnF/95rYcdLqu88mqZIq/jSmt1bsx+IDSuUwn3SjIgwW1UkfsGWXM o1GA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 25-v6si2714307pfk.287.2018.09.05.11.42.11; Wed, 05 Sep 2018 11:42:27 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727749AbeIEXLq (ORCPT + 99 others); Wed, 5 Sep 2018 19:11:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43232 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbeIEXLq (ORCPT ); Wed, 5 Sep 2018 19:11:46 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6760A85A04; Wed, 5 Sep 2018 18:40:21 +0000 (UTC) Received: from sky.random (ovpn-120-15.rdu2.redhat.com [10.10.120.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31A9F2010CAB; Wed, 5 Sep 2018 18:40:19 +0000 (UTC) Date: Wed, 5 Sep 2018 14:40:18 -0400 From: Andrea Arcangeli To: Jiri Kosina Cc: Andi Kleen , Tim Chen , "Schaufler, Casey" , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Josh Poimboeuf , "Woodhouse, David" , Oleg Nesterov , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH v3 1/3] ptrace: Provide ___ptrace_may_access() that can be applied on arbitrary tasks Message-ID: <20180905184018.GC11625@redhat.com> References: <31436186-88da-324e-88a0-8fdca7bf60ac@linux.intel.com> <99FC4B6EFCEFD44486C35F4C281DC67321447094@ORSMSX107.amr.corp.intel.com> <3f24e8c8-eab8-66c2-9a8d-957e30cac809@linux.intel.com> <20180905155823.GL27886@tassilo.jf.intel.com> <20180905180459.GB11625@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 05 Sep 2018 18:40:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 05, 2018 at 08:29:07PM +0200, Jiri Kosina wrote: > (and no, my testing of the patch I sent on current tree didn't produce any > hangs -- was there a reliable way to trigger it on 3.10?). Only a very specific libvirt acceptance test found this after a while and it wasn't a customer it was caught by QA. The reporter said it wasn't sure about how to reproduce this issue either, it happened once in a while the backtrace was still enough to fix it for sure and then it never happened again. It's not because of virt but probably because of selinux+audit. This is precisely why I thought once you enter LSM from the scheduler atomic path the trouble starts as each LSM implementation of those calls may crash or not crash. Perhaps you didn't sandbox KVM inside selinux by default? This is the lockup the patch I posted fixed for 3.10. [ 1838.621010] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 6 [ 1838.629070] CPU: 6 PID: 0 Comm: swapper/6 Not tainted 3.10.0-327.62.4.el7.x86_64 #1 [ 1838.637610] Hardware name: Dell Inc. PowerEdge R430/0CN7X8, BIOS 2.4.2 01/09/2017 [ 1838.645954] Call Trace: [ 1838.648680] [] dump_stack+0x19/0x1b [ 1838.655113] [] panic+0xd8/0x1e7 [ 1838.660460] [] ? restart_watchdog_hrtimer+0x50/0x50 [ 1838.667742] [] watchdog_overflow_callback+0xc2/0xd0 [ 1838.675024] [] __perf_event_overflow+0xa1/0x250 [ 1838.681920] [] perf_event_overflow+0x14/0x20 [ 1838.688526] [] intel_pmu_handle_irq+0x1e8/0x470 [ 1838.695423] [] ? ioremap_page_range+0x24c/0x330 [ 1838.702320] [] ? unmap_kernel_range_noflush+0x11/0x20 [ 1838.709797] [] ? ghes_copy_tofrom_phys+0x124/0x210 [ 1838.716984] [] ? ghes_read_estatus+0xa0/0x190 [ 1838.723687] [] perf_event_nmi_handler+0x2b/0x50 [ 1838.730582] [] nmi_handle.isra.0+0x69/0xb0 [ 1838.736992] [] do_nmi+0x169/0x340 [ 1838.742532] [] end_repeat_nmi+0x1e/0x7e [ 1838.748653] [] ? _raw_spin_lock_irqsave+0x3d/0x60 [ 1838.755742] [] ? _raw_spin_lock_irqsave+0x3d/0x60 [ 1838.762831] [] ? _raw_spin_lock_irqsave+0x3d/0x60 [ 1838.769917] <> [] avc_compute_av+0x126/0x1b5 [ 1838.777125] [] ? walk_tg_tree_from+0xbe/0x110 [ 1838.783828] [] avc_has_perm_noaudit+0xc4/0x110 [ 1838.790628] [] cred_has_capability+0x6b/0x120 [ 1838.797331] [] ? ktime_get+0x4c/0xd0 [ 1838.803160] [] ? clockevents_program_event+0x6b/0xf0 [ 1838.810532] [] selinux_capable+0x2e/0x40 [ 1838.816748] [] security_capable_noaudit+0x15/0x20 [ 1838.823829] [] has_ns_capability_noaudit+0x15/0x20 [ 1838.831014] [] ptrace_has_cap+0x35/0x40 [ 1838.837126] [] ___ptrace_may_access+0xa7/0x1e0 [ 1838.843925] [] __schedule+0x26e/0xa00 [ 1838.849855] [] schedule_preempt_disabled+0x29/0x70 [ 1838.857041] [] cpu_startup_entry+0x184/0x290 [ 1838.863637] [] start_secondary+0x1da/0x250