Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4182685imm; Wed, 5 Sep 2018 12:04:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZcva8BbOK0TmgemmSgQvuYKeWdvCWDliK3jtNlg+4Qe6I4ybUyEJR1mik/Ntm9n52Ql1qJ X-Received: by 2002:a63:fc54:: with SMTP id r20-v6mr38092486pgk.377.1536174299063; Wed, 05 Sep 2018 12:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536174299; cv=none; d=google.com; s=arc-20160816; b=TI+57Q3xAKUWc2hFm8/wBBP1Xuqjw23wIxNPstZHJKjBI3WUf3FHhz5XqFCPqw1pZZ Vu/NFdNzcf4j02Eb4jpRn0H5GdD5yqepnv/24q0z4mfh6+PMOfL8mDbOmk1J6iry6WrE vVI2YoYvP/5EaREM2d86V+6DJ4BUBbekhX1Ti0AyDjjsLbuIf4Fg1sTeHlOPrf4IoZxB mv9iiZfSDC5Il6/fqyRKTIKIOx5BUCL1Nh9nHeVCL0FG14kSxCghEke7c29AjUiB48Qs /FEqjhOfb5bBQ2F7N4I1czWWSf5CAEyliKrcuZkrDDBdp5SQTnlqNUL0oteHhSDWhbLL VSyQ== 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:dkim-signature; bh=MUsKO0pa0Um+zuT4YtYePUtZuX5JqC56U8InfzuVuVA=; b=UGevLcBZfEvBxPKWvvMQYFx7E/+KVaQw8m3iEhYiL1TWM74aoQ6CP3rC4OKaGh2QYz jND5iyeuzNgI8BIHcCEVoh4l05FkVYSpZFUfgpn8M3/ocPmGOMPw+vsKTM+WisA0gf3T j3hzYlCE4RwHnDtHHB/+8TJZa9VgaQda4SaIDvaYeVnjC3XquxWxrBN+OHov5PGefBYY pQ2uQoVrxTHsTbri6ar7/W34qo13Z2Tcvi1Og6jfDHuGyGHa4CmKFvLYs9lvguqPTrSB AWu/+qX+uUtH+WaY+CENx0d1uAiBjflLJH+uskgs18axU3gRy+BMMlnlxHWTFmtsb7qN WPmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=2xEhAzwM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15-v6si2504085pga.117.2018.09.05.12.04.43; Wed, 05 Sep 2018 12:04:59 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=2xEhAzwM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727832AbeIEXep (ORCPT + 99 others); Wed, 5 Sep 2018 19:34:45 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35808 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726544AbeIEXep (ORCPT ); Wed, 5 Sep 2018 19:34:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MUsKO0pa0Um+zuT4YtYePUtZuX5JqC56U8InfzuVuVA=; b=2xEhAzwME1IIkrnorIEHrUx0/ RYkTdflEibIfgJbdcToN9Y4fb+mE7yvT+NOTBF8uHlClXawRI5Edt3zhc8b8lKzFQKb9U5eG4+hdy sYTs5LljeJ5grJJ2hbJKywdZHQcxPOoJ5jKYXTcREQ1liSy8TZAgEsPRGzpWxUI+QauzBL9ifDEUB zzBQZFhdiCdAokwJ3rz8woCGGRlUnXU12O+JxmNbpKSctV5TCyJDD2fyEzwjjKE3vLaUVvyrInh3w beoxzvNKUZlTptX+cDNtIECD3VtidKTAN+dLMH72POZCG2jZSVqpGSPQsearqEjhtJF+HBegWB0Z6 9qKxiUNzg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxd53-0000xG-Dd; Wed, 05 Sep 2018 19:03:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4089920210301; Wed, 5 Sep 2018 21:03:08 +0200 (CEST) Date: Wed, 5 Sep 2018 21:03:08 +0200 From: Peter Zijlstra To: Andrea Arcangeli Cc: Jiri Kosina , Andi Kleen , Tim Chen , "Schaufler, Casey" , Thomas Gleixner , Ingo Molnar , 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: <20180905190308.GD24082@hirez.programming.kicks-ass.net> 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> <20180905184018.GC11625@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180905184018.GC11625@redhat.com> User-Agent: Mutt/1.10.0 (2018-05-17) 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 02:40:18PM -0400, Andrea Arcangeli wrote: > [ 1838.769917] <> [] avc_compute_av+0x126/0x1b5 That does read_lock(), which is not allowed from scheduler context. > [ 1838.777125] [] ? walk_tg_tree_from+0xbe/0x110 > [ 1838.783828] [] avc_has_perm_noaudit+0xc4/0x110 In current code this can end up in avc_update_node() which uses spin_lock(), which is a bug from scheduler context.o > [ 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 So yes, looks like all that security LSM nonsense isn't going to work here.