Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1252718/?format=api
{ "id": 1252718, "url": "http://patchwork.ozlabs.org/api/patches/1252718/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200311083745.17328-3-tiwai@suse.de/", "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": "<20200311083745.17328-3-tiwai@suse.de>", "list_archive_url": null, "date": "2020-03-11T08:37:40", "name": "[2/7] i40e: Use scnprintf() for avoiding potential buffer overflow", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "6a6b868c32132764870f4da4b12e52f472eb5bcf", "submitter": { "id": 216, "url": "http://patchwork.ozlabs.org/api/people/216/?format=api", "name": "Takashi Iwai", "email": "tiwai@suse.de" }, "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/20200311083745.17328-3-tiwai@suse.de/mbox/", "series": [ { "id": 163636, "url": "http://patchwork.ozlabs.org/api/series/163636/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=163636", "date": "2020-03-11T08:37:40", "name": null, "version": 1, "mbox": "http://patchwork.ozlabs.org/series/163636/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1252718/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1252718/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=suse.de" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 48cljB4MqFz9sPK\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 11 Mar 2020 19:38:15 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id AA4E386990;\n\tWed, 11 Mar 2020 08:38:07 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id H_RxXFrmwSUA; Wed, 11 Mar 2020 08:38:07 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1F6CC8695E;\n\tWed, 11 Mar 2020 08:38:07 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id AA1991BF28B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Mar 2020 08:38:05 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A5F858695E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Mar 2020 08:38:05 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id U1LMPxE2rVuc for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Mar 2020 08:38:04 +0000 (UTC)", "from mx2.suse.de (mx2.suse.de [195.135.220.15])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 382EA868B5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 11 Mar 2020 08:38:04 +0000 (UTC)", "from relay2.suse.de (unknown [195.135.220.254])\n\tby mx2.suse.de (Postfix) with ESMTP id C72BBB1AE;\n\tWed, 11 Mar 2020 08:38:01 +0000 (UTC)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org", "by amavisd-new at test-mx.suse.de" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "From": "Takashi Iwai <tiwai@suse.de>", "To": "netdev@vger.kernel.org", "Date": "Wed, 11 Mar 2020 09:37:40 +0100", "Message-Id": "<20200311083745.17328-3-tiwai@suse.de>", "X-Mailer": "git-send-email 2.16.4", "In-Reply-To": "<20200311083745.17328-1-tiwai@suse.de>", "References": "<20200311083745.17328-1-tiwai@suse.de>", "Subject": "[Intel-wired-lan] [PATCH 2/7] i40e: Use scnprintf() for avoiding\n\tpotential buffer overflow", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "intel-wired-lan@lists.osuosl.org,\n\t\"David S . Miller\" <davem@davemloft.net>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "Since snprintf() returns the would-be-output size instead of the\nactual output size, the succeeding calls may go beyond the given\nbuffer limit. Fix it by replacing with scnprintf().\n\nCc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\nCc: intel-wired-lan@lists.osuosl.org\nSigned-off-by: Takashi Iwai <tiwai@suse.de>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 8c3e753bfb9d..ff431c13f858 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -14478,29 +14478,29 @@ static void i40e_print_features(struct i40e_pf *pf)\n \n \ti = snprintf(buf, INFO_STRING_LEN, \"Features: PF-id[%d]\", hw->pf_id);\n #ifdef CONFIG_PCI_IOV\n-\ti += snprintf(&buf[i], REMAIN(i), \" VFs: %d\", pf->num_req_vfs);\n+\ti += scnprintf(&buf[i], REMAIN(i), \" VFs: %d\", pf->num_req_vfs);\n #endif\n-\ti += snprintf(&buf[i], REMAIN(i), \" VSIs: %d QP: %d\",\n+\ti += scnprintf(&buf[i], REMAIN(i), \" VSIs: %d QP: %d\",\n \t\t pf->hw.func_caps.num_vsis,\n \t\t pf->vsi[pf->lan_vsi]->num_queue_pairs);\n \tif (pf->flags & I40E_FLAG_RSS_ENABLED)\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" RSS\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" RSS\");\n \tif (pf->flags & I40E_FLAG_FD_ATR_ENABLED)\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" FD_ATR\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" FD_ATR\");\n \tif (pf->flags & I40E_FLAG_FD_SB_ENABLED) {\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" FD_SB\");\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" NTUPLE\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" FD_SB\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" NTUPLE\");\n \t}\n \tif (pf->flags & I40E_FLAG_DCB_CAPABLE)\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" DCB\");\n-\ti += snprintf(&buf[i], REMAIN(i), \" VxLAN\");\n-\ti += snprintf(&buf[i], REMAIN(i), \" Geneve\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" DCB\");\n+\ti += scnprintf(&buf[i], REMAIN(i), \" VxLAN\");\n+\ti += scnprintf(&buf[i], REMAIN(i), \" Geneve\");\n \tif (pf->flags & I40E_FLAG_PTP)\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" PTP\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" PTP\");\n \tif (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" VEB\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" VEB\");\n \telse\n-\t\ti += snprintf(&buf[i], REMAIN(i), \" VEPA\");\n+\t\ti += scnprintf(&buf[i], REMAIN(i), \" VEPA\");\n \n \tdev_info(&pf->pdev->dev, \"%s\\n\", buf);\n \tkfree(buf);\n", "prefixes": [ "2/7" ] }