Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/787540/?format=api
{ "id": 787540, "url": "http://patchwork.ozlabs.org/api/patches/787540/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-ppc/patch/20170713073829.dqjahnakxqvpne7x@mwanda/", "project": { "id": 23, "url": "http://patchwork.ozlabs.org/api/projects/23/?format=api", "name": "KVM PowerPC development", "link_name": "kvm-ppc", "list_id": "kvm-ppc.vger.kernel.org", "list_email": "kvm-ppc@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170713073829.dqjahnakxqvpne7x@mwanda>", "list_archive_url": null, "date": "2017-07-13T07:38:29", "name": "[1/2] KVM: PPC: e500: fix some NULL dereferences on error", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "e6e4351d52f5ef978cfb25d7efebdaeb863be283", "submitter": { "id": 9327, "url": "http://patchwork.ozlabs.org/api/people/9327/?format=api", "name": "Dan Carpenter", "email": "dan.carpenter@oracle.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/kvm-ppc/patch/20170713073829.dqjahnakxqvpne7x@mwanda/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/787540/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/787540/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<kvm-ppc-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3x7SPc2369z9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 13 Jul 2017 17:39:16 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1750944AbdGMHjM (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 13 Jul 2017 03:39:12 -0400", "from userp1040.oracle.com ([156.151.31.81]:41754 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750807AbdGMHjL (ORCPT\n\t<rfc822;kvm-ppc@vger.kernel.org>); Thu, 13 Jul 2017 03:39:11 -0400", "from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id v6D7che6011180\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 13 Jul 2017 07:38:44 GMT", "from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])\n\tby aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v6D7chXR020666\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 13 Jul 2017 07:38:43 GMT", "from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19])\n\tby userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv6D7ceC2019767; Thu, 13 Jul 2017 07:38:40 GMT", "from mwanda (/197.254.35.146)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Thu, 13 Jul 2017 00:38:40 -0700" ], "Date": "Thu, 13 Jul 2017 10:38:29 +0300", "From": "Dan Carpenter <dan.carpenter@oracle.com>", "To": "Alexander Graf <agraf@suse.com>, Scott Wood <scottwood@freescale.com>", "Cc": "Paolo Bonzini <pbonzini@redhat.com>,\n\tRadim =?utf-8?B?S3LEjW3DocWZ?= <rkrcmar@redhat.com>,\n\tBenjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tPaul Mackerras <paulus@samba.org>,\n\tMichael Ellerman <mpe@ellerman.id.au>, kvm-ppc@vger.kernel.org,\n\tkvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,\n\tkernel-janitors@vger.kernel.org", "Subject": "[PATCH 1/2] KVM: PPC: e500: fix some NULL dereferences on error", "Message-ID": "<20170713073829.dqjahnakxqvpne7x@mwanda>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "X-Mailer": "git-send-email haha only kidding", "User-Agent": "NeoMutt/20170113 (1.7.2)", "X-Source-IP": "aserv0022.oracle.com [141.146.126.234]", "Sender": "kvm-ppc-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<kvm-ppc.vger.kernel.org>", "X-Mailing-List": "kvm-ppc@vger.kernel.org" }, "content": "There are some error paths in kvmppc_core_vcpu_create_e500() where we\nforget to set the error code. It means that we return ERR_PTR(0) which\nis NULL and it results in a NULL pointer dereference in the caller.\n\nSigned-off-by: Dan Carpenter <dan.carpenter@oracle.com>\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe kvm-ppc\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at http://vger.kernel.org/majordomo-info.html", "diff": "diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c\nindex 32fdab57d604..f9f6468f4171 100644\n--- a/arch/powerpc/kvm/e500.c\n+++ b/arch/powerpc/kvm/e500.c\n@@ -455,16 +455,20 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_e500(struct kvm *kvm,\n \tif (err)\n \t\tgoto free_vcpu;\n \n-\tif (kvmppc_e500_id_table_alloc(vcpu_e500) == NULL)\n+\tif (kvmppc_e500_id_table_alloc(vcpu_e500) == NULL) {\n+\t\terr = -ENOMEM;\n \t\tgoto uninit_vcpu;\n+\t}\n \n \terr = kvmppc_e500_tlb_init(vcpu_e500);\n \tif (err)\n \t\tgoto uninit_id;\n \n \tvcpu->arch.shared = (void*)__get_free_page(GFP_KERNEL|__GFP_ZERO);\n-\tif (!vcpu->arch.shared)\n+\tif (!vcpu->arch.shared) {\n+\t\terr = -ENOMEM;\n \t\tgoto uninit_tlb;\n+\t}\n \n \treturn vcpu;\n \n", "prefixes": [ "1/2" ] }