Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1scJtW-00696O-Oe for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2024 07:18:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1scJtV-001gt2-9j for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2024 07:18:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1scJtU-001gsu-RL for pgsql-hackers@lists.postgresql.org; Fri, 09 Aug 2024 07:18:36 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1scJtR-003qKN-5r for pgsql-hackers@lists.postgresql.org; Fri, 09 Aug 2024 07:18:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1723187909; bh=CI/3ynrwsfC/kWEU9ejfTH8F4AlUpbdceEAPiFtbXtM=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=NeaEekHYJPjaVC+KYgi4CEPTC2IXiTa/GvDrQWAsUTLPV9DW8N3br/3dlyMe2+PB+ p5h1r5AOlg6fdvVS2gIHCoE98sbU/PHNRBrIAft0blHeB/7rOqW+Q19zHBTqD+GD4X VErvI5UvMqRw5laWiyIuIfjjXSunXTDwK+Fbr1sTz690VlJN7AUdV6HO9sJobR6rP8 rlLBS8SZucUAznhkMXCWxlwViDeYHb2ldiSP1aJ6LCKGG5DJN4Hzr0AVnVXBAsyRqD LLFQHhz87mJiMikLmOgRJp/FnKhCVHwi9CBX7a1lFLnPLYopy36Zo6qYKDK6wGy0vz iKAjElxZqGdnA== Received: from [172.30.2.66] (unknown [172.30.2.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: d.koval@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 53035601F7; Fri, 9 Aug 2024 10:18:29 +0300 (MSK) Content-Type: multipart/mixed; boundary="------------wGIhqGkxyhBcThZzJwPAOdGq" Message-ID: <19c1e04c-2012-4475-8460-821dd633a6ce@postgrespro.ru> Date: Fri, 9 Aug 2024 10:18:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Noah Misch , Alexander Korotkov Cc: pgsql-hackers@lists.postgresql.org References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <171085858750.2046434.12246066729700037354.pgcf@coridan.postgresql.org> <909e16b4-9eda-435c-b033-8294ae4adc05@postgrespro.ru> <3a4b9c1c-3edf-4e29-9629-b4113aefb0f3@postgrespro.ru> <20240808171351.a9.nmisch@google.com> Content-Language: en-US From: Dmitry Koval In-Reply-To: <20240808171351.a9.nmisch@google.com> X-KSMG-AntiPhishing: NotDetected, bases: 2024/08/09 06:47:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/08/09 06:04:00 #26267086 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------wGIhqGkxyhBcThZzJwPAOdGq Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > This breaks from the CVE-2014-0062 (commit 5f17304) principle of not repeating > name lookups. The attached demo uses this defect to make one partition have > two parents. Thank you very much for information (especially for the demo)! I'm not sure that we can get the identifier of the newly created partition from the ProcessUtility() function... Maybe it would be enough to check that the new partition is located in the namespace in which we created it (see attachment)? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com --------------wGIhqGkxyhBcThZzJwPAOdGq Content-Type: text/plain; charset=UTF-8; name="namespace-check.diff" Content-Disposition: attachment; filename="namespace-check.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL2NvbW1hbmRzL3RhYmxlY21kcy5jIGIvc3JjL2Jh Y2tlbmQvY29tbWFuZHMvdGFibGVjbWRzLmMKaW5kZXggMGIyYTUyNDYzZi4uYTE5MzdkMDc4 YiAxMDA2NDQKLS0tIGEvc3JjL2JhY2tlbmQvY29tbWFuZHMvdGFibGVjbWRzLmMKKysrIGIv c3JjL2JhY2tlbmQvY29tbWFuZHMvdGFibGVjbWRzLmMKQEAgLTIwMzg4LDYgKzIwMzg4LDE0 IEBAIGNyZWF0ZVBhcnRpdGlvblRhYmxlKFJhbmdlVmFyICpuZXdQYXJ0TmFtZSwgUmVsYXRp b24gbW9kZWxSZWwsCiAJICovCiAJbmV3UmVsID0gdGFibGVfb3BlbnJ2KG5ld1BhcnROYW1l LCBOb0xvY2spOwogCisJLyogQ2hlY2sgZm9yIGNhc2UgbmFtZXNwYWNlIHdhcyByZW5hbWVk IGR1cmluZyBwYXJ0aXRpb24gY3JlYXRpb24uICovCisJaWYgKFJlbGF0aW9uR2V0TmFtZXNw YWNlKG5ld1JlbCkgIT0gUmVsYXRpb25HZXROYW1lc3BhY2UobW9kZWxSZWwpKQorCQllcmVw b3J0KEVSUk9SLAorCQkJCShlcnJjb2RlKEVSUkNPREVfV1JPTkdfT0JKRUNUX1RZUEUpLAor CQkJCSBlcnJtc2co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