Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96935 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76550 invoked from network); 16 Nov 2016 20:56:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 20:56:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 104.47.34.105 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.34.105 mail-by2nam01on0105.outbound.protection.outlook.com Received: from [104.47.34.105] ([104.47.34.105:45616] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/96-05303-318CC285 for ; Wed, 16 Nov 2016 15:56:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gXLv7Cn9jABkkIe5Ib+CbALVu8pEes/7oSQvAmH3fwQ=; b=UMFrMczCj6n3OtzuLyWvGp+tGc32J+G1cCLHE1iqYh05UQ+iEU1CKGEvh5rBkPEV0butlQPgTHgMfYo6dqa2rLI5/rtERW5XnoOsnGsD4pfndoyyCNkGSRokEGdm2u1qzsAYCKjiuejOdo17IDXk2vqLf3DMdiERPE4Hl/X7Bxg= Received: from MWHPR02MB2477.namprd02.prod.outlook.com (10.168.204.147) by MWHPR02MB2479.namprd02.prod.outlook.com (10.168.204.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16; Wed, 16 Nov 2016 20:56:46 +0000 Received: from MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) by MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) with mapi id 15.01.0734.007; Wed, 16 Nov 2016 20:56:45 +0000 To: Nikita Popov CC: Dmitry Stogov , Julien Pauli , Zeev Suraski , Nikita Popov , "php-dev@coydogsoftware.net" , Joe Watkins , "internals@lists.php.net" , "rasmus@lerdorf.com" , "Anatol Belski (ab@php.net)" Thread-Topic: [PATCH] opcache bug #69090, prepend user identifier to keys Thread-Index: AQHSQEg2D4h3upkAiEqzeDgxtnu8Qg== Date: Wed, 16 Nov 2016 20:56:45 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dmitry@zend.com; x-originating-ip: [92.62.57.172] x-microsoft-exchange-diagnostics: 1;MWHPR02MB2479;6:Gg2eqDilYJyu/h4I1qIKMxwVYrb6D8R+m1tsjH7pdroj8apJ2zLMLVkO4v15abQKFbiG4sNSLUVZowxp9QpWkRd3Xp/2FFXEAzIL+tHunasNJd6VYMggZEWDRWtWNYJbwmSGJOfgvL5fhyfKHIdPS7zV5U/vCY+6a18zwTF7wCpsCnDVEcHR1ciNwuy/UzH7IRC0RXAC19tbUDhtMyAEty0Q4408yDGEUlwRtBrhA2cnj7h3ZMsE/xzi1eeleNpDsPtiYxVJo8LxQnGO/PnaXLprUSqVe9WVxRv6UQYW/zBydD9MC0vixXu4/67j1V7o;5:m9JF7Ti7YmdruSd6jI2kYPsy5o9nNF05s3C/f1d6j7Sh8bc1x86fb9UCtl2FYuVkjP4Tl7vavNBnQF6U1ymAdzyaR39JkBmxn+s3UXSD6xQUsyndDJKrKKeUXxbtXsAkncCZk3KbRaEAGev/vQwR1roIC6geQppFEsicW+qzOw8=;24:f/jPH+OaC+2PGly3wA1yTJYCPei2MmxBSFvTw7uC+T+aQy4FXiuxTzcJuH6DiFq8KsVRWMwQ80DmiQTJkId486sGbQ3o9I/sm+yFS7GS8BA=;7:Oqbdi4B9vdMKiXpPTMaqb6t83v7fk/1XYA31obxxIE1RiajiZ01KslIb2OEkuphAUfekr7ticUVJY6FKdrtwON0OUEry3yvSlZNPKCBBUNqziqTIVOgQRE9tsS9N62Od9iLQ5ntQr20FXHxbTSwcD2NFvL9lk5Zn2BgC5nVuHCUS29i6BR8i2oSFUAyFq2harREH5HvnaDy4qDXY+B6XrLEvFTRuyE8vrJNbNkrT6IEta3+A+YQmjQiTadiR6WusiZt/sJpvyVbVyxtSJNXPXu3SzlJb5rc8WmhjbuH1M5ugXmEAuPbjjM2wSw9SKEBJ4/4ijee3TnPiz3f4u98kD/UBKOQSPiJH+YrzPEoHv64= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(6009001)(7916002)(24454002)(189002)(377454003)(199003)(5660300001)(86362001)(92566002)(9686002)(6116002)(5890100001)(33656002)(189998001)(122556002)(105586002)(81156014)(77096005)(101416001)(7846002)(110136003)(66066001)(3660700001)(3846002)(76576001)(2906002)(6916009)(4326007)(8676002)(81166006)(87936001)(106356001)(102836003)(229853002)(99286002)(97736004)(54356999)(68736007)(2900100001)(7736002)(74316002)(50986999)(305945005)(3280700002)(7696004)(6506003)(8936002)(106116001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR02MB2479;H:MWHPR02MB2477.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: b3c61d86-e402-42d6-8cd9-08d40e631385 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR02MB2479; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040281)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041223);SRVR:MWHPR02MB2479;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2479; x-forefront-prvs: 01283822F8 received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_MWHPR02MB24773D04124B9072DFCB2013BFBE0MWHPR02MB2477namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2016 20:56:45.5991 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2479 Subject: Re: [PATCH] opcache bug #69090, prepend user identifier to keys From: dmitry@zend.com (Dmitry Stogov) --_000_MWHPR02MB24773D04124B9072DFCB2013BFBE0MWHPR02MB2477namp_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable On Nov 16, 2016 8:03 PM, Nikita Popov wrote: > > 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 c= ollisions caused by the hash function? It looks like for inodes > 2^16 coll= isions 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 =3D=3D F(S2) ^ R2 && R1 =3D=3D R2 && S1 =3D=3D S2 >> >> >> R1 =3D=3D R2 seems useless. The existing condition: >> >> >> F(S1) ^ R1 =3D=3D F(S2) ^ R2 && S1 =3D=3D S2 >> >> >> fails if S1 !=3D S2 independently on R1 and R2. >> >> If S1 and S2 are the same, than F(S1) equal to F(S2) and consequently, t= o 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 ino= des I1 and I2 and two root hashes R1 =3D H(I1), R2 =3D H(I2). In that case = it may be that R1 =3D=3D R2, but I1 !=3D I2. At least that's the way I unde= rstood the patch -- it doesn't looks like there is anything explicitly prev= enting this. I see. Actually, for 64-bit systems it's better to eliminate bits permutati= on at all, but for 32-bit we can't avoid possible collisions, even if we in= clude high bits into hash. The good thing, that inodes above 2^32 may make sense only on filesystems a= bove 16TB with 4096 block sise (may be I'm wrong). do you have any ideas? Thanks. Dmitry. > > Nikita --_000_MWHPR02MB24773D04124B9072DFCB2013BFBE0MWHPR02MB2477namp_--