Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7674791yba; Thu, 2 May 2019 14:12:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPnET0guUh16FGP0m69t0gHZy2g3MyB/Cgg5VTdWqZbO280ENlavs1Sbhr3ccJE38+PBr1 X-Received: by 2002:a17:902:9048:: with SMTP id w8mr5999076plz.195.1556831524741; Thu, 02 May 2019 14:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556831524; cv=none; d=google.com; s=arc-20160816; b=FfL9BUU6ClCVcdPASot5tsMlyVNXQ1RoMCAJUGygK060WmN/1Yz4FyGhDt1TgFBqiT oEryO5IoBd1+D44NwQoSSs1F8wbathz8y+m252i9s54Q5pIAHn0+csBGXOa3G8tMybWI uffsuofd2em8PsvUk2RWWQAUAyZQ31Rz3ZTfTtckS5XlK+w2OW/vR8CoLzb4/ri0AV+1 bSbuDg4v91w+45BIlzobQhKIt+fJpgJ3i7151HfdXh4zFWRabsFGQR4MwGNRgUg2i0OT LLeDYNQsvrPWEPhW7TPOL7npAKi1L7aOYXS2bIwkVeSNeCzY1hbnT68+Pw28DKIlEdcX l87A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fQeF4YFfp+NAQvbsEuYp4YnBN8ZOfcDR5taD1BAPMsw=; b=nqQrMNLvMjTopo3l3zGN2Vm2zwm5MwGHHhyo1iDzWjHnvfTMW2aOjO2Fo7aibary10 jBMjp33nn4YMkQ+41Or2I/wKKT7xm48py5AJsm2z9FrBFGiKQ/tubRcLaZzVN/uyOWFy w9Y/PdddKsObTUn/MH5NBgndo0ohLnGcrNrIIWHgv5hn1UaejYVC3WDeqk4YdqQ/DSDz PvddTURsYuM06W75vhZ/1GuSwVHQyp8Z6DGqaY2vf5A2Mon26egEpTU3kBKF+1TGVsII qeBt1AoJKYCPkCkKWELVEN7ERSZbaypW7lZmQGBQKWQdJAXRWaAITewlOgQEjbRAUd0a FViA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BfJa+OfF; 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 2si229199plc.371.2019.05.02.14.11.49; Thu, 02 May 2019 14:12:04 -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=BfJa+OfF; 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 S1726366AbfEBVJ0 (ORCPT + 99 others); Thu, 2 May 2019 17:09:26 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:40762 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbfEBVJZ (ORCPT ); Thu, 2 May 2019 17:09:25 -0400 Received: by mail-lj1-f195.google.com with SMTP id d15so3513047ljc.7 for ; Thu, 02 May 2019 14:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fQeF4YFfp+NAQvbsEuYp4YnBN8ZOfcDR5taD1BAPMsw=; b=BfJa+OfFnBf4up8Si8/XdPDnmJV270NIwn9A1p2Aazn7CLm4/wAGLVar908BlZlkyc HvfY6SgZ5nVLBpLLQV2L5azfC1ULRJzbuT8p00iLq+SXsmBnD9SfwO+3V89vOHtSvvz8 DFM5i15S/dWmqpllfl75ttnYdW3RCjAGjhqwFB18d/61bKztGvfahSne/0eJWFeH+SVD T9AxRKyA7CvRbgMSV+1Y3PF86jnTocDoh1OxjlBz40ApZk1ry2pnwKLQKOOeGcLzko2K 1hFpWIVTQ7dMGuaF0WCFcLm9tYGjlRVjyFL2n0FtZItXA8h+6PaGe5sHiGtuvSmUrgLx qxow== 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:in-reply-to:user-agent; bh=fQeF4YFfp+NAQvbsEuYp4YnBN8ZOfcDR5taD1BAPMsw=; b=RmC8lH2bS7FKQ/Wxx5u8nUOhFKMQbr3vq/3ZplWzEL+CcBZ81SWbwpAMLqoTKzn2c+ vKIjSACIeT7UClnM7jpxVDvJaqePz9DHCj9Yvfk3g3rLCMxoHkth3aflo9egR2UTn7LS Q2wRq7wkD2OpqqE6SqIVeTppFVb5wpMPcPAlP5B2h0XwgnONB96Pafm0ZgnEPxG8K+iH Wx8T8U2Mj+pHl6ykXG4vo+Ff06KSVuUy7WERXVvYIO+Y7QLMvuBcOHrMBXDMIeZs3ckg 8cWBCJQyb+dpWyapq+PwvwgSqzeerVYveghRQcpSVhwKzC7BmGUM/cnIB0JLOCk9xcPO lPHw== X-Gm-Message-State: APjAAAVYVNRTE4bJHnTwP5sK1910N76PGSxZmDc3YihLgOBxuPdc1rGL 9iUQ6KAQpQgoxqYsPDkoSpM= X-Received: by 2002:a2e:7f13:: with SMTP id a19mr3116056ljd.35.1556831363181; Thu, 02 May 2019 14:09:23 -0700 (PDT) Received: from uranus.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id b28sm38600lfc.7.2019.05.02.14.09.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 14:09:22 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 248204603CA; Fri, 3 May 2019 00:09:22 +0300 (MSK) Date: Fri, 3 May 2019 00:09:22 +0300 From: Cyrill Gorcunov To: Joel Savitz 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 Subject: Re: [PATCH v2 1/2] kernel/sys: add PR_GET_TASK_SIZE option to prctl(2) Message-ID: <20190502210922.GF2488@uranus.lan> References: <1556830342-32307-1-git-send-email-jsavitz@redhat.com> <1556830342-32307-2-git-send-email-jsavitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1556830342-32307-2-git-send-email-jsavitz@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 02, 2019 at 04:52:21PM -0400, Joel Savitz wrote: > > +static int prctl_get_tasksize(void __user * uaddr) > +{ > + unsigned long task_size = TASK_SIZE; > + return copy_to_user(uaddr, &task_size, sizeof(unsigned long)) > + ? -EFAULT : 0; > +} 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; }