Received: by 10.223.176.46 with SMTP id f43csp121561wra; Thu, 25 Jan 2018 18:41:33 -0800 (PST) X-Google-Smtp-Source: AH8x225XBq72AVmGJing5WXe8anYjsOzzbLMDm2BCX7AAlkMpPJnHyFARKHA30qRQCXnwo2gUiWD X-Received: by 10.101.72.69 with SMTP id i5mr10907999pgs.9.1516934493185; Thu, 25 Jan 2018 18:41:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516934493; cv=none; d=google.com; s=arc-20160816; b=nV2/O+kmY0p4gKt76MSzKfLDBv1XpljUEeiPzKGeVNTBXwo9GTSt+TaaWpG2pYZoGr rV1U4Z30t1cAVxzo8mnBduN/j4Lj/UiB+QBaduva8yEuuAfuaiTtHb8JwaqsvWEld1o0 uCgUTENk79PhJ4G1vMayMCkZhQ5MDnWwOGUfpYUJWSHQwzVxqQDKycOqhv6zm76nE11z mM/mcmZ+nSVTu8vcuQ3KjtI0cEM7IQ4N8g0tvHsV8dufp6h19ZySM9zUZpWFemDVNwVB uwHyHR5l4ZZabn+dUia/L3S+7H6tEj0iSKK6D9cVmrgcwjNd2AzEgVq203LXRYFy+nuV 1f2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=F053r7RWX8SHycT0uyBMr1DX2oxlEvhrLJ0+/ekaXYI=; b=P4AR8OCGana/LlGtg47pUTe/kU7yCU9YU2whdMXXx49PwTjkizK4j/XL+1POT7X6FD VKGNsiVX4TiFOYFZcMfq1jBnYq3h869TF/6QHyYjNO/RGdXoXSkmM6wI2hcX+oTQIdGT GsdtLlQieWXlUmVM65skVrnI3Rl386h3/M9eZ4ZlirJT9RObvvl5JDuyR1mRxDmHDip3 J9upPH4iHu774a4JB35a53FFJ18wzUJ3YARxZg7E7Hw8YUdTxVLxP7jQulkcYAZs23fJ VwJq+tYtridoGcRbJJ5BVX+IYLUZaalPmg/FcTxxRhGAdKoTSCJyXc1Qw4dpm4F7Ochz uFUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@landley-net.20150623.gappssmtp.com header.s=20150623 header.b=ABsQZ61X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9-v6si3040766plk.94.2018.01.25.18.41.19; Thu, 25 Jan 2018 18:41:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@landley-net.20150623.gappssmtp.com header.s=20150623 header.b=ABsQZ61X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751809AbeAZCkM (ORCPT + 99 others); Thu, 25 Jan 2018 21:40:12 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:36664 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688AbeAZCkJ (ORCPT ); Thu, 25 Jan 2018 21:40:09 -0500 Received: by mail-it0-f67.google.com with SMTP id p124so357973ite.1 for ; Thu, 25 Jan 2018 18:40:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=F053r7RWX8SHycT0uyBMr1DX2oxlEvhrLJ0+/ekaXYI=; b=ABsQZ61XhzP7DdiK4d9bKrnXPBFI0mGe10FVzYoSf3NESJ3vxVbQE3tKCk4aWvrE0B tWHOVebNQVVaGUHqPGSLzK6O7Iuy7Zicq+sy8616hSt6TH23/EMTm+XvuKxHLSouMW+D VnhmiADZLdvmOmJotGZyU1q9E7TcxnPxV7Vk9h0svw0b4sAqA8GNZ9Xxk4BCD8xqdYh8 FXDqB6DC0ccoJ25KFpTSjxLUW2eqGTJiu/5d4ZVhlSERbHrr4/h7G6CDHDpyAbRD3u/G 2c/3/tWzPTIkcyWXe+NSBvjDnhu01swLFB79g4KDk72I1ajioTm5ZfoPRqwQZ+4Rv9wi y+Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F053r7RWX8SHycT0uyBMr1DX2oxlEvhrLJ0+/ekaXYI=; b=r60MhazJBqXQGxnZnaSQHNZinLe2975aFZcOeTWZgGRtZqitwtP3P141dFDxzACWMI BdLp5EJ7GrcILsMWbcT95nvzxUb68CInFGAQjSLsK0/XnazqnaUYv8c88ba7RtHbrnYK 4pPLeLYtKwEz4xy6iSH36uHHWQjsQuYk+o+uAJXg8W5uAU/KbJjc+kRn05CsIGVet2sF 2Era+rYQi9WJONvwHQnGXWdy0dE5BYWD2UfISow2w6N9p20+0lyzqa0swo1gKGnJarzs qnCGjFfFOcjdO+z0qDw6CEBF4oYmcOcHIVFFQWDJxxeD73ZfnKS2DVEBW+a6P+TCevM6 FO1A== X-Gm-Message-State: AKwxytdrg3kAxBcCSt4kUfrDge2DTiJg19AxL0axT519kF1+xgdw0Oj6 /xVZohg/sMGev6fUrYxVSUO/mQ== X-Received: by 10.36.221.2 with SMTP id t2mr15321217itf.0.1516934409202; Thu, 25 Jan 2018 18:40:09 -0800 (PST) Received: from [192.168.42.25] ([172.58.120.191]) by smtp.googlemail.com with ESMTPSA id b13sm84174ioe.77.2018.01.25.18.40.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 18:40:08 -0800 (PST) Subject: Re: [PATCH v2 01/15] Documentation: add newcx initramfs format description To: Arnd Bergmann , Taras Kondratiuk Cc: "H. Peter Anvin" , Al Viro , Mimi Zohar , Jonathan Corbet , James McMechan , initramfs@vger.kernel.org, Victor Kamensky , linux-doc@vger.kernel.org, Linux Kernel Mailing List , LSM List , xe-linux-external@cisco.com References: <1516850875-25066-1-git-send-email-takondra@cisco.com> <1516850875-25066-2-git-send-email-takondra@cisco.com> From: Rob Landley Message-ID: <0725a45f-45ee-7346-12ee-c3cc4b862654@landley.net> Date: Thu, 25 Jan 2018 20:39:56 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/25/2018 03:29 AM, Arnd Bergmann wrote: > On Thu, Jan 25, 2018 at 4:27 AM, Taras Kondratiuk wrote: >> Many of the Linux security/integrity features are dependent on file >> metadata, stored as extended attributes (xattrs), for making decisions. >> These features need to be initialized during initcall and enabled as >> early as possible for complete security coverage. >> >> Initramfs (tmpfs) supports xattrs, but newc CPIO archive format does not >> support including them into the archive. >> >> This patch describes "extended" newc format (newcx) that is based on >> newc and has following changes: >> - extended attributes support >> - increased size of filesize to support files >4GB. >> - increased mtime field size to have usec precision and more than >> 32-bit of seconds. >> - removed unused checksum field. >> >> Signed-off-by: Taras Kondratiuk >> Signed-off-by: Mimi Zohar >> Signed-off-by: Victor Kamensky > > Ah nice, I like the extension of the time handling, that certainly > addresses one of the issues with y2038 that we have previously > hacked around in an ugly way (interpreting the 32-bit > number as unsigned). Taras and I exchanged email like a year ago working out format stuff, so I don't have any real complaints. My feedback's already worked in, and I can make toybox cpio support -h newcx as soon as the format's finalized and I get a free weekend. That said, I don't think -h newcx should emit (or recognize) the "TRAILER!!!1!" entry. That's kinda silly in-band signaling for 2018: files have a length, pipes provide EOF, and each cpiox entry starts with 6 bytes of c_magic anyway. (I stopped toybox from producing the TRAILER entry back in june, toybox commit 32550751997d, and the kernel consumes the resulting cpio just fine. All the trailer does is prevent you from concatenating cpio files, which is a feature multiple people asked me for.) > However, if this is to become a generally supported format > for cpio files, After Joerg Schilling dies (or admits solaris has) it might even make it into posix. > could we make it use nanosecond resolution > instead? The issue that I see with microseconds is that > storing a file in an archive and extracting it again would > otherwise keep the mtime stamp /almost/ identical on file > systems that have nanosecond resolution, but most of > the time a comparison would indicate that the files are > not the same. I have no strong opinion on this? The tmpfs is still going to track nanoseconds, this is just rounding when it populates them. > Unfortunately, the range of a 64-bit nanoseconds counter > is still a bit limited (584 years, or half of that if we make it > signed). While this is clearly enough for the uses in > initramfs, it still has a similar problem: someone creating > a fake timestamp a long time in the past or future on > a file system would lose information after going though > cpio. Hence microseconds. This came up in email when we were talking about this (like a year ago) and I decided I didn't care. :) 64 bits of microseconds is +- 584 centuries, while being accurate enough[1] that making a getpid() syscall probably takes longer than that on our highest end boxen, let alone doing a dentry lookup in the vfs (even if it's hot in cache). Rob [1] Is future proofing an issue here? The s-curve of moore's law started bending down around y2k back when Intel had to recall its 1.13ghz pentium III for having overclocked its own chip at the factory, and it's pretty darn flat these days. Clock speeds first hit 4ghz 15 years ago and haven't been back, most of the work since 2005 has been about parallelism, and recent performance improvements are once again going to pentium 4 pipeline length levels of absurdity, as meltdown/spectre demonstrates (140 instructions of prefetch!??!?). Maybe intel will make 9 nanometer manufacturing work, but atomic limits are already an issue. The problem with 1 second timestamps was you honestly could confuse "make" about which file was newer once an exec() could complete in the same second having done real work. That was the motivating issue causing the change, going to nanoseconds was just the big hammer of "this is large enough it won't matter again in our lifetimes". But nanosecond time stamps are recording more jitter than useful information, and that seems unlikely to change this century?