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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 BF818C433E0 for ; Fri, 19 Mar 2021 18:46:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96D5461985 for ; Fri, 19 Mar 2021 18:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbhCSSqM (ORCPT ); Fri, 19 Mar 2021 14:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231162AbhCSSpp (ORCPT ); Fri, 19 Mar 2021 14:45:45 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EAFCC061760 for ; Fri, 19 Mar 2021 11:45:40 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id y5so6518925pfn.1 for ; Fri, 19 Mar 2021 11:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=JGY/EqeMUGC+Bt0wZ3nGVTDLepgM3WlnAUKZmdbmQ04=; b=BMblp60iEXVdjovxUp1rExGL91YRwQuPg7ex7JypQ4I7GzGU459rL4//OWZYwwYXk1 vbD6FWRxEj3FEA+nwCLdGAE01jhnkk9hWRSGjaS5U+/niv+lnudUwa5wXNK4WXp8Sc+8 K5+rT+YUekesYA4H7ZEzBPFgjWkvH2RjmvCE0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=JGY/EqeMUGC+Bt0wZ3nGVTDLepgM3WlnAUKZmdbmQ04=; b=St2D75Sbn/DE51+Y95z32N686xwAp7v6YuHlYzs6HmuUOzggZ6PEe7f2DaZivtg1g6 gsE691bj0HTouBBJGt1GM7Ygp4WTiaM042pLd9KTU2MAjGq/DVDxE6qZOcdFavvtiiWT BHzl7LSSyUPGnEBAaNcPeaJ07bKiMICcERCBPlsLcczdVM9gGQxx977OMFeHbRutqF0H Ieyj3Fs5LLuJDdiiMpxTArCvgSCv0KjEQsAj70YrklQg78N3TtGu8JI5HzRXY9Zf3wDZ EywS2Dd5hBcbkfhIgZzePhiO8sKmOrMPAep4lcn00zRBmI0egeTfqG3mt5dkhbT+o5So Ymeg== X-Gm-Message-State: AOAM530XHc2KOIKDUDI+kIyqAf4dM/sGnflxI1MDFXkFKujF4xn/0NST v6HbB8esI4WgR/FzFKsaK1P7KA== X-Google-Smtp-Source: ABdhPJxnvtZMI8WcSLqJP4CQU2LP1bacblL/FkbqVKRmPz2mN29hO8eLj66oHnTAGfPb6/ukaMAz3Q== X-Received: by 2002:a63:ff21:: with SMTP id k33mr12313273pgi.379.1616179539760; Fri, 19 Mar 2021 11:45:39 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l10sm5888859pfc.125.2021.03.19.11.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 11:45:39 -0700 (PDT) Date: Fri, 19 Mar 2021 11:45:38 -0700 From: Kees Cook To: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Cc: James Morris , Jann Horn , "Serge E . Hallyn" , Al Viro , Andrew Morton , Andy Lutomirski , Anton Ivanov , Arnd Bergmann , Casey Schaufler , David Howells , Jeff Dike , Jonathan Corbet , Michael Kerrisk , Richard Weinberger , Shuah Khan , Vincent Dagonneau , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, x86@kernel.org, =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= Subject: Re: [PATCH v30 04/12] landlock: Add ptrace restrictions Message-ID: <202103191145.C8BA4DC@keescook> References: <20210316204252.427806-1-mic@digikod.net> <20210316204252.427806-5-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210316204252.427806-5-mic@digikod.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 09:42:44PM +0100, Mickaël Salaün wrote: > From: Mickaël Salaün > > Using ptrace(2) and related debug features on a target process can lead > to a privilege escalation. Indeed, ptrace(2) can be used by an attacker > to impersonate another task and to remain undetected while performing > malicious activities. Thanks to ptrace_may_access(), various part of > the kernel can check if a tracer is more privileged than a tracee. > > A landlocked process has fewer privileges than a non-landlocked process > and must then be subject to additional restrictions when manipulating > processes. To be allowed to use ptrace(2) and related syscalls on a > target process, a landlocked process must have a subset of the target > process's rules (i.e. the tracee must be in a sub-domain of the tracer). > > Cc: James Morris > Cc: Kees Cook > Signed-off-by: Mickaël Salaün Reviewed-by: Kees Cook -- Kees Cook