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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 A9392C43334 for ; Wed, 5 Sep 2018 18:40:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 625E92077C for ; Wed, 5 Sep 2018 18:40:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 625E92077C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727757AbeIEXLq (ORCPT ); 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