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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=no 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 C3E5CC388F7 for ; Thu, 29 Oct 2020 01:07:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F95420791 for ; Thu, 29 Oct 2020 01:07:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="CQS/TTCS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404161AbgJ2BHJ (ORCPT ); Wed, 28 Oct 2020 21:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404159AbgJ2BGg (ORCPT ); Wed, 28 Oct 2020 21:06:36 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9988DC0613D4 for ; Wed, 28 Oct 2020 18:06:35 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id a7so1165246lfk.9 for ; Wed, 28 Oct 2020 18:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pn1ECaKgjWXcAj9IGY9xa/P/urhrG9XYha2Ze81haPI=; b=CQS/TTCSV/PXnE8RKTiVdoB9MOH5R7RwtttysBDMDTrgm/gdARB43BDZ0IDwXRbttP ztHZD+0ZqXCLCfwhTBFjTJ/tiDFdE5MfzqiqiGCR+7qo4iT6gbpszW4gnmqQCqcjiJpS 2TE6AWWOiPiIHtCacy+jotlH1GyWUK1IMX8yXc8Mz7No8vs/C8JnIaRhweaK8oe5/GL8 Jfgwtgs4gp/wo+Iw7O3nmUyVGt/oQ9DoZH/ghQZ47kjp3G1BZkOXJfz4E7+ioxLBPKqf wNABOnStf+0wcuigg1mHsL0KxMLpB2iVoTZoknuLmehB39wLMOwYtSz1o0w4ntAQ9dSd hmXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pn1ECaKgjWXcAj9IGY9xa/P/urhrG9XYha2Ze81haPI=; b=ccCqAWOQNIxQ1LVImc2PHY5HSRESOq2hDk1IAECfJFKA7z6NmF9EugqtVzTLMYGUgl wUr7ZeJgsYsCzIog/8W2xaVoLnvVEKg7/DItvcvbw3qzBG0FiNRZFPL/EPamh+N6dhov Y6Smbg+IaEb1Umge2XxJ//2rY7zu0tFdKDC3Dp9CcIibFb5lOqEeKs2UpzDrBZKPnREP 2cgi83QblYOtWuq/sJrS3qw2ztATT11l45Bml5oYiLXsasvUN0ap9l3LTzOjbWjeXS00 Or3WSX1fYZLHyVH2SYlEfyx9wCh0mwIArGu4do25Lzuy4KE+nu0XHw88r93OF1HoLFbF y3Aw== X-Gm-Message-State: AOAM531ZaSr+di+XNbDQ8IVIgzacxWIn+V7aJtI5yVH/yRwwTWzVXokf 77KKnEjGiT6/mDZdf27OkE0bJVJdRI+axF2fMywxeg== X-Google-Smtp-Source: ABdhPJxixA+XOTBfZ3BYWY3Zb24muHdDJFJXA6IB2XijLR/mZHkSGkBIOx58SM+pLP1LMZ2g2O7vRP785516kejacuI= X-Received: by 2002:a19:e308:: with SMTP id a8mr562788lfh.573.1603933593718; Wed, 28 Oct 2020 18:06:33 -0700 (PDT) MIME-Version: 1.0 References: <20201027200358.557003-1-mic@digikod.net> <20201027200358.557003-5-mic@digikod.net> In-Reply-To: <20201027200358.557003-5-mic@digikod.net> From: Jann Horn Date: Thu, 29 Oct 2020 02:06:06 +0100 Message-ID: Subject: Re: [PATCH v22 04/12] landlock: Add ptrace restrictions To: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Cc: James Morris , "Serge E . Hallyn" , Al Viro , Andy Lutomirski , Anton Ivanov , Arnd Bergmann , Casey Schaufler , Jeff Dike , Jonathan Corbet , Kees Cook , Michael Kerrisk , Richard Weinberger , Shuah Khan , Vincent Dagonneau , Kernel Hardening , Linux API , linux-arch , "open list:DOCUMENTATION" , linux-fsdevel , kernel list , "open list:KERNEL SELFTEST FRAMEWORK" , linux-security-module , "the arch/x86 maintainers" , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: On Tue, Oct 27, 2020 at 9:04 PM Micka=C3=ABl Sala=C3=BCn = wrote: > 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: Jann Horn > Cc: Kees Cook > Cc: Serge E. Hallyn > Signed-off-by: Micka=C3=ABl Sala=C3=BCn Reviewed-by: Jann Horn