Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7703783yba; Thu, 2 May 2019 14:47:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdMqJwYqZUNEhuPnXxSNXWioCilTzyJoh75MOJdqMQ4AerphcsCGVil9YqvdPBE9Zy11A8 X-Received: by 2002:a63:5f42:: with SMTP id t63mr6300605pgb.275.1556833669358; Thu, 02 May 2019 14:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556833669; cv=none; d=google.com; s=arc-20160816; b=pdFMU1fVFjM1rKkT67bLiqFBC6qCsNToDRJSVCCyShRNJILl93qe2unLlhHQZROen+ m75O2pDZrECSsAbds4c/kgx5gHVnecygbJ8mqX0XELJElxfuJFxHMW3XTt0zMF1gReV1 KiB8XqENtyEIG87jwdFXOC7Fn5I+LaW3fUt8K4VHSxeNojktxcsDi/m2zOhZ+nVCTZyv NMGTxUCuJNQQjox6ut0viVubeZp2mLyMz2Gvz+QFlLg/wV57LyjbB1zNYpF+TnH6rEQq hbSa+fxDPEHK2ItAq2VYo3b7N/dimXsa8fPGg9Qqp+u0G5K4ZVFuglIO1J/TwsvA0Sdz 2nZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=S7W7UsXuybX/u7xiEaLpzHaF64Gims0rzvAjtvjprn0=; b=K+UhkzVOKSWmlbk9ls0rKgaIouwF9H4DjSRttuyfhjZkXoToB4s4Ne0FAlut7gNvb6 +gzxzC7NC6x4eWyvbRjZCSAzfQY/4PahhTp3GEYxVO5OOpNjTMKKCgkBThONib07xZpI Ka5dirzSUmnH8EU9VGa+riGss13TIhK951CObxpVJbiMbLd86TBdYlMn6/xgm04BT0Dp h07x+3ZmcvMwNS9WhIbNYabsHtkbyeSstiELoJp1mb0fFi/jB5/8z5xpcanOXhIpYs4j GIAXbSbIEDhpvw40nYO+Fl/80/OBT9lLNk5jw7e+7gDtWVx5Jsc4d4IfBKU6CdHIACEd BafQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si290775plk.421.2019.05.02.14.47.33; Thu, 02 May 2019 14:47:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbfEBVqU (ORCPT + 99 others); Thu, 2 May 2019 17:46:20 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:36310 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbfEBVqU (ORCPT ); Thu, 2 May 2019 17:46:20 -0400 Received: by mail-ot1-f67.google.com with SMTP id b18so3548944otq.3 for ; Thu, 02 May 2019 14:46:19 -0700 (PDT) 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; bh=S7W7UsXuybX/u7xiEaLpzHaF64Gims0rzvAjtvjprn0=; b=sd5a3yzYpinMVovQqG6ETpsL6/SetgBg3OJ4POw3pDle2U1lcqyMQaqWjWRSG2iCsW ukLr8CMCC29KGO+6+VvHM2xSfZPlTxKjG2FlXgwW5ZroCXHAhtu4jGfF2t2AzpqOhDi9 st2I6pFr4phfXMQ5jkZNzbZBOqIAlZ03kgHzmhVfIiduUzQtz9ZmdFRbzzvGe1u/LXeA QtLUfoQcUuzg534HTO25DkaU5CTrZCd5ylbcgu/XYIrAsoES43jQ6VT71LZOfJMLRxs9 2xXwXxa6ArFy2xcp8pyDWrdpk4UnjO6xMxKRrontfIQhyimHkH3LL3+mU5/fwUthIu9J 34kQ== X-Gm-Message-State: APjAAAWPe/Lb7NubmzM9Qn0xIx0n0ezHTtugaR7v7JeRgcdw1ILReZaW v6k4afBFHuLCS8Zeo5SyWt4Avd90wb+M0P7AmKL2+g== X-Received: by 2002:a9d:1ee2:: with SMTP id n89mr3308164otn.241.1556833579525; Thu, 02 May 2019 14:46:19 -0700 (PDT) MIME-Version: 1.0 References: <1556830342-32307-1-git-send-email-jsavitz@redhat.com> <1556830342-32307-2-git-send-email-jsavitz@redhat.com> <20190502210922.GF2488@uranus.lan> In-Reply-To: <20190502210922.GF2488@uranus.lan> From: Joel Savitz Date: Thu, 2 May 2019 17:46:08 -0400 Message-ID: Subject: Re: [PATCH v2 1/2] kernel/sys: add PR_GET_TASK_SIZE option to prctl(2) To: Cyrill Gorcunov Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Masami Hiramatsu , Waiman Long , Mauro Carvalho Chehab , Kristina Martsenko , Andrew Morton , Kees Cook , "Gustavo A. R. Silva" , YueHaibing , Micah Morton , Yang Shi , Jann Horn , Alexey Dobriyan , Rafael Aquini , Michael Kerrisk , Yury Norov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Won't be possible to use put_user here? Something like > > static int prctl_get_tasksize(unsigned long __user *uaddr) > { > return put_user(TASK_SIZE, uaddr) ? -EFAULT : 0; > } What would be the benefit of using put_user() over copy_to_user() in this context?