Message ID | 20200214183554.1133805-28-christian.brauner@ubuntu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=tyYQ=4C=vger.kernel.org=linux-fsdevel-owner@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B808930 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Fri, 14 Feb 2020 18:41:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14EEB24649 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Fri, 14 Feb 2020 18:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387704AbgBNSlf (ORCPT <rfc822;patchwork-linux-fsdevel@patchwork.kernel.org>); Fri, 14 Feb 2020 13:41:35 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:33879 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729595AbgBNSlf (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); Fri, 14 Feb 2020 13:41:35 -0500 Received: from ip5f5bf7ec.dynamic.kabel-deutschland.de ([95.91.247.236] helo=wittgenstein.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <christian.brauner@ubuntu.com>) id 1j2fqo-0000uO-Ph; Fri, 14 Feb 2020 18:38:06 +0000 From: Christian Brauner <christian.brauner@ubuntu.com> To: =?utf-8?q?St=C3=A9phane_Graber?= <stgraber@ubuntu.com>, "Eric W. Biederman" <ebiederm@xmission.com>, Aleksa Sarai <cyphar@cyphar.com>, Jann Horn <jannh@google.com> Cc: smbarber@chromium.org, Seth Forshee <seth.forshee@canonical.com>, Alexander Viro <viro@zeniv.linux.org.uk>, Alexey Dobriyan <adobriyan@gmail.com>, Serge Hallyn <serge@hallyn.com>, James Morris <jmorris@namei.org>, Kees Cook <keescook@chromium.org>, Jonathan Corbet <corbet@lwn.net>, Phil Estes <estesp@gmail.com>, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org, Christian Brauner <christian.brauner@ubuntu.com> Subject: [PATCH v2 27/28] ptrace: adapt ptrace_may_access() to always uses unmapped fsids Date: Fri, 14 Feb 2020 19:35:53 +0100 Message-Id: <20200214183554.1133805-28-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200214183554.1133805-1-christian.brauner@ubuntu.com> References: <20200214183554.1133805-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-fsdevel.vger.kernel.org> X-Mailing-List: linux-fsdevel@vger.kernel.org |
Series |
user_namespace: introduce fsid mappings
|
expand
|
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 43d6179508d6..3734713cc0dd 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -304,8 +304,8 @@ static int __ptrace_may_access(struct task_struct *task, unsigned int mode) return 0; rcu_read_lock(); if (mode & PTRACE_MODE_FSCREDS) { - caller_uid = cred->fsuid; - caller_gid = cred->fsgid; + caller_uid = cred->kfsuid; + caller_gid = cred->kfsgid; } else { /* * Using the euid would make more sense here, but something
ptrace_may_access() with PTRACE_MODE_FSCREDS is only used with proc and proc wants to use the unmapped fsids. Cc: Jann Horn <jannh@google.com> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com> --- /* v2 */ patch added --- kernel/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)