Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp291377yba; Fri, 3 May 2019 01:48:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyflmvBnGf3u7ogyUbBwmkYa9aAp4xBUSZwmaKIyaZyXyNYlnE/v4K/cKfQuWbHWl6nnDI3 X-Received: by 2002:a62:479b:: with SMTP id p27mr9522161pfi.111.1556873292028; Fri, 03 May 2019 01:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556873292; cv=none; d=google.com; s=arc-20160816; b=IJXkVaFDKwG1Rpw1BPKTofG99QmCUCYWmwZru8l4F0z23XSOfnDd0tt7W0yDpdaHwj IP+ZXDT+gb/mmbbj4m7F0TSbMHJ9BJlAz9uArJaS9eGP7vyGipPrvYpnWUucC+JglOwi i/UxI96SDXXj4ciuoRv1iogxUUeXkTAgIOqNgukqaVbJTkEsNF11tbvaPKqdifKk/flN CA0puzZRTVeu7NkQjwBUpw/9S8s0O+SqKfy7fKikIM/jsE/8zCE1Ea8Ap390rtM7wsRW yngIkJ1OH2Lkv9/EZ9BVpqVcxTtGrNBsDH6P7sf+w8UzJmhUdK53rAkDb8VDuOGXwMa9 h9GQ== 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=k2ylaX4prU4y+pJMH/9/AjUxzWLSop/aCDuaVRH32I0=; b=DVefYMaCPBchysATleRsahkITH7SIOrRCJxhZbnsDol/9OqFICuFPJaBM/KaQE2qwb 9M0qp3CwaqPesBUra13897dTiFuDLVBISKBCU64Qcx5mWO9IiYeZZ4U4qcIfwStHV2eh fKAsMSBlr8Is/SSoAttWuut91GKG5CM8De0wQrQwIVNyAR/hW8lA8s/mUOlTIkljYydx JN4Kl74D1pRoyBSwm/3OJt5+kt/co6Kv5LxwDQJ/TDbWtH8i9U8e4ngQ3gyQKPiw4snz LFLEqgJhZ0w9iNxIzEFCnxehz3WtAROC3y/8BXUt+TkR8/Qa1VOlJ0n8hRfagkQG8xwY jReA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fenSNmyA; 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 s12si1496738pgo.380.2019.05.03.01.47.56; Fri, 03 May 2019 01:48:12 -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=fenSNmyA; 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 S1726542AbfECIbx (ORCPT + 99 others); Fri, 3 May 2019 04:31:53 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44251 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbfECIbw (ORCPT ); Fri, 3 May 2019 04:31:52 -0400 Received: by mail-lf1-f67.google.com with SMTP id n134so2020776lfn.11 for ; Fri, 03 May 2019 01:31:51 -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=k2ylaX4prU4y+pJMH/9/AjUxzWLSop/aCDuaVRH32I0=; b=fenSNmyAj8ADxOqyLIXpSSgKSa18U27vLWgPFOcTBPX3r1oVH/L5+X7iKMGOav5uC7 L7bNwKgzA8UuBq2OxXMFqWzjntIcIRlUgwx4iTgUVD2S9JbOyQlnwO06rXTW95YWvJGl j3xNn+GCJReS8E1zTpEzk+gOjOUjTHsjJal/KK8+doqYfnBNAF9LG7UtGIq+NHK+e1SR 9V/k0feRtMS6QhkvHmFjSydmOg6TYZ0XFkAqZ7ZDXt7TcX5hM3kXuWUTZekjyBzK4E4D 0N3J6vwqXCQAWdlssO5SLt3FhAvt7j6kJlBy3oynVH/CFt04n+ncij+gVW/iwrpUqUFv ydaw== 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=k2ylaX4prU4y+pJMH/9/AjUxzWLSop/aCDuaVRH32I0=; b=RYz9zq+cL5AF83G/ZnGqNPoi/pPV7/MS/GkYvq66um8wYRE1YGrsmyi0iXA7MHrVee 8gzNVOWnbA/gMPZl9XYOEVliQcV5VVofz+BCcEk3Lhztv/eix4z1XwtwUPdC2wcKSSzW SM/y7oOEmIVL5Mgr9z6pi4irHpd3p7zajW0LlvS/95T51LNCFDsfOPf/QFWgqQnLbVRQ SsZbJbMkzgjsesSkrHfoLOsUdFO/ENBViIKgX7TTRCzxH7dTlXYANXNsf5pWpMW7kkqn NEhbNth3RGFHLs6cZ3pcqd/gbTZBtUj6a4yP1KLvFXRB6amACjbDyNp+o9uIab84enJW 8x5w== X-Gm-Message-State: APjAAAVRC2C1rv7Ll4jFOUr70GTaUeQ7DqY5D10elJMJW18EV6Z4GVwF ghYfWHQkuIoQZoKCam/Q7S8= X-Received: by 2002:ac2:50ca:: with SMTP id h10mr4468043lfm.31.1556872310606; Fri, 03 May 2019 01:31:50 -0700 (PDT) Received: from uranus.localdomain ([5.18.103.226]) by smtp.gmail.com with ESMTPSA id v23sm270042ljk.14.2019.05.03.01.31.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 01:31:49 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 530F04603F4; Fri, 3 May 2019 11:31:49 +0300 (MSK) Date: Fri, 3 May 2019 11:31:49 +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: <20190503083149.GH2488@uranus.lan> References: <1556830342-32307-1-git-send-email-jsavitz@redhat.com> <1556830342-32307-2-git-send-email-jsavitz@redhat.com> <20190502210922.GF2488@uranus.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 05:46:08PM -0400, Joel Savitz wrote: > > 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? It is a common pattern to use put_user with native types, where copy_to_user more biased for composed types transfer.