Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/13300/?format=api
http://patches.dpdk.org/api/patches/13300/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1465289886-14479-1-git-send-email-slawomirx.mrozowicz@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1465289886-14479-1-git-send-email-slawomirx.mrozowicz@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1465289886-14479-1-git-send-email-slawomirx.mrozowicz@intel.com", "date": "2016-06-07T08:58:06", "name": "[dpdk-dev] examples/ipsec-secgw: Calling risky function", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "d834deb01ecedcdb66a60e8de74fe5b4d2a2d8a4", "submitter": { "id": 457, "url": "http://patches.dpdk.org/api/people/457/?format=api", "name": "Slawomir Mrozowicz", "email": "slawomirx.mrozowicz@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1465289886-14479-1-git-send-email-slawomirx.mrozowicz@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/13300/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/13300/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 808DB8E7F;\n\tTue, 7 Jun 2016 10:00:20 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 9687D8DB3\n\tfor <dev@dpdk.org>; Tue, 7 Jun 2016 10:00:18 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 07 Jun 2016 01:00:17 -0700", "from gklab-246-019.igk.intel.com (HELO intel.com) ([10.217.246.19])\n\tby orsmga002.jf.intel.com with SMTP; 07 Jun 2016 01:00:15 -0700", "by intel.com (sSMTP sendmail emulation);\n\tTue, 07 Jun 2016 10:58:09 +0200" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.26,432,1459839600\"; d=\"scan'208\";a=\"992529237\"", "From": "Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>", "To": "sergio.gonzalez.monroy@intel.com", "Cc": "dev@dpdk.org,\n\tSlawomir Mrozowicz <slawomirx.mrozowicz@intel.com>", "Date": "Tue, 7 Jun 2016 10:58:06 +0200", "Message-Id": "<1465289886-14479-1-git-send-email-slawomirx.mrozowicz@intel.com>", "X-Mailer": "git-send-email 1.9.1", "Subject": "[dpdk-dev] [PATCH] examples/ipsec-secgw: Calling risky function", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "lrand48 should not be used for security related applications,\nas linear congruential algorithms are too easy to break.\nUsed a compliant random number generator /dev/urandom.\n\nFixes: d299106e8e31 (\"examples/ipsec-secgw: add IPsec sample application\")\nCoverity ID 124558\n\nSigned-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>\n---\n examples/ipsec-secgw/esp.c | 17 +++++++++--------\n 1 file changed, 9 insertions(+), 8 deletions(-)", "diff": "diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c\nindex 0f6b33e..f3c4687 100644\n--- a/examples/ipsec-secgw/esp.c\n+++ b/examples/ipsec-secgw/esp.c\n@@ -55,16 +55,17 @@\n static inline void\n random_iv_u64(uint64_t *buf, uint16_t n)\n {\n-\tunsigned left = n & 0x7;\n-\tunsigned i;\n+\tint res = 0;\n+\tFILE *fp;\n \n-\tRTE_ASSERT((n & 0x3) == 0);\n-\n-\tfor (i = 0; i < (n >> 3); i++)\n-\t\tbuf[i] = rte_rand();\n+\tfp = fopen(\"/dev/urandom\", \"r\");\n+\tif (fp != NULL) {\n+\t\tres = fread(buf, 8, n, fp);\n+\t\tfclose(fp);\n+\t}\n \n-\tif (left)\n-\t\t*((uint32_t *)&buf[i]) = (uint32_t)lrand48();\n+\tRTE_ASSERT(res != n);\n+\tRTE_LOG(DEBUG, IPSEC_ESP, \"random_iv_u64 result %d\\n\", res);\n }\n \n /* IPv4 Tunnel */\n", "prefixes": [ "dpdk-dev" ] }{ "id": 13300, "url": "