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=-9.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 16543C4361B for ; Tue, 15 Dec 2020 18:36:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3EDD22B2C for ; Tue, 15 Dec 2020 18:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730597AbgLOSfX (ORCPT ); Tue, 15 Dec 2020 13:35:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbgLOSfN (ORCPT ); Tue, 15 Dec 2020 13:35:13 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FAA2C0617A7; Tue, 15 Dec 2020 10:34:32 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id a12so20838655wrv.8; Tue, 15 Dec 2020 10:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gRgfzQaIFy0V5rFcYsUhKIb8omuCxZhK+l0NYjp69+M=; b=fxyp/k1ho0TqF4WRRGyid38pP611amsztbmr0xO4uVbWPJhyGRw+SagSATmfEkm7c2 ap1YqyLob1kvfGDvdseUTZXrqtSmpjPeIvSWXwIO0hJFhPLzn9aRWChb1UdP+fb8AzZf MWH6rD6OBw48fbElL53VeQTbO3rQBHxzpDWocOs4LYk/VVbOUSK3UaAQGSHgZ5Oi94AF e5VMVv9HKxfmbipuQPm38cbig7iH3UQv5vugxyUPJYdc4/VW5q4zBNU623/ni7dfh39M 06GVoZjYcBIVLOLfB+g3AdVreMykjjLVE1nJZSrxLsecAahLnXCRX3PHFgDA21+CuNid 43yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gRgfzQaIFy0V5rFcYsUhKIb8omuCxZhK+l0NYjp69+M=; b=UkWYf7/To0HJ88hU6R969oDYkrpgEdYp0qOtSl1/sTW0YSGrvJ7l6Fo9Xn85Z0nx0C 3tTMUIudl5WpLCNiLz+YcrJj42HcPOtFlOHpUaytrEzRnwMLNsgzkK9xEF9rVErTwru5 Col/7JP8Hq4SDkxByZdd+bK+DIqe/jlQpF0Rpln9e7pw8oAi3eqYLcdRCHRpUYVIebOR 4ZLFC4ZltcvTuqTJ3LDDp9G+j6uEgiVIg9LAV2Ev5BCaxSuCFGYnTpX7TZpIbLD3+cTt ldsgy+cLRowHlOVLGYB5INKGY/9nghSHW4B+CGClNMf0se5aK324QGV1ideTH+rAdIXa QZMA== X-Gm-Message-State: AOAM530TTtBmOjp4vkU032csuucSYBrJuMQQdl0SszVvMt76giK7WsFF IBG9cCjMPCsYaTz6rROHeqvycBWISlw= X-Google-Smtp-Source: ABdhPJzNDri79Y1YdNn5Zn0O4BXcMkAr6g05b6+csskzHpzDodIJeLQXjdiACTxmF4Awae4u90Lshg== X-Received: by 2002:a5d:5552:: with SMTP id g18mr36232138wrw.145.1608057271174; Tue, 15 Dec 2020 10:34:31 -0800 (PST) Received: from [192.168.1.143] ([170.253.51.130]) by smtp.gmail.com with ESMTPSA id z8sm38071888wmg.17.2020.12.15.10.34.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Dec 2020 10:34:30 -0800 (PST) Subject: Re: [Bug 210655] ptrace.2: documentation is incorrect about access checking threads in same thread group To: Ted Estes , Pavel Emelyanov , Oleg Nesterov , Andrew Morton , Michael Kerrisk , Kees Cook , Jann Horn Cc: linux-man , linux-kernel References: From: "Alejandro Colomar (man-pages)" Message-ID: <223477a0-0b92-3a01-46bb-c06f7d5d5901@gmail.com> Date: Tue, 15 Dec 2020 19:34:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org Hi Ted, On 12/15/20 7:31 PM, Ted Estes wrote: > Per my research on the topic, the error is in the manual page.  The > behavior of ptrace(2) was intentionally changed to prohibit attaching to > a thread in the same group.  Apparently, there were a number of > ill-behaved edge cases. > > I found this email thread on the subject: > https://lkml.org/lkml/2006/8/31/241 Thank you for all the details and links! I'll fix the page. Thanks, Alex > > Thank you. > --Ted Estes > > On 12/15/2020 11:01 AM, Alejandro Colomar (man-pages) wrote: >> Hi, >> >> There's a bug report: https://bugzilla.kernel.org/show_bug.cgi?id=210655 >> >> [[ >> Under "Ptrace access mode checking", the documentation states: >>    "1. If the calling thread and the target thread are in the same thread >> group, access is always allowed." >> >> This is incorrect. A thread may never attach to another in the same >> group. >> >> Reference, ptrace_attach() >> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/ptrace.c?h=v5.9.14#n380 >> >> ]] >> >> I just wanted to make sure that it is a bug in the manual page, and not >> in the implementation. >> >> >> Thanks, >> >> Alex >> > -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es