Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96933 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63281 invoked from network); 16 Nov 2016 17:03:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 17:03:55 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.68 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.68 mail-wm0-f68.google.com Received: from [74.125.82.68] ([74.125.82.68:35348] helo=mail-wm0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/C4-05303-9719C285 for ; Wed, 16 Nov 2016 12:03:55 -0500 Received: by mail-wm0-f68.google.com with SMTP id a20so13116688wme.2 for ; Wed, 16 Nov 2016 09:03:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ua+J9ZErTjAaTBVY1XU+0d5xphvVEGGPXelznMJYHYQ=; b=r+l8axB/3VNwwQRYOcMMsBmYP50BSbGvDfkTSXfsfbTxDUisYz2ZcoWg3Xbqg7KtoW LfWDtucZgQ+BZdQOgINxKhLUs6EiPGQb+s2cifaxdlpGizfvnyPpeE9BQcnXyd4Z5KxN DTH24FyIbfSkNTmn3xd3fMAz08Fs4fNUdsXNcCMf1s7tINUH5u6TFm0g1aAJbi9q/FeC DcokIphcIVMSzjCQB0+ylsd7LdE5Shp+JJX94fOJDrVlmGHtI0rMO9Vtv8LMY7yJRP8j t6H2vwToexrBp5pEG6Xh9Knne/9qpVqSO+9jmWRPeM2xILfjf8gDKGzd6DL/8yfqrhuJ HKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ua+J9ZErTjAaTBVY1XU+0d5xphvVEGGPXelznMJYHYQ=; b=ArvheOsMZD7gfXdiuoK3KbAxD0ZiniJ49vO5NTLFUmucrO8Chehb+ZI5uzw1MR7KRh S11YZqdfOBaZ9yG9vYDKV0Sz4sM+fbeJt0S6xjXoMWHiSSPNWNsHg7GeY0vyNSCkXvOz gnoACopKwrmwbtfddTq3npxrFFBGW9BxjJprkYjn47lVA8wlf5fHo81tldge7Q4awDxn h6mMjfToRMPfQLCzaIO9O1GuBbJUj5YXk5L6bahM9LbltuRX9RtPUXlCZXgbqQr0di6W ySXYYNoJ8QitYR0gwCMk5VHl4Ew7T9z/J5xSqgu7hwU1KyPsX19L55KbzFekA3EQIm4b 4FCQ== X-Gm-Message-State: ABUngvcoy2ZtLD1SfvQ4bzX9w3DctGB0neurP3uYOHanSuc6LnmwsLg8Ogr5i46O1njYxcQJjAssrtRnsK5wtA== X-Received: by 10.28.8.202 with SMTP id 193mr10410448wmi.101.1479315830618; Wed, 16 Nov 2016 09:03:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.170.79 with HTTP; Wed, 16 Nov 2016 09:03:50 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Nov 2016 18:03:50 +0100 Message-ID: To: Dmitry Stogov Cc: Zeev Suraski , "php-dev@coydogsoftware.net" , Julien Pauli , "rasmus@lerdorf.com" , "Anatol Belski (ab@php.net)" , Nikita Popov , Joe Watkins , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a114423829843a105416e0e0a Subject: Re: [PATCH] opcache bug #69090, prepend user identifier to keys From: nikita.ppv@gmail.com (Nikita Popov) --001a114423829843a105416e0e0a Content-Type: text/plain; charset=UTF-8 On Tue, Nov 15, 2016 at 6:32 PM, Dmitry Stogov wrote: > On Nov 15, 2016 18:50, Nikita Popov wrote: > > > > On Tue, Nov 15, 2016 at 4:19 PM, Dmitry Stogov wrote: > >> > >> New patch, attached to bug report, should fix both problems. > >> > >> I'm going to commit it tomorrow, if no objections. > >> > >> > >> Thanks. Dmitry. > > > > For the new validate_root patch, wouldn't we still end up with inode > collisions caused by the hash function? It looks like for inodes > 2^16 > collisions should be "common". > > > > Nikita > > > It's not a problem to add inode check, but I think we don't need it. > > > Let S1 and S2 strings, R1 and R2 root_hashes and F a hash function. > > You propose the following comparison for collision checks > > > F(S1) ^ R1 == F(S2) ^ R2 && R1 == R2 && S1 == S2 > > > R1 == R2 seems useless. The existing condition: > > > F(S1) ^ R1 == F(S2) ^ R2 && S1 == S2 > > > fails if S1 != S2 independently on R1 and R2. > > If S1 and S2 are the same, than F(S1) equal to F(S2) and consequently, to > satisfy the whole condition, R1 should be equal to R2 > > > Am I wrong? > To clarify: My concern is not with the way the hash is compared, but that the root hash itself could have collisions. That is, you have two root inodes I1 and I2 and two root hashes R1 = H(I1), R2 = H(I2). In that case it may be that R1 == R2, but I1 != I2. At least that's the way I understood the patch -- it doesn't looks like there is anything explicitly preventing this. Nikita --001a114423829843a105416e0e0a--