Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/675852/?format=api
{ "id": 675852, "url": "http://patchwork.ozlabs.org/api/patches/675852/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1475010871-31682-1-git-send-email-gpiccoli@linux.vnet.ibm.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1475010871-31682-1-git-send-email-gpiccoli@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2016-09-27T21:14:31", "name": "[net] i40e: avoid NULL pointer dereference and recursive errors on early PCI error", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "dec47e060c5dc8aec4a4517fd0ef163b92bb46f9", "submitter": { "id": 67066, "url": "http://patchwork.ozlabs.org/api/people/67066/?format=api", "name": "Guilherme G. Piccoli", "email": "gpiccoli@linux.vnet.ibm.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1475010871-31682-1-git-send-email-gpiccoli@linux.vnet.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/675852/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/675852/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3skDB647cGz9s65\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 28 Sep 2016 07:14:54 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id E3A5089936;\n\tTue, 27 Sep 2016 21:14:52 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id ch9bkWNjN9gD; Tue, 27 Sep 2016 21:14:52 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 241768992C;\n\tTue, 27 Sep 2016 21:14:52 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C84731C1F12\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 21:14:50 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C7B1E8C0C3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 21:14:50 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id mHNygA4AaDuc for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 21:14:50 +0000 (UTC)", "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 29C1D8C094\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 21:14:50 +0000 (UTC)", "from pps.filterd (m0098416.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id\n\tu8RLDEGS010460 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 17:14:49 -0400", "from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 25qu85eyvq-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 17:14:48 -0400", "from localhost\n\tby e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <intel-wired-lan@lists.osuosl.org> from\n\t<gpiccoli@linux.vnet.ibm.com>; Tue, 27 Sep 2016 18:14:47 -0300", "from d24dlp01.br.ibm.com (9.18.248.204)\n\tby e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tTue, 27 Sep 2016 18:14:44 -0300", "from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16])\n\tby d24dlp01.br.ibm.com (Postfix) with ESMTP id EEE77352005F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 17:14:19 -0400 (EDT)", "from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95])\n\tby d24relay01.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tu8RLEiqb5087418 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 18:14:44 -0300", "from d24av03.br.ibm.com (localhost [127.0.0.1])\n\tby d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tu8RLEhc2005894 for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 27 Sep 2016 18:14:44 -0300", "from localhost ([9.85.148.197])\n\tby d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tu8RLEgk8005830; Tue, 27 Sep 2016 18:14:43 -0300" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "From": "\"Guilherme G. Piccoli\" <gpiccoli@linux.vnet.ibm.com>", "To": "jeffrey.t.kirsher@intel.com, intel-wired-lan@lists.osuosl.org", "Date": "Tue, 27 Sep 2016 18:14:31 -0300", "X-Mailer": "git-send-email 2.1.0", "X-TM-AS-MML": "disable", "X-Content-Scanned": "Fidelis XPS MAILER", "x-cbid": "16092721-0032-0000-0000-00000292BF46", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "16092721-0033-0000-0000-00000F03F606", "Message-Id": "<1475010871-31682-1-git-send-email-gpiccoli@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2016-09-27_09:, , 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-1609020000\n\tdefinitions=main-1609270380", "Cc": "netdev@vger.kernel.org, gpiccoli@linux.vnet.ibm.com", "Subject": "[Intel-wired-lan] [PATCH net] i40e: avoid NULL pointer dereference\n\tand recursive errors on early PCI error", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Although rare, it's possible to hit PCI error early on device\nprobe, meaning possibly some structs are not entirely initialized,\nand some might even be completely uninitialized, leading to NULL\npointer dereference.\n\nThe i40e driver currently presents a \"bad\" behavior if device hits\nsuch early PCI error: firstly, the struct i40e_pf might not be\nattached to pci_dev yet, leading to a NULL pointer dereference on\naccess to pf->state.\n\nEven checking if the struct is NULL and avoiding the access in that\ncase isn't enough, since the driver cannot recover from PCI error\nthat early; in our experiments we saw multiple failures on kernel\nlog, like:\n\n [549.664] i40e 0007:01:00.1: Initial pf_reset failed: -15\n [549.664] i40e: probe of 0007:01:00.1 failed with error -15\n [...]\n [871.644] i40e 0007:01:00.1: The driver for the device stopped because the\n device firmware failed to init. Try updating your NVM image.\n [871.644] i40e: probe of 0007:01:00.1 failed with error -32\n [...]\n [872.516] i40e 0007:01:00.0: ARQ: Unknown event 0x0000 ignored\n\nBetween the first probe failure (error -15) and the second (error -32)\nanother PCI error happened due to the first bad probe. Also, driver\nstarted to flood console with those ARQ event messages.\n\nThis patch will prevent these issues by allowing error recovery\nmechanism to remove the failed device from the system instead of\ntrying to recover from early PCI errors during device probe.\n\nSigned-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++++++\n 1 file changed, 6 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex d0b3a1b..dad15b6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -11360,6 +11360,12 @@ static pci_ers_result_t i40e_pci_error_detected(struct pci_dev *pdev,\n \n \tdev_info(&pdev->dev, \"%s: error %d\\n\", __func__, error);\n \n+\tif (!pf) {\n+\t\tdev_info(&pdev->dev,\n+\t\t\t \"Cannot recover - error happened during device probe\\n\");\n+\t\treturn PCI_ERS_RESULT_DISCONNECT;\n+\t}\n+\n \t/* shutdown all operations */\n \tif (!test_bit(__I40E_SUSPENDED, &pf->state)) {\n \t\trtnl_lock();\n", "prefixes": [ "net" ] }