Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/108034/?format=api
http://patches.dpdk.org/api/patches/108034/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/tencent_28091DB36FDC914F91B8180F1EC1D3918807@qq.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": "<tencent_28091DB36FDC914F91B8180F1EC1D3918807@qq.com>", "list_archive_url": "https://inbox.dpdk.org/dev/tencent_28091DB36FDC914F91B8180F1EC1D3918807@qq.com", "date": "2022-02-22T18:18:02", "name": "[04/20] crypto/qat: fix a memory leak when set encrypt key fail", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "6e37a4b0f20109d1780e69948628523bc48a11cc", "submitter": { "id": 2458, "url": "http://patches.dpdk.org/api/people/2458/?format=api", "name": "Weiguo Li", "email": "liwg06@foxmail.com" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/tencent_28091DB36FDC914F91B8180F1EC1D3918807@qq.com/mbox/", "series": [ { "id": 21799, "url": "http://patches.dpdk.org/api/series/21799/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21799", "date": "2022-02-22T18:17:58", "name": "fix memory leaks in error handling", "version": 1, "mbox": "http://patches.dpdk.org/series/21799/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/108034/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/108034/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 02CD6A034E;\n\tTue, 22 Feb 2022 19:18:59 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2594641147;\n\tTue, 22 Feb 2022 19:18:47 +0100 (CET)", "from out203-205-221-190.mail.qq.com (out203-205-221-190.mail.qq.com\n [203.205.221.190])\n by mails.dpdk.org (Postfix) with ESMTP id BF35541163\n for <dev@dpdk.org>; Tue, 22 Feb 2022 19:18:44 +0100 (CET)", "from localhost.localdomain ([111.193.130.237])\n by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP\n id 49223207; Wed, 23 Feb 2022 02:18:18 +0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com;\n s=s201512; t=1645553923;\n bh=oSWLP6A+isvMaxUxyTpUue7rcQmU093mPiPPGG0+y9k=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=cqkPWGUwzhMupNXPrqonmhgjSY7wMJYxJ/GCzu61JdDLiYNIxpPrMMMln+ppx8Rbx\n uG79l05wmPXI4Qezcb97XMx/VZ9pQk2ASdt6KMFbFFJIg9eq8AG//rtLXvc8eZiV59\n nAG7SXPlIJdM0C1ajkofKsaxVQiZA4EoGYYEQ5uQ=", "X-QQ-mid": "xmsmtpt1645553918tw2q88q3l", "Message-ID": "<tencent_28091DB36FDC914F91B8180F1EC1D3918807@qq.com>", "X-QQ-XMAILINFO": "MPRquJFDOUjC7ho6kXnIbuLtA88IZQd7FcGiVVSOHs9ifNMf/1Sr+x89W7rIMo\n mH7TaJJkxVV9lwV8YfmlDgNg+aiD26RAFJmHKJFegkc7Q+ItP+3LMRLjolV2lVbx4quNpCa5ewkI\n r58pQShQy5OVG05sMk19pUbnr5Zfo/XHY4bwmvxw3r3QKkkP5I7Amagy7NTsj60FF1yjvaGvIdlJ\n 42NCTqUSKTkRTNSpwLczOXHTTlcjivYUy4pMEGtb6YP1UZ/9u6wyxO7GipznhBM1GtverNN/8Dnn\n 49sIEz2yMhZjbihg/gBkCI2JHF74sIiTq7JkQpQwOKQ91vw7rYxGy4XnsZ419fO6KGus72xRsJBi\n tPVhedwjcgoKD/qcEt5JFG0Ko2LDRe8NYsp0SQH+lz0Iw2pf0jP8TguDxShqY6U/WFw/x837srK2\n LIGz7ZiSlcVGkbw652JtzUZrHHQ84mZbmS7uHyBdo9JS5H7hH81lHHDV03Sz/92lWBPxyV1NqQgs\n 9G/icfnpsukg29mHVacZsWCenKZ7OUyUqI3q2oO40Soji0dpZiPaXYMyWAu/aETLR1Wq5YLDt2mV\n ue0SBfo1CHGw0MLRBlQscAZikcTxQdcFyYBtH4vXsHRGe3MuC1Eu8PS3OZBqSOQQE5m2Gbt0eg+m\n IyymK3Iik8zb9Y450c/Fb7ikJhVkUPsFcesxZDYQ9JnEISb+762w+o/pYuM3lS202GX0WYCtjcQa\n dqBqRqOhvHRlSPE4JA1jmdiaeMFGFJ93oKr5535aAuAIK2IeyQzjexQSXCv15QzRbAISxa2ULfpE\n 0H9T8xpfHWmwILOhZhZP/2GpXXCNmzZE4oa6dbDLgMFLri8E8n0b+bdKDrkNK4AwYHbQcUMb0Kta\n eP7IVYLTBi/xfM9QGtq3Yno03Vd/KCtZr/Lq99fKj3OlCai6CEtDY=", "From": "Weiguo Li <liwg06@foxmail.com>", "To": "dev@dpdk.org", "Cc": "adypodoman@gmail.com, xiaoyun.li@intel.com, tianfei.zhang@intel.com,\n bruce.richardson@intel.com, ivan.malov@oktetlabs.ru, jgrajcia@cisco.com,\n hkalra@marvell.com, ying.a.wang@intel.com, ting.xu@intel.com,\n simei.su@intel.com, qiming.yang@intel.com, motih@mellanox.com,\n shreyansh.jain@nxp.com, skoteshwar@marvell.com, stephen@networkplumber.org,\n kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com,\n declan.doherty@intel.com, gakhil@marvell.com, nicolas.chautru@intel.com", "Subject": "[PATCH 04/20] crypto/qat: fix a memory leak when set encrypt key fail", "Date": "Wed, 23 Feb 2022 02:18:02 +0800", "X-OQ-MSGID": "\n <68cc1842c6763c0b23b72c951ff45ca18a727387.1645551559.git.liwg06@foxmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<cover.1645551559.git.liwg06@foxmail.com>", "References": "<cover.1645551559.git.liwg06@foxmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "We allocated memory for 'in', we don't free it when AES_set_encrypt_key()\nfails and it will lead to memory leak.\nWe can move set_encrypt_key() ahead of the memory allocation to fix it.\n\nFixes: 1703e94ac5ce (\"qat: add driver for QuickAssist devices\")\n\nSigned-off-by: Weiguo Li <liwg06@foxmail.com>\n---\n drivers/crypto/qat/qat_sym_session.c | 9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c\nindex 8ca475ca8b..3dc13942cb 100644\n--- a/drivers/crypto/qat/qat_sym_session.c\n+++ b/drivers/crypto/qat/qat_sym_session.c\n@@ -1400,18 +1400,17 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg,\n \t\tmemset(p_state_buf, 0, ICP_QAT_HW_GALOIS_H_SZ +\n \t\t\t\tICP_QAT_HW_GALOIS_LEN_A_SZ +\n \t\t\t\tICP_QAT_HW_GALOIS_E_CTR0_SZ);\n+\t\tif (AES_set_encrypt_key(auth_key, auth_keylen << 3,\n+\t\t\t&enc_key) != 0) {\n+\t\t\treturn -EFAULT;\n+\t\t}\n \t\tin = rte_zmalloc(\"working mem for key\",\n \t\t\t\tICP_QAT_HW_GALOIS_H_SZ, 16);\n \t\tif (in == NULL) {\n \t\t\tQAT_LOG(ERR, \"Failed to alloc memory\");\n \t\t\treturn -ENOMEM;\n \t\t}\n-\n \t\tmemset(in, 0, ICP_QAT_HW_GALOIS_H_SZ);\n-\t\tif (AES_set_encrypt_key(auth_key, auth_keylen << 3,\n-\t\t\t&enc_key) != 0) {\n-\t\t\treturn -EFAULT;\n-\t\t}\n \t\tAES_encrypt(in, out, &enc_key);\n \t\t*p_state_len = ICP_QAT_HW_GALOIS_H_SZ +\n \t\t\t\tICP_QAT_HW_GALOIS_LEN_A_SZ +\n", "prefixes": [ "04/20" ] }{ "id": 108034, "url": "