Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96089 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6998 invoked from network); 21 Sep 2016 23:43:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2016 23:43:02 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.45 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.218.45 mail-oi0-f45.google.com Received: from [209.85.218.45] ([209.85.218.45:32981] helo=mail-oi0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/01-01233-40B13E75 for ; Wed, 21 Sep 2016 19:43:00 -0400 Received: by mail-oi0-f45.google.com with SMTP id r126so79163872oib.0 for ; Wed, 21 Sep 2016 16:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=829cPQk0EOdZrxFoG5QvtJFax7UJEO6xIz2lj5LPGrA=; b=NN7bp3/2t1ckMYDG+MmIeGAw8Cxo3K8l/nAgooUp4h1iNKq/iUes0YNlNFP+eXKPmy l/W//vrs/oeCym8FI/xuyCeou1McJ0ZM/fvn8zMxZ/VrCz6KATQkEWsbtlpn1PCJBTad Dc3Jlx2b4txOSnuzw2o9t0wMUHFCR49d9XdkkbfL5PLIJGaZMV8ulLnokdZLjGkRsvcq vhtZGix+nHL+5yay53ByokPAisqYQIv3aALc8FApovHmlOV6fkYaVQNqyJTdGDkKkOwB JLg4aY+jQBn0WX7c8EuNnLgAd2GxjzG0xccZH2+NGOdLP4O8GrlywqbRbbFHh81IJ2jA K4Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=829cPQk0EOdZrxFoG5QvtJFax7UJEO6xIz2lj5LPGrA=; b=RAlR4M8KLezNJoduvs8vEtEyz+tw7ygANWTXJGif+3uLICMy5wOYgv9DCoCdRdZXkz sN25dLS9ewvlPrPwZw5tW0ySdrzN937DXAKuAnPZI15iRak+4QkShKngkHhxjadf+1Jp T5OgKhvOrnmnYvZJfWrxbEmmMsFyAPunXijwcZ99FSwU/OAjK7+ZhUrotCQJOCwqeBsU XJssOMCy9GTABluGAhj9lykyGJVppVzLn8X+th7lO2JFn7kcI/2wAmF7Rgdze+X4zhzl du5Hm4X8ywlzsQ1pmfg+o8DFioXM7jKEDxaITT8q9ZG7kJ8GS2ykEKReE986uLlNaQ/E uaCQ== X-Gm-Message-State: AE9vXwPlBBdEDW1Z8bFai/3NKgBVlcrzKqj/ANfa2r/0PJ5FliTCro0oxKyVo9YDufH2JA== X-Received: by 10.202.173.216 with SMTP id w207mr52971744oie.35.1474501377768; Wed, 21 Sep 2016 16:42:57 -0700 (PDT) Received: from [192.168.2.102] (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id p57sm11176980otb.6.2016.09.21.16.42.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Sep 2016 16:42:57 -0700 (PDT) To: Nikita Popov References: <7d5727ba-da33-e3c5-1d1f-318c45d81616@cubiclesoft.com> <9522ebc9-8d8b-045e-b701-02f1166063e6@gmail.com> <40868951-8BDA-4860-884C-B8252C1839E3@gmail.com> Cc: PHP Internals Message-ID: <9ce33625-2737-9933-7dd1-4f7930bccfac@gmail.com> Date: Wed, 21 Sep 2016 16:42:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] HashDoS From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > As linked in my first reply, there was a previous discussion on the > topic: http://markmail.org/message/ttbgcvdu4f7uymfb > The collision-counting approach that Yasuo references is linked at the > start of the first mail: https://github.com/php/php-src/pull/1565 > > Collisions are counted during insertion operations. While we perform a > hashtable insertion, we first need to iterate over the existing buckets > for a certain hash to see if the insert is actually an update. The > implementation simply keeps track of how many buckets we inspect while > doing that. If the number is above a certain threshold, an error is > generated. So, count is per-lookup, then I think it's fine then. Sorry for misunderstanding it initially. Anything prevents us from merging it? If not, let's do it. -- Stas Malyshev smalyshev@gmail.com