From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:51480 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932515AbcI3PgQ (ORCPT ); Fri, 30 Sep 2016 11:36:16 -0400 Date: Fri, 30 Sep 2016 17:35:05 +0200 From: Oleg Nesterov To: Jann Horn Cc: Alexander Viro , Roland McGrath , John Johansen , James Morris , "Serge E. Hallyn" , Paul Moore , Stephen Smalley , Eric Paris , Casey Schaufler , Kees Cook , Andrew Morton , Janis Danisevskis , Seth Forshee , "Eric . Biederman" , Thomas Gleixner , Benjamin LaHaise , Ben Hutchings , Andy Lutomirski , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, security@kernel.org Subject: Re: [PATCH v2 1/8] exec: introduce cred_guard_light Message-ID: <20160930153505.GA17573@redhat.com> References: <1474663238-22134-1-git-send-email-jann@thejh.net> <1474663238-22134-2-git-send-email-jann@thejh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1474663238-22134-2-git-send-email-jann@thejh.net> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 09/23, Jann Horn wrote: > > This is a new per-threadgroup lock that can often be taken instead of > cred_guard_mutex and has less deadlock potential. Oh, please don't. > I'm doing this because > Oleg Nesterov mentioned the potential for deadlocks, in particular if a > debugged task is stuck in execve, trying to get rid of a ptrace-stopped > thread, and the debugger attempts to inspect procfs files of the debugged > task. Yes, but we need to fix this anyway. And I am not sure the new mutex can actually help. And I think that cred_guard_mutex is already over-used in fs/proc. Say, I think lock_trace() must die, I simply can't understand why it is useful. Suppose we modify, say, proc_pid_stack() to do save_stack_trace_tsk(task, &trace); if (!ptrace_may_access(task, ...)) goto return -EPERM; for (i = 0; i < trace.nr_entries; i++) seq_printf(...); return 0; is there any problem if it shows some trace before setuid exec does install_exec_creds() ? Oleg.