Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbdHLGLO (ORCPT ); Sat, 12 Aug 2017 02:11:14 -0400 Received: from mail-he1eur01on0137.outbound.protection.outlook.com ([104.47.0.137]:52128 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752408AbdHLGLJ (ORCPT ); Sat, 12 Aug 2017 02:11:09 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Date: Fri, 11 Aug 2017 23:10:49 -0700 From: Andrei Vagin To: Jann Horn Cc: Andrei Vagin , Alexander Viro , linux-fsdevel@vger.kernel.org, kernel list , Linux API , linux-arch , criu@openvz.org, Arnd Bergmann , Pavel Emelyanov , Michael Kerrisk , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH] [RFC] vm: add a syscall to map a process memory into a pipe Message-ID: <20170812061048.GA31744@outlook.office365.com> References: <20170810184616.22726-1-avagin@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [73.140.212.29] X-ClientProxiedBy: DM5PR21CA0037.namprd21.prod.outlook.com (2603:10b6:3:ed::23) To VI1PR08MB0752.eurprd08.prod.outlook.com (2a01:111:e400:5a04::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 913882df-ce82-412d-26e6-08d4e148e8ac X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR08MB0752; X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0752;3:UpHqdGI5D7XuvZG2ObM62utNxq+Bwb/tQelD6bTi3ON4rDUvT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fFT/LATAk+hb13XpezL6rzVtXCqIqB3vKPtxvFir3Vvqzuqtnsc6Yq/7NOjR2B/QOvryKWwdVmTK8Iwc3VcBQ9Avr6vFrfsIrCH6v5V75NmbYBz9MCanPtaNmpEEjSBM0/jaO2eKDcFxrygxZI2yErIvCwbwUjOKMLgr1EKxZjHVixrB9JDH9ZTy7HBju6SeqrEqTgILH172v8SE0I8jq/y7hvRLYOAPh3InqpTS7ipFnpMgMAsSVEmxaX3u49jFcy3Iktm63Kms2NVW9tWfZfttAQMgzCmR+DakHNTwpJiqCh6vKUnjcxteLFbjcRshyDu3rNiVZ7reg3F3D8Ec= X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0752;20:FdDA2N452dopE7a78QvD55WLJzNgmoqXkx5vlnidlE5E1lDl9eLlL9Ay8sqF5McifIUo67KHzQr9Hnh+GyHBEJ5ioTdET4cccA0pdddExHgvF76xrHZCFteNd1WzC7AcOkCnVMDwrNbNXtN79zgTdIuEH0xbxkMUg1qxnI/RbgDrzExnhoKZKyxUdf2xLko6lORQWzn8nG1zZCROEot1lVfIqb7pc5T+EdFQ42zu/cI+B3XQ6tGi9PQrFsXHmQxeiljuX1VzpA4JW46Jsrj15NNBy+IjJeI7ImXl3SKiWv4X3y826GLTVwWAL+yXLI0Ykl+2Em94HPSLll+9+ftgdGUkd1nWpTIG8ZPCSewDoCKwmaZcp4qblqmrsKv60NKwJKihc7jzRYtPpqgXHFpkg9ajyP4Ev385ijFkXbHHh9k= X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6041248)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR08MB0752;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR08MB0752; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0752;4:xm4BSaEjgFoAoAmka75WPJr7rN0tLVqgYXeJO7slbpMW?= =?koi8-r?Q?qKP+vH1ITWHXPNR2lWbdCqECUy2LXaY5/EQnZ9J5p2guyHkMfkc2UPrSa6cre8?= =?koi8-r?Q?BqtGulTzMKkOi/rB642byMmN+GeFwzVOekePdm5wMSOM+fMRBdY9T7kx3PegEg?= =?koi8-r?Q?0A57DXJ1DWkZET3GWZYaNQ4klLm5x9H+ApBgw7WldNJEQHFJ5Bes5X2lNBT7y6?= =?koi8-r?Q?kxqsS5Toqc9FQ5VnpqtnTfiSaPdmyf7bUKCEkrne2EbOgDcWhFL0CiV2Ss0UIR?= =?koi8-r?Q?XRifdCytARt3ZeHV/GArg9Sn1ViMeo5slok/rj701WWXZYOF4+mLWgTVdhSR3g?= =?koi8-r?Q?O/YE99krAN1yH9NSS84QsaZTBoY6woVPCx0DMswUf8rd/BI0rUX/VhbX5jHDv+?= =?koi8-r?Q?HgHvVOevUlJ1pPMu84J9NXukZ+dxtCBjIEBE21Y3lyXmBaqJesOqGbFcr3GhCe?= =?koi8-r?Q?Wf0AGPiGb5ZI3NUNKMsNraR479L6IXhX1ZFkN6FIv9PMqwNAWPRCU0ZGuW54dA?= =?koi8-r?Q?38KYPwih9xe2y7SxX48C+cjm2Hxooag7G/WX88owmwPZm3w9XA8jQlhrq0yGps?= =?koi8-r?Q?7L3XU3bsPLZKUrGE+hJfhmSncQ748LPYNVAxA1gGJ+OyGcox89IgFKQBHE9cb+?= =?koi8-r?Q?TbyO09pQ5O8QHYSzGQtKMQkvFmHkUPBXXe28AkZNioQtdfIyjrorcIlnotmf35?= =?koi8-r?Q?9ev7yS7C4a2mvfosFlHIn1wUNIGbUBsD3lk84GYOhp7sKgb8mR4oI2qf3y5/cb?= =?koi8-r?Q?YEdu6LCoYxu1ASYoYmsbIorLULZAP0BLUr6IQbTz2ojhigR4LjLRMC4dyGRMga?= =?koi8-r?Q?mwDKq62j2tDU94u++90uTmhTKWJCC4AzISZeRuV/CDNZxhODNhd9ylt8bSp2ap?= =?koi8-r?Q?Hhg2HDXU8YMmZf4TJfDmGjYd1QtHITkiPAikwU/24AIUIKoKXIWYGSvgUdnDBk?= =?koi8-r?Q?l7ZX48eAg2980xF9TSM9RhkTQXCM72y8vqG4LPz7S0VRSqZWnksZbgOdPwCzyu?= =?koi8-r?Q?I6aWNI4Ux2C5OoJCm8QkS041X3yxNiCtVBOZdV4tcePbHgILRp2vSm+TfrIgd+?= =?koi8-r?Q?2CkhuHZB3eJdHpDZ1V4ztjhAcogu1xJrpMaYLVH4cMOHljr81HqF2x05duBag2?= =?koi8-r?Q?Cv3qbK32/TxY2720oZNf4uF5YW+4NrPgFg0=3D?= X-Forefront-PRVS: 039735BC4E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6009001)(189002)(377454003)(199003)(24454002)(6666003)(53936002)(3846002)(5660300001)(110136004)(54356999)(105586002)(53416004)(47776003)(86362001)(478600001)(106356001)(6246003)(4326008)(76176999)(7350300001)(9686003)(6506006)(66066001)(1076002)(6116002)(83506001)(54906002)(55016002)(42186005)(229853002)(6916009)(2950100002)(189998001)(7736002)(69596002)(50986999)(305945005)(97736004)(33656002)(7416002)(50466002)(81166006)(101416001)(23686003)(68736007)(81156014)(2906002)(8676002)(53546010)(4001350100001)(25786009)(18370500001);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB0752;H:outlook.office365.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;VI1PR08MB0752;23:+KbRdnjgVp1XgDkdf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/2EyRhe9a5DGC8uSkFtYNhXtvGZo/i8wBSwOAusYQi6olSIc0qJtQgghg6brkNuZ92wRnmgTQUd+KPpL4Tb3e7sVUQp9eRGSX90Hx50j7tLFsummgiT1affRA5g= X-Microsoft-Exchange-Diagnostics: 1;VI1PR08MB0752;20:vUa0WEL6FUX4G4lHgDh1Oh0AcTcM+wEeOTnQm9lSPpbfDn/9dfs5taqg4zRqp/p7F0ejHmdlCbTjU/AK4ldm6PJfHcO1VfNXYTPDTl27EJno/Rw99Bf0t+a2pCt736RL1vKNpnSufcu+Q43ER8dLRTOFgE85QcZVjIk5Um44vcA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2017 06:10:59.2322 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0752 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2919 Lines: 73 On Thu, Aug 10, 2017 at 09:42:44PM +0200, Jann Horn wrote: > On Thu, Aug 10, 2017 at 8:46 PM, Andrei Vagin wrote: > > It is a hybrid of process_vm_readv() and vmsplice(). > > > > vmsplice can map memory from a current address space into a pipe. > > process_vm_readv can read memory of another process. > [...] > > +/* > > + * Map pages from a specified task into a pipe > > + */ > > +static int remote_single_vec_to_pipe(struct task_struct *task, > > + struct mm_struct *mm, > > + const struct iovec *rvec, > > + struct pipe_inode_info *pipe, > > + unsigned int flags, > > + size_t *total) > > +{ > > + struct pipe_buffer buf = { > > + .ops = &user_page_pipe_buf_ops, > > + .flags = flags > > + }; > [...] > > + while (nr_pages) { > [...] > > + /* > > + * Get the pages we're interested in. We must > > + * access remotely because task/mm might not > > + * current/current->mm > > + */ > > + down_read(&mm->mmap_sem); > > + pages = get_user_pages_remote(task, mm, pa, pages, flags, > > + process_pages, NULL, &locked); > > This fifth "flags" argument of get_user_pages_remote() should contain > GUP flags (FOLL_*), but it looks like you're actually passing in 0 or > PIPE_BUF_FLAG_GIFT, which will be interpreted as FOLL_GET? > (See the snippets quoted below.) This looks like a bug. > > Maybe use a more meaningful variable name than "flags". Good catch. I will fix and rename the variable. get_user_pages_remote has to be called with zero flags here. Thank you. > > > +static ssize_t remote_iovec_to_pipe(struct task_struct *task, > > + struct mm_struct *mm, > > + const struct iovec *rvec, > > + unsigned long riovcnt, > > + struct pipe_inode_info *pipe, > > + unsigned int flags) > > +{ > [...] > > + ret = remote_single_vec_to_pipe( > > + task, mm, &rvec[i], pipe, flags, &total); > [...] > > +} > > + > > +static long process_vmsplice_to_pipe(struct task_struct *task, > > + struct mm_struct *mm, struct file *file, > > + const struct iovec __user *uiov, > > + unsigned long nr_segs, unsigned int flags) > > +{ > [...] > > + unsigned int buf_flag = 0; > [...] > > + if (flags & SPLICE_F_GIFT) > > + buf_flag = PIPE_BUF_FLAG_GIFT; > [...] > > + if (!ret) > > + ret = remote_iovec_to_pipe(task, mm, iov, > > + nr_segs, pipe, buf_flag); > [...] > > +}