{"id":811305,"url":"http://patchwork.ozlabs.org/api/patches/811305/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1504839616-14519-1-git-send-email-zhizhou.tian@gmail.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504839616-14519-1-git-send-email-zhizhou.tian@gmail.com>","list_archive_url":null,"date":"2017-09-08T03:00:16","name":"net:netfilter alloc xt_byteslimit_htable with wrong size","commit_ref":null,"pull_url":null,"state":"awaiting-upstream","archived":true,"hash":"0260ba18e2c535d7b4d7fe9acfb0328af0394eb4","submitter":{"id":72328,"url":"http://patchwork.ozlabs.org/api/people/72328/?format=json","name":null,"email":"zhizhou.tian@gmail.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1504839616-14519-1-git-send-email-zhizhou.tian@gmail.com/mbox/","series":[{"id":2092,"url":"http://patchwork.ozlabs.org/api/series/2092/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=2092","date":"2017-09-08T03:00:16","name":"net:netfilter alloc xt_byteslimit_htable with wrong size","version":1,"mbox":"http://patchwork.ozlabs.org/series/2092/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/811305/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/811305/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"bBuz04G3\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpMX459dQz9sPk\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 13:00:52 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754084AbdIHDAm (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 7 Sep 2017 23:00:42 -0400","from mail-qk0-f194.google.com ([209.85.220.194]:34772 \"EHLO\n\tmail-qk0-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1753132AbdIHDAk (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 7 Sep 2017 23:00:40 -0400","by mail-qk0-f194.google.com with SMTP id d70so869261qkc.1;\n\tThu, 07 Sep 2017 20:00:39 -0700 (PDT)","from localhost.localdomain (lax-cn2.rssn.cn. [198.181.34.251])\n\tby smtp.gmail.com with ESMTPSA id\n\ty77sm593990qka.87.2017.09.07.20.00.34\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 07 Sep 2017 20:00:37 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=TWAp+7yGAVT/RBKCNmYVPTNL6rxG2mt+PI6+08qdjV4=;\n\tb=bBuz04G3yeL2FmCXcm5/DLksMQ0dr+BR/KhlmnJAcnyUfTQj22zK5QbeoGcdMuMiMX\n\thI1KGemvzftQcJbhaviTLBAE//TimD6hj0O7THhjRIHFoN3Rh4+fk2zySn1ViLkakUVL\n\tSa4cFALcCvJ2kqT3JbBZdzdANP+4vKRbeqeyh+zqzcHXJjZMyc9juBOIxZ2dooXklSJY\n\tVedBmFsyvnN8ZbvgfKi2Y+/kT3RO/PyJW7LKAr38zBYKXBRCJpF6XCf2t8zsrD/6hJtQ\n\t4fUko8j6GMNZTAQz4hZ1J+ec7BGAgiiObBVKcJMZcdhQVMJ92RC75i3eUSt7ZyqptR98\n\tA2Dw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=TWAp+7yGAVT/RBKCNmYVPTNL6rxG2mt+PI6+08qdjV4=;\n\tb=P+csJDUCvApEtAn6BfBPhBmm4UwBSt/oE32Sj52AOI+83uiCyxBXC+Cb2KPgX2C64q\n\tIlllL8755j1p+OGZxhzLy/chz0qXOzitX4RyC8t0D0BEmMvSW8eMpy88H8IfgtkTtbev\n\tSLF6mhhYqSnS5oUhqZRM2gfgrSzH5fm1Eo7NVCDQipZWcv5pNwNM2kjTBaSKXezETLo7\n\tJYyXoOT1OTOlfMMT3htAkd13HEBf+HPYGLo4Xma4p+DA6Ec8aNs27P24mmQD8YHsdz+c\n\t6fBLlQrZiIe9N4J7RrAC/ozyfjGn8YMmzjxYJjVyQ9KZuUpasrQYFp3IiSjf/mwkChrF\n\tcNUg==","X-Gm-Message-State":"AHPjjUifrhbckeqCAW5O1gaHoo6F7G2SV8Ohw0kjZ1Uh5MHC5bcA+4FM\n\tMLfzWBWCNhfEKg==","X-Google-Smtp-Source":"AOwi7QBSPGBp2HXCE5zJPhH1+xEeK+Jk2OZyzgEAux07myCSBBjkDStsMLI8wm81gkoPV4c6zkzlAQ==","X-Received":"by 10.55.201.155 with SMTP id m27mr1988006qkl.57.1504839639352; \n\tThu, 07 Sep 2017 20:00:39 -0700 (PDT)","From":"zhizhou.tian@gmail.com","To":"pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de,\n\tdavem@davemloft.net, netfilter-devel@vger.kernel.org,\n\tcoreteam@netfilter.org, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org","Cc":"Zhizhou Tian <zhizhou.tian@gmail.com>","Subject":"[PATCH] net:netfilter alloc xt_byteslimit_htable with wrong size","Date":"Fri,  8 Sep 2017 11:00:16 +0800","Message-Id":"<1504839616-14519-1-git-send-email-zhizhou.tian@gmail.com>","X-Mailer":"git-send-email 2.7.4","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Zhizhou Tian <zhizhou.tian@gmail.com>\n\nstruct xt_byteslimit_htable used hlist_head,\nbut alloc memory with sizeof(struct list_head)\n\nChange-Id: I75bc60e47e0823700d4303c9d763b7995e3b7bb3\nSigned-off-by: Zhizhou Tian <zhizhou.tian@gmail.com>\n---\n net/netfilter/xt_hashlimit.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c\nindex 10d4823..962ea4a 100644\n--- a/net/netfilter/xt_hashlimit.c\n+++ b/net/netfilter/xt_hashlimit.c\n@@ -279,7 +279,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg,\n \t\tsize = cfg->size;\n \t} else {\n \t\tsize = (totalram_pages << PAGE_SHIFT) / 16384 /\n-\t\t       sizeof(struct list_head);\n+\t\t       sizeof(struct hlist_head);\n \t\tif (totalram_pages > 1024 * 1024 * 1024 / PAGE_SIZE)\n \t\t\tsize = 8192;\n \t\tif (size < 16)\n@@ -287,7 +287,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg,\n \t}\n \t/* FIXME: don't use vmalloc() here or anywhere else -HW */\n \thinfo = vmalloc(sizeof(struct xt_hashlimit_htable) +\n-\t                sizeof(struct list_head) * size);\n+\t                sizeof(struct hlist_head) * size);\n \tif (hinfo == NULL)\n \t\treturn -ENOMEM;\n \t*out_hinfo = hinfo;\n","prefixes":[]}