Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/818317/?format=api
{ "id": 818317, "url": "http://patchwork.ozlabs.org/api/patches/818317/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/e4b6fcaa267628f7ef8fdbe60f05ec8d4d60b3be.1506089472.git.khalid.aziz@oracle.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<e4b6fcaa267628f7ef8fdbe60f05ec8d4d60b3be.1506089472.git.khalid.aziz@oracle.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/e4b6fcaa267628f7ef8fdbe60f05ec8d4d60b3be.1506089472.git.khalid.aziz@oracle.com/", "date": "2017-09-25T16:48:58", "name": "[v8,7/9] mm: Add address parameter to arch_validate_prot()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "438a3b1a08e4df7599ffcc4eec00eaef68b0c947", "submitter": { "id": 42386, "url": "http://patchwork.ozlabs.org/api/people/42386/?format=api", "name": "Khalid Aziz", "email": "khalid.aziz@oracle.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/e4b6fcaa267628f7ef8fdbe60f05ec8d4d60b3be.1506089472.git.khalid.aziz@oracle.com/mbox/", "series": [ { "id": 4991, "url": "http://patchwork.ozlabs.org/api/series/4991/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=4991", "date": "2017-09-25T16:48:58", "name": "Application Data Integrity feature introduced by SPARC M7", "version": 8, "mbox": "http://patchwork.ozlabs.org/series/4991/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/818317/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/818317/checks/", "tags": {}, "related": [], "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 3y19BJ0bM3z9t5c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 26 Sep 2017 02:52:56 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3y19BH6rjTzDsQV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 26 Sep 2017 02:52:55 +1000 (AEST)", "from aserp1050.oracle.com (aserp1050.oracle.com [141.146.126.70])\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 3y198l1trxzDsN9\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 26 Sep 2017 02:51:34 +1000 (AEST)", "from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69])\n\tby aserp1050.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id v8PGpWsn003180\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 25 Sep 2017 16:51:33 GMT", "from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v8PGpABa021174\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 25 Sep 2017 16:51:11 GMT", "from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v8PGpAsF023151\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 25 Sep 2017 16:51:10 GMT", "from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25])\n\tby userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv8PGp9IK014523; Mon, 25 Sep 2017 16:51:09 GMT", "from concerto.us.oracle.com (/24.9.64.241)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Mon, 25 Sep 2017 09:51:09 -0700" ], "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=oracle.com\n\t(client-ip=141.146.126.70; helo=aserp1050.oracle.com;\n\tenvelope-from=khalid.aziz@oracle.com; receiver=<UNKNOWN>)", "From": "Khalid Aziz <khalid.aziz@oracle.com>", "To": "akpm@linux-foundation.org, benh@kernel.crashing.org, paulus@samba.org,\n\tmpe@ellerman.id.au, davem@davemloft.net, dave.hansen@linux.intel.com", "Subject": "[PATCH v8 7/9] mm: Add address parameter to arch_validate_prot()", "Date": "Mon, 25 Sep 2017 10:48:58 -0600", "Message-Id": "<e4b6fcaa267628f7ef8fdbe60f05ec8d4d60b3be.1506089472.git.khalid.aziz@oracle.com>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": [ "<cover.1506089472.git.khalid.aziz@oracle.com>", "<cover.1506089472.git.khalid.aziz@oracle.com>" ], "References": [ "<cover.1506089472.git.khalid.aziz@oracle.com>", "<cover.1506089472.git.khalid.aziz@oracle.com>" ], "X-Source-IP": "aserp1040.oracle.com [141.146.126.69]", "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": "aarcange@redhat.com, sparclinux@vger.kernel.org, ak@linux.intel.com,\n\tkirill.shutemov@linux.intel.com, nborisov@suse.com,\n\tlinuxppc-dev@lists.ozlabs.org, heiko.carstens@de.ibm.com,\n\tlinux-kernel@vger.kernel.org, linux-mm@kvack.org,\n\tKhalid Aziz <khalid.aziz@oracle.com>, mgorman@suse.de, tj@kernel.org, \n\tKhalid Aziz <khalid@gonehiking.org>, nadav.amit@gmail.com,\n\tvbabka@suse.cz, aneesh.kumar@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>" }, "content": "A protection flag may not be valid across entire address space and\nhence arch_validate_prot() might need the address a protection bit is\nbeing set on to ensure it is a valid protection flag. For example, sparc\nprocessors support memory corruption detection (as part of ADI feature)\nflag on memory addresses mapped on to physical RAM but not on PFN mapped\npages or addresses mapped on to devices. This patch adds address to the\nparameters being passed to arch_validate_prot() so protection bits can\nbe validated in the relevant context.\n\nSigned-off-by: Khalid Aziz <khalid.aziz@oracle.com>\nCc: Khalid Aziz <khalid@gonehiking.org>\n---\nv8:\n\t- Added addr parameter to powerpc arch_validate_prot() (suggested\n\t by Michael Ellerman)\nv7:\n\t- new patch\n\n arch/powerpc/include/asm/mman.h | 4 ++--\n arch/powerpc/kernel/syscalls.c | 2 +-\n include/linux/mman.h | 2 +-\n mm/mprotect.c | 2 +-\n 4 files changed, 5 insertions(+), 5 deletions(-)", "diff": "diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h\nindex 30922f699341..1d129f4521ac 100644\n--- a/arch/powerpc/include/asm/mman.h\n+++ b/arch/powerpc/include/asm/mman.h\n@@ -32,7 +32,7 @@ static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags)\n }\n #define arch_vm_get_page_prot(vm_flags) arch_vm_get_page_prot(vm_flags)\n \n-static inline bool arch_validate_prot(unsigned long prot)\n+static inline bool arch_validate_prot(unsigned long prot, unsigned long addr)\n {\n \tif (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM | PROT_SAO))\n \t\treturn false;\n@@ -40,7 +40,7 @@ static inline bool arch_validate_prot(unsigned long prot)\n \t\treturn false;\n \treturn true;\n }\n-#define arch_validate_prot(prot) arch_validate_prot(prot)\n+#define arch_validate_prot arch_validate_prot\n \n #endif /* CONFIG_PPC64 */\n #endif\t/* _ASM_POWERPC_MMAN_H */\ndiff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c\nindex a877bf8269fe..6d90ddbd2d11 100644\n--- a/arch/powerpc/kernel/syscalls.c\n+++ b/arch/powerpc/kernel/syscalls.c\n@@ -48,7 +48,7 @@ static inline long do_mmap2(unsigned long addr, size_t len,\n {\n \tlong ret = -EINVAL;\n \n-\tif (!arch_validate_prot(prot))\n+\tif (!arch_validate_prot(prot, addr))\n \t\tgoto out;\n \n \tif (shift) {\ndiff --git a/include/linux/mman.h b/include/linux/mman.h\nindex c8367041fafd..b42ad5c9d6a2 100644\n--- a/include/linux/mman.h\n+++ b/include/linux/mman.h\n@@ -49,7 +49,7 @@ static inline void vm_unacct_memory(long pages)\n *\n * Returns true if the prot flags are valid\n */\n-static inline bool arch_validate_prot(unsigned long prot)\n+static inline bool arch_validate_prot(unsigned long prot, unsigned long addr)\n {\n \treturn (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM)) == 0;\n }\ndiff --git a/mm/mprotect.c b/mm/mprotect.c\nindex bd0f409922cb..4f0e46bb1797 100644\n--- a/mm/mprotect.c\n+++ b/mm/mprotect.c\n@@ -395,7 +395,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,\n \tend = start + len;\n \tif (end <= start)\n \t\treturn -ENOMEM;\n-\tif (!arch_validate_prot(prot))\n+\tif (!arch_validate_prot(prot, start))\n \t\treturn -EINVAL;\n \n \treqprot = prot;\n", "prefixes": [ "v8", "7/9" ] }