Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7734769yba; Thu, 2 May 2019 15:25:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw87bcGASiP8lxkx9wniB2Mzf1GreZxpi9P+dfDFkCdY9RhH0m6odcfmL3gfWzwqJbaCFpk X-Received: by 2002:a17:902:b495:: with SMTP id y21mr3427177plr.143.1556835923361; Thu, 02 May 2019 15:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556835923; cv=none; d=google.com; s=arc-20160816; b=dlcETnSCoKyca4SGxujxsD/bPfghvPjudU2wYrffLyoRAZADj8XNxAzMQ7CKLWCUq8 cn0DOCqoCECAIt8QpyJCu9c1/8tKehzFy/OMueX/Ptb0Pob2eqEnSAHfWQw7P/XaaSQv QIrJdTCJ1br9lLvA/7+GMOj+N8XaZn8XUf4FSMIJZ4evA9RX6aJUQyHUo8MYAJ9EUr2C rR+QGNv5HxRVQOPhsYSOLNe/UeMalmzRqtv1N983SIGn4HN9WaQqzfXWw2J/MtR8oJWj 5VR8IWSM1zuCoW0LxL5D4pwuLfemKau6I84SjX59/anolqLdqqVd9SC/TZKYXK5R3rAa +E+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dSYZjz9ox8eSyXuEGjTFmNM2Zdzvymu+MNwGE2bPO90=; b=hf9QazcCxvRHjPoQcchCDTUJ0O/z2BCDg3T++I8Yb+BwKrw9Q3/LXb445GNXOuyHBe kIIyHB0tNnD+/l/w4tM3UdFMRWaogvE/cB6s/wDBhix41xnNzDrIZe147uX9tQIPOARu l0XJbPUohCAySQzn+diIW9zxOUQgs4e17XOhl887ylbdiRJfgTJ1UxvTf3ip30pUXCZp kQOztRJwHntB50CmVFXcEttLDdi4Zii1+OljN454jEQhbbaqExjDcCbg1UZeeurzb60K LzAUnvZQKd9wdBnn4W3L3XnAtINED4pK4YNobeTHZ8ianDAPORLwrpYQ7jF9a/hGBux2 6ajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sl5pHk5t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12si247842pgq.390.2019.05.02.15.24.56; Thu, 02 May 2019 15:25:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Sl5pHk5t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbfEBWXZ (ORCPT + 99 others); Thu, 2 May 2019 18:23:25 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:37886 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfEBWXY (ORCPT ); Thu, 2 May 2019 18:23:24 -0400 Received: by mail-it1-f195.google.com with SMTP id r85so6222665itc.2 for ; Thu, 02 May 2019 15:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dSYZjz9ox8eSyXuEGjTFmNM2Zdzvymu+MNwGE2bPO90=; b=Sl5pHk5tbJUzK6yJj6IZ+5l6aziIB/LfUHsEAgmm+v67cmLZGve1Lh86XMKvhTB1+Z mhwLuNTlSA38rp1oUUzFlGq02ZZBPGFvZAYUUyR+KV98wIW/zDeKEhsJ/ldcJAsJ7D14 aiLcuV2fMAzbV2fIiVIx57Obqj09vweAHTXhLe+hABCLk2rpRYUSdNbKge9h57x9+ycO i5Mj3dYjkPb7QFsUVsaCAKw0NjWuImwFHO77iL4JHQq1XVUHS/1FXwZ3EKdmrRqUV9ji S33L7V7YVNpqP0CAyxKUYg4BaUNkMvleF75Aqh20f5OxVx/qANYM8diFD/5Rx8TblHR2 WiJw== 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=dSYZjz9ox8eSyXuEGjTFmNM2Zdzvymu+MNwGE2bPO90=; b=Odas1fBXiIIW7R6RdzLYAKrPGwTtzt/T4EMScDI+ovPUlQyEXYoaZlHJkgsh5sgnz7 zA/XEV0aLR28NTOw51gi/5Gmi1bk7jSLUIjQVShjCNykZViQ+jxRsmmyUy8NluiG/Ycz sjJxRd21NmAiK7TTz87AvJX71th3Bpj1n3VScmJJ6WYvVdoM2X24r7zlcUQPDqJuGQyY xV69axh/DjXBOwu5hapZ0jPS62OJXGMnUhIHyhjWG5iTN6kTq5EIDKMdTMkeT/JlGLSg 06gCMSn7wE6zbN941R/y72YNVryx85BkkdjgpkcpWObO72yDfwjtmth1uq1yvYciKngi +Q0Q== X-Gm-Message-State: APjAAAUmYptaRQeY8ONdg7r0lXzCF8tNEx4/rUQkCvhHUrGoqrI4Z1I8 BCQPbviJE7KhrkKj/4gDK6aWOP/yIxsm+2aeRtQ= X-Received: by 2002:a24:4290:: with SMTP id i138mr4291887itb.129.1556835803976; Thu, 02 May 2019 15:23:23 -0700 (PDT) MIME-Version: 1.0 References: <1556830342-32307-1-git-send-email-jsavitz@redhat.com> <1556830342-32307-3-git-send-email-jsavitz@redhat.com> In-Reply-To: <1556830342-32307-3-git-send-email-jsavitz@redhat.com> From: Yury Norov Date: Thu, 2 May 2019 15:23:12 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] prctl.2: Document the new PR_GET_TASK_SIZE option To: Joel Savitz Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Masami Hiramatsu , Waiman Long , Mauro Carvalho Chehab , Kristina Martsenko , Andrew Morton , Cyrill Gorcunov , Kees Cook , "Gustavo A. R. Silva" , YueHaibing , Micah Morton , Yang Shi , Jann Horn , Alexey Dobriyan , Rafael Aquini , Michael Kerrisk , yury.norov@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =D1=87=D1=82, 2 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 13:52, Joel Savitz <= jsavitz@redhat.com>: > > Add a short explanation of the new PR_GET_TASK_SIZE option for the benefi= t > of future generations. > > Signed-off-by: Joel Savitz > --- > man2/prctl.2 | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/man2/prctl.2 b/man2/prctl.2 > index 06d8e13c7..35a6a3919 100644 > --- a/man2/prctl.2 > +++ b/man2/prctl.2 > @@ -49,6 +49,7 @@ > .\" 2013-01-10 Kees Cook, document PR_SET_PTRACER > .\" 2012-02-04 Michael Kerrisk, document PR_{SET,GET}_CHILD_SUBREAPER > .\" 2014-11-10 Dave Hansen, document PR_MPX_{EN,DIS}ABLE_MANAGEMENT > +.\" 2019-05-02 Joel Savitz, document PR_GET_TASK_SIZE > .\" > .\" > .TH PRCTL 2 2019-03-06 "Linux" "Linux Programmer's Manual" > @@ -1375,6 +1376,14 @@ system call on Tru64). > for information on versions and architectures) > Return unaligned access control bits, in the location pointed to by > .IR "(unsigned int\ *) arg2" . > +.TP > +.B PR_GET_TASK_SIZE > +Copy the value of TASK_SIZE to the userspace address in > +.IR "(unsigned long\ *) arg2" . This is a bad idea to use pointers to size-undefined types in interface bec= ause that way you have to introduce compat versions of interface functions. I'd recommend you to use u64 or unsigned long long here. The comment not clear for reader not familiar with kernel internals. Can you rephrase TASK_SIZE like 'the (next after) highest possible userspace address', or similar? For the updated version could you please CC to yury.norov@gmail.com? > +Return > +.B EFAULT > +if this operation fails. > + > .SH RETURN VALUE > On success, > .BR PR_GET_DUMPABLE , > -- > 2.18.1 >