Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96938 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82553 invoked from network); 16 Nov 2016 21:30:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 21:30:31 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 104.47.32.109 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.32.109 mail-sn1nam01on0109.outbound.protection.outlook.com Received: from [104.47.32.109] ([104.47.32.109:21180] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/C7-05303-4FFCC285 for ; Wed, 16 Nov 2016 16:30:30 -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=iFCp99H5pgAcYpyj/eWtk8lc+DYYfAe5CJNYFpaAAbI=; b=6SpGlatyJylZwje9Eu9xD14jEz5LvgYHdFzGHkqpgMtsU/97zaVDZrj66s5gMrIW1XsDKor2idRUFi/NbqiHccUCakDTkuKT7efxxyTnmGBqRako3AOdlx1u7xkve+GpVlrbvroRsqDD1LhBOhVtgKTunkFvEUbH8ydqrc+mbJQ= Received: from MWHPR02MB2477.namprd02.prod.outlook.com (10.168.204.147) by MWHPR02MB2478.namprd02.prod.outlook.com (10.168.204.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Wed, 16 Nov 2016 21:30:23 +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 21:30:23 +0000 To: Dmitry Stogov CC: Julien Pauli , Zeev Suraski , "Nikita Popov" , "php-dev@coydogsoftware.net" , Joe Watkins , "rasmus@lerdorf.com" , "internals@lists.php.net" , Nikita Popov , "Anatol Belski (ab@php.net)" Thread-Topic: [PATCH] opcache bug #69090, prepend user identifier to keys Thread-Index: AQHSQFACD4h3upkAiEqzeDgxtnu8Qg== Date: Wed, 16 Nov 2016 21:30:23 +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;MWHPR02MB2478;6:k0LYE+ZVQfewEN0ejp/kvRVNuw/G0n4ZWO9tz0MPzOeb5k2PdUTNkD4bpmONOFpEwVSnjv/xkL1slKVi2XnuWAdpmbItQNSUTNzAx2K70upgE7u17HGWgS4q2OP0fJ7REIomXq+aJT9gxcezyWxaU8Vkr2qQlnn8IHfffr27hGwSr7+QQi8GD5mYykXWukp8WEuLheYdI2RuKhxIdCvnvAfYS/+GhC4V8Ys5gpA2anNRKBOlSsygt8zdyLUXC8TrbIaaUhaz1txGcBCSVTsX3b/6TujWLv62O4tWxX/z9nmjSZmZtm2+1y4mZOl0ynGY;5:9ROB+BP2vO/ksI7Yi/e+B6rLxyHP8DsFsdWgocEAjzxI4OB5icgXotmWt/BHkw7OZrbjb5Xc2Zo60eQsIM6vC4XWJ946bosWKqmICla9neTPibWPgU+IMAUNYwzP6HJq8U36qvgrPzwrkKmfZz2/8A==;24:1eksz0qJ8P2YE/lOOz1nBVq/LlGvZ6oxDRQbJ/Nh3CL+kvkQ962hAydfJGAZNMHAMHavmryqAxwlv8a1HMHTAb3fjj4mA7lw5Dq6e2dnjWI=;7:5FcY4Uh+x+7j7ZaZ+GB0nf0Px8AYLOHfxx91vD7FPLMHUbtIcQHhaa+dUycDcPM3KB2SvKugpCtDm1nQ35XX6vzuwJYvAHP1PJ+lBgJwMxg7B56KO93BlxUt5OKiX8QvSEE3RZhdcXTrLEl6rWHwVv18NkT1vDan1TipbZTMYLsHDzy5oZ+oRR27+zVPW4/BzudpNLCcDdyI+bvWHlQ09LZGFwWUUQVVHvAmk3dAk55aJb4gMpooH0ymupdreYiugoGc3RinoK3hZwtrvhQRrTm8eTrcmgZNd48vvVEzoL3vIUpa/xJZgy+ii4Ny8P9L4nT/46VCa0mTQNKYFxyfcGbtY2N9F+3kRYFoS63UQ/A= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(7916002)(377454003)(189002)(199003)(24454002)(7736002)(76576001)(305945005)(6200100001)(106356001)(86362001)(106116001)(7906003)(3660700001)(122556002)(74316002)(105586002)(99286002)(110136003)(33656002)(7696004)(6506003)(5660300001)(102836003)(189998001)(3846002)(92566002)(6862003)(3280700002)(6116002)(5890100001)(97736004)(66066001)(77096005)(2900100001)(2906002)(4326007)(81156014)(8676002)(68736007)(101416001)(229853002)(87936001)(81166006)(50986999)(606004)(54356999)(8936002)(9686002)(7846002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR02MB2478;H:MWHPR02MB2477.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: e319082b-afb1-4d8c-d11e-08d40e67c5fc x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR02MB2478; 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)(6042181);SRVR:MWHPR02MB2478;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2478; 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_MWHPR02MB2477D7FCAFCACB3A7BCA8B4CBFBE0MWHPR02MB2477namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2016 21:30:23.0801 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2478 Subject: Re: [PATCH] opcache bug #69090, prepend user identifier to keys From: dmitry@zend.com (Dmitry Stogov) --_000_MWHPR02MB2477D7FCAFCACB3A7BCA8B4CBFBE0MWHPR02MB2477namp_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable I think, it's better to disable bits permutation for both 32 and 64 bit sys= tems. And also disable opcache for request if root inode exceeds 2^32 on 32-bit s= ystems + emit warning. This should be a robust solution. Right? Thanks. Dmitry On Nov 17, 2016 12:09 AM, Dmitry Stogov wrote: https://www.quora.com/What-is-the-maximum-number-of-inodes-in-Linux-filesys= tems-I-found-suggestion-that-for-Ext4-it-is-4-billion-files-32-bit-number-I= s-it-true-for-XFS-and-or-BtrFS ________________________________ From: Dmitry Stogov Sent: Wednesday, November 16, 2016 11:56:45 PM To: Nikita Popov Cc: Dmitry Stogov; Julien Pauli; Zeev Suraski; Nikita Popov; php-dev@coydog= software.net; Joe Watkins; internals@lists.php.net; rasmus@lerdorf.com; Ana= tol Belski (ab@php.net) Subject: Re: [PATCH] opcache bug #69090, prepend user identifier to keys 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_MWHPR02MB2477D7FCAFCACB3A7BCA8B4CBFBE0MWHPR02MB2477namp_--