Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96937 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80258 invoked from network); 16 Nov 2016 21:09:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 21:09:29 -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.36.127 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.36.127 mail-sn1nam02on0127.outbound.protection.outlook.com Received: from [104.47.36.127] ([104.47.36.127:21920] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/67-05303-60BCC285 for ; Wed, 16 Nov 2016 16:09:28 -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=RN6r6aQluEt3AH/p+UM2JflN91DH1D2eNjdwZTZxGZ8=; b=wcwbfUKIbATCLSEvI3zLt9DPrGs4HoeM6TA+8e261LQmXqMSJcn1UndcxIrLm/9uo3qYT1bRDOcSUyuQ5ekXu0AZZgmg8li5502isyFLWyCb+TP6g7znCg5IEzsbWwouruhhaiLy1by5+tG/LQWIob+rA5TMFCvg5MXQhL1Og6s= Received: from MWHPR02MB2477.namprd02.prod.outlook.com (10.168.204.147) by DM2PR02MB301.namprd02.prod.outlook.com (10.141.83.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Wed, 16 Nov 2016 21:09:19 +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:09:18 +0000 To: Nikita Popov CC: 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: AQHSQEg2D4h3upkAiEqzeDgxtnu8QqDcGrMC Date: Wed, 16 Nov 2016 21:09:18 +0000 Message-ID: References: In-Reply-To: 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-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [25.164.163.132] x-microsoft-exchange-diagnostics: 1;DM2PR02MB301;7:18K24DPllwj08wSZ+YKfAXktxgeNF8CCCGSWASAxOt1zbOG9XCgjRL9rHlgGN9sw//Y45VYkhYkGUl9SZpeLypghD3JzR4+4Dk93KtfKyCumKr8O1j5GKIju5nTyjHihl/7ZSEpD91xr09vALPiIBV/C4vhRb4uUi6ID7gCIg3zoVLZJJ0REJUe3DqdVeqAwapXMj3sccd/C827cPlBcLxQOm1VeliIju8OYMn2KBpRZDDhCqyvqpCC8WT1lTTl81RlUPB45pgw6qQWnFhChGQwy1U1EwEy+Zs29MXXyYNJUBMNbfhHLuVpaauWdnyqyMlXvGxDCZupBSulniAhUCgoJsjvcPZm425eMfzRHKy4= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(7916002)(377454003)(189002)(24454002)(199003)(86362001)(33656002)(2900100001)(92566002)(101416001)(7846002)(106356001)(87936001)(189998001)(68736007)(7696004)(77096005)(5890100001)(74316002)(6506003)(76576001)(54356999)(7906003)(3280700002)(97736004)(76176999)(50986999)(7736002)(5660300001)(3846002)(6116002)(105586002)(19627405001)(102836003)(3660700001)(4326007)(66066001)(122556002)(81166006)(2906002)(8936002)(8676002)(81156014)(229853002)(110136003)(106116001)(9686002)(2950100002)(606004)(6916009)(99286002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR02MB301;H:MWHPR02MB2477.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 5281250f-69a2-4129-5055-08d40e64d437 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM2PR02MB301; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6060326)(6040281)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041223)(6061324);SRVR:DM2PR02MB301;BCL:0;PCL:0;RULEID:;SRVR:DM2PR02MB301; 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_MWHPR02MB247781674FC2E4D247B108ACBFBE0MWHPR02MB2477namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2016 21:09:18.4014 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB301 Subject: Re: [PATCH] opcache bug #69090, prepend user identifier to keys From: dmitry@zend.com (Dmitry Stogov) --_000_MWHPR02MB247781674FC2E4D247B108ACBFBE0MWHPR02MB2477namp_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable 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_MWHPR02MB247781674FC2E4D247B108ACBFBE0MWHPR02MB2477namp_--