[{"id":1789933,"web_url":"http://patchwork.ozlabs.org/comment/1789933/","msgid":"<20171019065732.670b426a@MiWiFi-R3-srv>","date":"2017-10-18T19:57:32","subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","submitter":{"id":9347,"url":"http://patchwork.ozlabs.org/api/people/9347/","name":"Balbir Singh","email":"bsingharora@gmail.com"},"content":"On Fri,  8 Sep 2017 15:45:06 -0700\nRam Pai <linuxram@us.ibm.com> wrote:\n\n> Make sure that the kernel does not access user pages without\n> checking their key-protection.\n>\n\nWhy? This makes the routines AMR/thread specific? Looks like\nx86 does this as well, but these routines are used by GUP from\nthe kernel.\n\nBalbir Singh.","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yHNDm66Ckz9t48\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 19 Oct 2017 06:59:20 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3yHNDm4JYNzDqBH\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 19 Oct 2017 06:59:20 +1100 (AEDT)","from mail-pg0-x244.google.com (mail-pg0-x244.google.com\n\t[IPv6:2607:f8b0:400e:c05::244])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3yHNBy31qtzDq5W\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 19 Oct 2017 06:57:46 +1100 (AEDT)","by mail-pg0-x244.google.com with SMTP id g6so5135052pgn.6\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 18 Oct 2017 12:57:46 -0700 (PDT)","from MiWiFi-R3-srv (14-202-194-140.static.tpgi.com.au.\n\t[14.202.194.140]) by smtp.gmail.com with ESMTPSA id\n\tp90sm23779755pfj.157.2017.10.18.12.57.38\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 18 Oct 2017 12:57:43 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"dbMlP7Nn\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"dbMlP7Nn\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c05::244; helo=mail-pg0-x244.google.com;\n\tenvelope-from=bsingharora@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"dbMlP7Nn\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=jP8Sue7ED1XBML4U1OYI+/QxZ20yLpc04zlt2b6z35Q=;\n\tb=dbMlP7NnwLa47lre4DyZR0WV+PX9+Ow1uLvWceEAGMOMPtudlR5mdqDhi6I1Jxb02E\n\t/nwqMdcEZ+5EfJthBibCR2cKin/m7U4NCrvRlHgXa6KRWQGSxCnpK8EJGgEBoY33Lb9C\n\tkLcg7iFpaKdGqFtXegAsgYJBFhSUg4D/1cXn3NdAQrZIVI7wIqqWPZvANlzVMtcKIEGm\n\tkZXVPkQVo6+qxOILQ6m0wlg5Q4hpBGjT+ukwhHvwRtLCG2Mv1soAW9IQdoDDmDiB6JAY\n\te21ZQuXsnA99fhtKyQQfdY140tCR53UfJLpM5uXpvog2rXSggA+D4o+T83nCxLfbhyJV\n\ttItQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=jP8Sue7ED1XBML4U1OYI+/QxZ20yLpc04zlt2b6z35Q=;\n\tb=gRUekk0LXCieA1idbMOxKVfEps5lwJKKJbDXCFUC+CoaoOg9g7WTHV3VIoRyJtgzlp\n\tvMsMFaGVCWHVc1w6DErV3ZQHum5pBaMYbCsAYDZqN9JL0oyH88/IIbk8U4K+e6Kykj84\n\tY4QHnc04ASouolUMvcDSS1KTVwgNS929MXSVnXsyKZiTdOjrw8j5G5sy9RQ4CvHSHHZk\n\tWbABF+CU3sZ/PdVOBDYFrjf/DtDFN47JFokBzEXTlIhAvNPc+APIzwB8H5b9ajtwEFXu\n\ttyK2CDoVd+pvniDxcnlAJ8CziDtVBxjji5lcmsFo3LGox15onH+j3Hng+y72FuDDCWK2\n\toZ0g==","X-Gm-Message-State":"AMCzsaXhLc+5QmXjcLpAh1U4JFv/hDseqf4kDsbIYoBxLewMUg3pewh2\n\tXvvZjPIkmZGYHCUnhlpzGGk1CjB3kWo=","X-Google-Smtp-Source":"ABhQp+Sa8QcQHzHoTFio/BpaiFDTq3tRiR+xRdntkjHVhIWqeHIKlR0qTYasvEgIg2Qlu4UV3JYOfQ==","X-Received":"by 10.84.218.68 with SMTP id f4mr3453193plm.395.1508356663793;\n\tWed, 18 Oct 2017 12:57:43 -0700 (PDT)","Date":"Thu, 19 Oct 2017 06:57:32 +1100","From":"Balbir Singh <bsingharora@gmail.com>","To":"Ram Pai <linuxram@us.ibm.com>","Subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","Message-ID":"<20171019065732.670b426a@MiWiFi-R3-srv>","In-Reply-To":"<1504910713-7094-27-git-send-email-linuxram@us.ibm.com>","References":"<1504910713-7094-1-git-send-email-linuxram@us.ibm.com>\n\t<1504910713-7094-27-git-send-email-linuxram@us.ibm.com>","X-Mailer":"Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"ebiederm@xmission.com, mhocko@kernel.org, paulus@samba.org,\n\taneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1789983,"web_url":"http://patchwork.ozlabs.org/comment/1789983/","msgid":"<20171018212924.GL5617@ram.oc3035372033.ibm.com>","date":"2017-10-18T21:29:24","subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","submitter":{"id":2667,"url":"http://patchwork.ozlabs.org/api/people/2667/","name":"Ram Pai","email":"linuxram@us.ibm.com"},"content":"On Thu, Oct 19, 2017 at 06:57:32AM +1100, Balbir Singh wrote:\n> On Fri,  8 Sep 2017 15:45:06 -0700\n> Ram Pai <linuxram@us.ibm.com> wrote:\n> \n> > Make sure that the kernel does not access user pages without\n> > checking their key-protection.\n> >\n> \n> Why? This makes the routines AMR/thread specific? Looks like\n> x86 does this as well\n\nYes. the memkey semantics implemented by x86, assumes that the keys and\ntheir access-permission are per thread.  In other words, a key which is\nenabled in the context of one thread, will not be enabled in the context\nof another thread.\n\n> but these routines are used by GUP from\n> the kernel.\n\nSee a problem?\n\nRP","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yHQG51cXTz9t7D\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 19 Oct 2017 08:30:37 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3yHQG50MKdzDqXj\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 19 Oct 2017 08:30:37 +1100 (AEDT)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3yHQDt6HgmzDqT0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 19 Oct 2017 08:29:34 +1100 (AEDT)","from pps.filterd (m0098419.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv9ILTEv1127615\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 18 Oct 2017 17:29:32 -0400","from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2dpc478wv8-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 18 Oct 2017 17:29:31 -0400","from localhost\n\tby e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <linuxram@us.ibm.com>;\n\tWed, 18 Oct 2017 17:29:31 -0400","from b01cxnp22036.gho.pok.ibm.com (9.57.198.26)\n\tby e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 18 Oct 2017 17:29:28 -0400","from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com\n\t[9.57.199.106])\n\tby b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v9ILTRqP49152094; Wed, 18 Oct 2017 21:29:27 GMT","from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id DD6552803A;\n\tWed, 18 Oct 2017 17:29:20 -0400 (EDT)","from ram.oc3035372033.ibm.com (unknown [9.85.176.245])\n\tby b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS id AEFCD2803E;\n\tWed, 18 Oct 2017 17:29:19 -0400 (EDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=us.ibm.com\n\t(client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=linuxram@us.ibm.com; receiver=<UNKNOWN>)","Date":"Wed, 18 Oct 2017 14:29:24 -0700","From":"Ram Pai <linuxram@us.ibm.com>","To":"Balbir Singh <bsingharora@gmail.com>","Subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","References":"<1504910713-7094-1-git-send-email-linuxram@us.ibm.com>\n\t<1504910713-7094-27-git-send-email-linuxram@us.ibm.com>\n\t<20171019065732.670b426a@MiWiFi-R3-srv>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20171019065732.670b426a@MiWiFi-R3-srv>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-TM-AS-GCONF":"00","x-cbid":"17101821-0040-0000-0000-000003B4B3B6","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007916; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000237; SDB=6.00933072; UDB=6.00469939;\n\tIPR=6.00713362; \n\tBA=6.00005648; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017597;\n\tXFM=3.00000015; UTC=2017-10-18 21:29:30","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17101821-0041-0000-0000-000007A9BB27","Message-Id":"<20171018212924.GL5617@ram.oc3035372033.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-10-18_08:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1710180298","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Reply-To":"Ram Pai <linuxram@us.ibm.com>","Cc":"ebiederm@xmission.com, mhocko@kernel.org, paulus@samba.org,\n\taneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1790033,"web_url":"http://patchwork.ozlabs.org/comment/1790033/","msgid":"<20171019100857.5e79570e@MiWiFi-R3-srv>","date":"2017-10-18T23:08:57","subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","submitter":{"id":9347,"url":"http://patchwork.ozlabs.org/api/people/9347/","name":"Balbir Singh","email":"bsingharora@gmail.com"},"content":"On Wed, 18 Oct 2017 14:29:24 -0700\nRam Pai <linuxram@us.ibm.com> wrote:\n\n> On Thu, Oct 19, 2017 at 06:57:32AM +1100, Balbir Singh wrote:\n> > On Fri,  8 Sep 2017 15:45:06 -0700\n> > Ram Pai <linuxram@us.ibm.com> wrote:\n> >   \n> > > Make sure that the kernel does not access user pages without\n> > > checking their key-protection.\n> > >  \n> > \n> > Why? This makes the routines AMR/thread specific? Looks like\n> > x86 does this as well  \n> \n> Yes. the memkey semantics implemented by x86, assumes that the keys and\n> their access-permission are per thread.  In other words, a key which is\n> enabled in the context of one thread, will not be enabled in the context\n> of another thread.\n> \n> > but these routines are used by GUP from\n> > the kernel.  \n> \n> See a problem?\n>\n\nNo, I don't understand why gup (called from driver context, probably) should\nworry about permissions and keys?\n\nBalbir Singh.","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yHSTY3wHqz9t4P\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 19 Oct 2017 10:10:41 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3yHSTY2YHRzDqNh\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 19 Oct 2017 10:10:41 +1100 (AEDT)","from mail-pf0-x241.google.com (mail-pf0-x241.google.com\n\t[IPv6:2607:f8b0:400e:c00::241])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3yHSRn0w88zDq5x\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 19 Oct 2017 10:09:08 +1100 (AEDT)","by mail-pf0-x241.google.com with SMTP id b6so5066997pfh.7\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 18 Oct 2017 16:09:08 -0700 (PDT)","from MiWiFi-R3-srv ([122.99.82.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tz73sm22190862pgz.46.2017.10.18.16.09.03\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 18 Oct 2017 16:09:06 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"HqR49xwF\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"HqR49xwF\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c00::241; helo=mail-pf0-x241.google.com;\n\tenvelope-from=bsingharora@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"HqR49xwF\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=QXs/vYtZdCcYjsGND9NUsBYNqPLu45KzDpHDEfBxDjI=;\n\tb=HqR49xwFhKj4A74hM88URNWHA9DYOxPaA+U6kmMT6F80nhMOl+UG5l37sT4h2FEqvm\n\tqaBBFAaQKjk5ISNmbdXpwfqHQqmv5U5DTgB+g6+AEdBOYrFcTEPHJUlamFb6g0HxIu4g\n\thdgOaZIs/UCMHtUMSXLqe2ZpRPzvVZ0Zl1Azlk91ZaSmbBALimbcnXN9HXQKz0zdo7tZ\n\tFNtSNFGkRLCfgewOMzcaPV4ruEZaFrbAyhAQQ0b2sxkshLH1GI7b8HXMPN7kDvP6ZwCQ\n\t5TlipibKd0wy4ZHlUA4R2IaglGXTF+IMkFh2v3B+WXLeUnO3tFWh1rZ5gLQg4APmD04o\n\ttCQw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=QXs/vYtZdCcYjsGND9NUsBYNqPLu45KzDpHDEfBxDjI=;\n\tb=NiA3PPGUJuQa7c2JI/LZXJvpz00fvU/XGXJvST+iN3riYZ01hWIVeyg3CXTPD/lwWB\n\tEDw5NuvlWAG2K6dtgEldNe7yGP8Oya4e90eS2LtoD1FyManXbJZUbVuXm5WC07+1ae+L\n\tnvSfgu1AFI//170IalJDbPSkIKEURXnGIuvYa06BaP4UUs9XeWaIk/nSWWbmdSZDD96f\n\tXcC+5wNX/yIcImtPnjP+YCfkvAGqAZS0u37P6ihDobC0pM8fHtYPTRj3xQhx5UedRrS+\n\tkSLkYAWi9rItO7IYKSgRZb6EjhIb5w7z2SLLGFGviHiab504wsH70AURR63leatyRKC+\n\tTS1w==","X-Gm-Message-State":"AMCzsaWsUfLP5gbQydIVKKdbjCwuzFvRny5uwa9pxQvp6NHRzINnbjWT\n\tMUx5jrt20pK2AkLQ4SSNhZ8=","X-Google-Smtp-Source":"ABhQp+TioQLHMsUvTpTgHt7j6vpxxnWG6jRlSz69za1cefIdsLl9WwO1YJ3t2bk0tb212qcr2Ng5FA==","X-Received":"by 10.98.194.16 with SMTP id l16mr12603619pfg.139.1508368147004; \n\tWed, 18 Oct 2017 16:09:07 -0700 (PDT)","Date":"Thu, 19 Oct 2017 10:08:57 +1100","From":"Balbir Singh <bsingharora@gmail.com>","To":"Ram Pai <linuxram@us.ibm.com>","Subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","Message-ID":"<20171019100857.5e79570e@MiWiFi-R3-srv>","In-Reply-To":"<20171018212924.GL5617@ram.oc3035372033.ibm.com>","References":"<1504910713-7094-1-git-send-email-linuxram@us.ibm.com>\n\t<1504910713-7094-27-git-send-email-linuxram@us.ibm.com>\n\t<20171019065732.670b426a@MiWiFi-R3-srv>\n\t<20171018212924.GL5617@ram.oc3035372033.ibm.com>","X-Mailer":"Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"ebiederm@xmission.com, mhocko@kernel.org, paulus@samba.org,\n\taneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1790761,"web_url":"http://patchwork.ozlabs.org/comment/1790761/","msgid":"<20171019164633.GT5617@ram.oc3035372033.ibm.com>","date":"2017-10-19T16:46:33","subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","submitter":{"id":2667,"url":"http://patchwork.ozlabs.org/api/people/2667/","name":"Ram Pai","email":"linuxram@us.ibm.com"},"content":"On Thu, Oct 19, 2017 at 10:08:57AM +1100, Balbir Singh wrote:\n> On Wed, 18 Oct 2017 14:29:24 -0700\n> Ram Pai <linuxram@us.ibm.com> wrote:\n> \n> > On Thu, Oct 19, 2017 at 06:57:32AM +1100, Balbir Singh wrote:\n> > > On Fri,  8 Sep 2017 15:45:06 -0700\n> > > Ram Pai <linuxram@us.ibm.com> wrote:\n> > >   \n> > > > Make sure that the kernel does not access user pages without\n> > > > checking their key-protection.\n> > > >  \n> > > \n> > > Why? This makes the routines AMR/thread specific? Looks like\n> > > x86 does this as well  \n> > \n> > Yes. the memkey semantics implemented by x86, assumes that the keys and\n> > their access-permission are per thread.  In other words, a key which is\n> > enabled in the context of one thread, will not be enabled in the context\n> > of another thread.\n> > \n> > > but these routines are used by GUP from\n> > > the kernel.  \n> > \n> > See a problem?\n> >\n> \n> No, I don't understand why gup (called from driver context, probably) should\n> worry about permissions and keys?\n\nThere are some user level features; eg: pipe,  where the userspace\ndonates one of its pages to the kernel, to buffer the pipe stream.\n\nBut if the donated page has a non-permissive key associated, the\nkernel should reject and return failure. Access to a page\nassociated with a non-permissive key should fail regardless of who\naccesses the page (userspace, or kernel on userspace's behalf).\n\nThat is the reason we tap into the GUP routines to validate such\naccess.\n\nRP","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yHvxf4N2Kz9s72\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 20 Oct 2017 03:48:06 +1100 (AEDT)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3yHvxf2wQBzDqNh\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 20 Oct 2017 03:48:06 +1100 (AEDT)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3yHvw3480mzDqBd\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 20 Oct 2017 03:46:43 +1100 (AEDT)","from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv9JGkdJE122248\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 19 Oct 2017 12:46:41 -0400","from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2dpvu3nuak-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 19 Oct 2017 12:46:41 -0400","from localhost\n\tby e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <linuxram@us.ibm.com>;\n\tThu, 19 Oct 2017 12:46:40 -0400","from b01cxnp22035.gho.pok.ibm.com (9.57.198.25)\n\tby e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 19 Oct 2017 12:46:37 -0400","from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com\n\t[9.57.199.110])\n\tby b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v9JGkbMB50397262; Thu, 19 Oct 2017 16:46:37 GMT","from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 8C08CAE043;\n\tThu, 19 Oct 2017 12:47:18 -0400 (EDT)","from ram.oc3035372033.ibm.com (unknown [9.85.176.245])\n\tby b01ledav005.gho.pok.ibm.com (Postfix) with ESMTPS id 62CB6AE03C;\n\tThu, 19 Oct 2017 12:47:17 -0400 (EDT)"],"Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=us.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=linuxram@us.ibm.com; receiver=<UNKNOWN>)","Date":"Thu, 19 Oct 2017 09:46:33 -0700","From":"Ram Pai <linuxram@us.ibm.com>","To":"Balbir Singh <bsingharora@gmail.com>","Subject":"Re: [PATCH 18/25] powerpc: check key protection for user page access","References":"<1504910713-7094-1-git-send-email-linuxram@us.ibm.com>\n\t<1504910713-7094-27-git-send-email-linuxram@us.ibm.com>\n\t<20171019065732.670b426a@MiWiFi-R3-srv>\n\t<20171018212924.GL5617@ram.oc3035372033.ibm.com>\n\t<20171019100857.5e79570e@MiWiFi-R3-srv>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20171019100857.5e79570e@MiWiFi-R3-srv>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-TM-AS-GCONF":"00","x-cbid":"17101916-0036-0000-0000-0000027E5445","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007919; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000238; SDB=6.00933455; UDB=6.00470169;\n\tIPR=6.00713743; \n\tBA=6.00005651; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017609;\n\tXFM=3.00000015; UTC=2017-10-19 16:46:39","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17101916-0037-0000-0000-000042210939","Message-Id":"<20171019164633.GT5617@ram.oc3035372033.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-10-19_08:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1710190231","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Reply-To":"Ram Pai <linuxram@us.ibm.com>","Cc":"ebiederm@xmission.com, mhocko@kernel.org, paulus@samba.org,\n\taneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com,\n\tlinuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]