Return-Path: Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by mail.openembedded.org (Postfix) with ESMTP id 3CCA97ED8E for ; Fri, 16 Aug 2019 21:47:36 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id x7GLkC36026337 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 16 Aug 2019 14:46:54 -0700 Received: from soho-mhatle-m.local (172.25.36.226) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.468.0; Fri, 16 Aug 2019 14:46:35 -0700 To: Khem Raj , Richard Purdie References: <20190816210605.62377-1-jason.wessel@windriver.com> <283ea4a282885878d26308925690e3428a08c841.camel@linuxfoundation.org> From: Mark Hatle Openpgp: preference=signencrypt Autocrypt: addr=mark.hatle@windriver.com; prefer-encrypt=mutual; keydata= mQENBFYKxFgBCACt/pzutBp6p/xVKTFJjHbM3KpQKCblyot/YP+bpTr51Hrc5xDXBQhoG7TC aIRvRIvbhEevEQK9y04gW3JK/5lobq5ORebolcsHlYBUvpNeIPjupLQwGvz/TPtrLRNGLqDC rvsM6OA2XbQ2bwzxWaSQS3ImE2O2iXOZn9HhThMGeDB4Nff3fgUvXOTDIrgWOn9K2DgLL7Yc zkUIlFdj+Nraksd/7BSk8oH6tjeBVhFqSFvKta9QxWgdr58oPaTYaW/xNqUjlLrbJuMw/MSe xzuYfdfDfm6J8kRjMOnwQ0n8svJElzqAk+d83ow38gpGQ+LkjGgnf8ZFJ4rUJFADroX3ABEB AAG0JU1hcmsgSGF0bGUgPG1hcmsuaGF0bGVAd2luZHJpdmVyLmNvbT6JATcEEwEIACEFAlYK xFgCGwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQfv796/r0vvlvZAf9Gs+eN320yhRW V/fZCsngKhmOK4v3HrTwFrkSmoD9QHQiE/5IPdNacHwIPwZx07tNBohB8xOeNqCPRYRBwGhA AnxKOPyd0nnm6ZhPzbA57v4x3IGRQr4QzvcBTASJq91l3Ew4lpAslyx5w1DPPqRD7G8ycDKg peKyDwmdkvCunVisSAQI3XIMq2y230biTO98tDPEezg+lg+yTsz9ZT33F5KNuWrpf8VL5fG/ mt+kAv7wtsx/KTRbqhH3iFXF6eBSwMjAfTXFlkLfbM9riJGXrWEl9n2S2R3cDHNHug0lb8f4 whK370KEO4OwRKIYW/VUBmzk5XZUE9DTlDSV8ycsrrkBDQRWCsRYAQgAwK3FuHCE+HW3YWdH PUjeSn5p//xJ57u8g2rng8zm9zNjmYgpPv5UxozaD9i2jf4mlQLHGGOezhHae8K4Nj70oVcv 8AmwcrJa9i9WL1oy/9R3fHMWf/Ctt9VXTO0qlCuq6PDzaUfvsXR61aJIjTKNQTOjCLjY1vXm VSewUgARysmA8WrjTfwGBihMBxAX0+kIjx8nOlam0WvekMBXZ0AbS56oTLRxYao6DI3GeB/N oWPy/5DfuTKaSdM0Pf8al20x9RuNN5/HLMlyDH/k8bIa1xd9aAqW+Feiw5gC107V2E6ULyIy q6em2UrsmIRxrvpHqbNgQKqvTehJ+V/i4g/uOwARAQABiQEfBBgBCAAJBQJWCsRYAhsMAAoJ EH7+/ev69L755XAH/3ZcNhooqd9OBhFkvXm1iWZ8EoC7motWqVn2oEyxoonsg8AD9kFXiN+T dYp7dH99EZu9q4ptj56AXm4uHzOgywL/5/V2TY6twCGAjUGzDjAB5gzoi+JLIBlDiyOip0eL QswIhRk473xy3j8DA4oVamnSPWgyNJ+qsdt37YWDzoDFFvtDoRU7Eb+znfIMDKzlny0XU/8L cW1bNHJlpv/78GPdfP4tjysEd8MuA5jf5o5w4XqcwTqalffEJtQ/s3pbkstEi7qm5uPui5Kt gq6YYLSqcSNe0GWAF9/T+qwyo7burSTxUWCWtMmlXdAQLW9SynLhB3Jbch0nFAh0fCKi6yY= Organization: Wind River Systems Message-ID: <15cbc240-5951-0b2b-45df-7f937ae09134@windriver.com> Date: Fri, 16 Aug 2019 16:46:34 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Cc: Patches and discussions about the oe-core layer Subject: Re: [RFC PATCH 1/2] cross-localedef-native: Add hardlink resolver from util-linux X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2019 21:47:36 -0000 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit On 8/16/19 4:29 PM, Khem Raj wrote: > On Fri, Aug 16, 2019 at 2:25 PM Richard Purdie > wrote: >> >> On Fri, 2019-08-16 at 14:22 -0700, Khem Raj wrote: >>> On Fri, Aug 16, 2019 at 2:06 PM Jason Wessel < >>> jason.wessel@windriver.com> wrote: >>>> The hard link resolver that is built into localedef cannot be run >>>> in >>>> parallel. It will search sibling directories (which are be >>>> processed >>>> in parallel) and perform a creation of a .tmp file and remove the >>>> original and move the .tmp file in. The problem is that if a probe >>>> occurs a hard link can be requested to the file that is being >>>> removed. >>>> This will lead to a stray copy or potentially, on a loaded system >>>> cause race condition which pseudo cannot deal with, where it is >>>> left >>>> with a hard link request to a file that no longer exists. In this >>>> situation psuedo will inherit the permissions of what ever the >>>> target >>>> inode had to offer. >>>> >>>> In short, there are two problems: >>>> >>>> 1) You will be left with stray copies when using the hard link >>>> resolution that is built in while running in parallel with >>>> localedef. >>>> >>>> 2) When running under pseudo the possibility exists for uid/gid >>>> leakage when the source file is removed before the hard link >>>> can >>>> be completed. >>>> >>>> The solution is to call localedef with --no-hard-links and >>>> separately >>>> process the hardlinks at a later point. To do this requires the >>>> inclusion of the hardlink utility found in modern versions of >>>> util-linux. Most host systems do not have this, so it will be >>>> included with the cross-localedef binary. >>>> >>> >>> can we depend on util-linux-native for this ? >> >> This was discussed on IRC. We really really want to avoid that as a >> dependency if we care about build performance. Its really easy to just >> add that in but the implications are significant :( >> > > A captured version of this utility would also mean that we have to > keep this in sync > for bug fixes and security fixes etc. which could also be considered > as expense, so > how much do we lose if util-linux-native is brought early into dependency chain? security should not be a significant concern here as the utility is only local (and used by) the localdef build (consider it an internal to the recipe) tool. So I'm not concerned about that. As for the bug fixes, this utility is quite stable and the last changes were simply to move it from a standalone utility into util-linux. So again, I find it unlikely but again since it's an internal tool unless it impacted the cross localedef functionality it's unlikely to be a problem. Longer term, as hardlink becomes standard on distributions then the need for the local tool should go away, and it can be removed at that time. But currently it's only common on Red Hat lineage machines, while Debian and Ubuntu either have their own versions, or it's "optional" and not part of the regular distribution (even though it comes from util-linux). --Mark >> Cheers, >> >> Richard >> >> >>