Dear Customer,
This is to confirm that your item has been shipped at March 12.
Please review delivery label in attachment!
Thanks,
Salvador Bryan,
UPS Chief Operation Agent.
On Wed, Feb 22, 2017 at 9:05 AM, Albert ARIBAUD <albert.aribaud(a)3adev.fr> wrote:
> Hi all,
>
> I have produced a fifth draft of what will eventually become the Y2038
> design document:
>
> https://sourceware.org/glibc/wiki/Y2038ProofnessDesign?rev=115
>
> Relative to the previous draft:
>
> * It makes explicit that the implementation should allow the same
> application source code to build unchanged whether the default for
> time size is 32-bit (_TIME_BITS undefined or unequal to 64) or
> 64-bit (_TIME_BITS defined equal to 64).
>
> * Security issues considerations have been added (thanks to Carlos
> O'Donnel).
>
> * Timestamps and IOCTLs sections have been expanded.
>
> * Implementation examples for types has been added.
>
> * Implementation examples for APIs has been added.
>
> As always, comments welcome.
I found a few minor inaccuracies:
You have classified sched_rr_get_interval() as y2038-compatible, but
getrusage() as incompatible. I think these are both in one category,
either incompatible or a third category: we pass only intervals
here, so there won't be an overflow but redefining timeval still results
in an incompatible ABI, unless the structures are redefined in terms
of 32-bit types instead of time_t/timeval/timespec.
I've discussed the kernel side for "Y2038-incompatible socket
timestamping" with Deep a while ago, and I think we came to a
new conclusions for what would be the best approach. I'll let her
comment here.
For "Y2038-compatible types", please clarify whether time32_t
and time64_t (and related types) are internal-only types or visible
to applications through header files. I assume they are internal
only, but it is not 100% clear. Related to that, what is the expected
definition of time32_t on architectures that never had a 32-bit time_t,
such as existing 64-bit architectures? Is it left undefined and
all code referring to time32_t compiled conditionally?
In "Y2038-compatible struct timespec", replace "microseconds"
with "nanoseconds. Also, it's worth pointing out the known problems
with the padding:
- on big-endian systems, any code doing a variation of
"struct timespec ts = { seconds, nanos };" is broken because
it assigns the nanoseconds to the wrong struct member.
The example code is nonconforming as neither POSIX nor C11
require a particular order of the struct members, but I could also
easily find examples of existing programs doing this. Note that
NetBSD, OpenBSD and Windows have no padding but do use
64-bit time_t.
- If the padding is uninitialized, we have to explicitly zero it before
calling a kernel function that assumes the 64-bit layout. This can
be done in glibc before calling into the kernel, or at the kernel
entry (where my last patch set does it), but it is awkward either
way.
Unfortunately, there doesn't seem to be a good solution here
for either of the two problems. Maybe someone else has more
ideas. Using a pointer type for the padding would at least
cause a compile-time warning for broken code, other solutions
might require GCC extensions or break C11 in another way.
I'll comment on the kernel/glibc incompatibilities section tomorrow,
need to collect my thoughts there some more.
Arnd
The series is aimed at adding timestamp checking and policy
related to it to vfs.
The series was developed with discussions and guidance from
Arnd Bergmann.
The original thread is at https://lkml.org/lkml/2016/11/2/294
Associated test: xfstests generic/402
Note that the above test will be run and will fail all filesystems that
do not have correct limits specified in the xfstests or the kernel or
that don't support times beyond the test dates. I will be submitting a
follow up xfstest and kernel patches to update all filesystems.
Currently ext4 is the only filesystem that reflects correct limits.
The branch is available at
https://github.com/deepa-hub/vfs.git refs/heads/vfs_timestamp_policy
Changes since v3:
* Remove redundant initializations in libfs.c
* Change early_param to __setup similar to other root mount options.
* Fix documentation warning
Changes since v2:
* Introduce early boot param override for checks.
* Drop afs patch for timestamp limits.
Changes since v1:
* return EROFS on mount errors
* fix mtime copy/paste error in utimes
Deepa Dinamani (5):
vfs: Add file timestamp range support
vfs: Add checks for filesystem timestamp limits
ext4: Initialize timestamps limits
vfs: Add timestamp_truncate() api
utimes: Clamp the timestamps before update
fs/ext4/ext4.h | 4 ++++
fs/ext4/super.c | 7 ++++++-
fs/inode.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
fs/internal.h | 2 ++
fs/namespace.c | 12 ++++++++++++
fs/super.c | 9 +++++++++
fs/utimes.c | 17 +++++++++++++----
include/linux/fs.h | 4 ++++
include/linux/time64.h | 6 ++++++
include/uapi/linux/fs.h | 6 +++++-
kernel/sysctl.c | 7 +++++++
11 files changed, 114 insertions(+), 7 deletions(-)
--
2.7.4
Dear Customer,
Your parcel was successfully delivered February 21 to UPS Station, but our courier cound not contact you.
You can find more details in this e-mail attachment!
With thanks and appreciation,
Isaac Edwards,
UPS Parcels Delivery Manager.
The series is aimed at adding timestamp checking and policy
related to it to vfs.
The series was developed with discussions and guidance from
Arnd Bergmann.
The original thread is at https://lkml.org/lkml/2016/11/2/294
Associated test: xfstests generic/402
Note that the above test will be run and will fail all filesystems that
do not have correct limits specified in the xfstests or the kernel or
that don't support times beyond the test dates. I will be submitting a
follow up xfstest and kernel patches to update all filesystems.
Currently ext4 is the only filesystem that reflects correct limits.
The branch is available at
https://github.com/deepa-hub/vfs.git refs/heads/vfs_timestamp_policy
Changes since v2:
* Introduce early boot param override for checks.
* Drop afs patch for timestamp limits.
Changes since v1:
* return EROFS on mount errors
* fix mtime copy/paste error in utimes
Deepa Dinamani (5):
vfs: Add file timestamp range support
vfs: Add checks for filesystem timestamp limits
ext4: Initialize timestamps limits
vfs: Add timestamp_truncate() api
utimes: Clamp the timestamps before update
fs/ext4/ext4.h | 4 ++++
fs/ext4/super.c | 7 ++++++-
fs/inode.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
fs/internal.h | 2 ++
fs/libfs.c | 4 ++++
fs/namespace.c | 12 ++++++++++++
fs/super.c | 9 +++++++++
fs/utimes.c | 17 +++++++++++++----
include/linux/fs.h | 4 ++++
include/linux/time64.h | 6 ++++++
include/uapi/linux/fs.h | 6 +++++-
kernel/sysctl.c | 7 +++++++
12 files changed, 116 insertions(+), 7 deletions(-)
--
2.7.4
Cc: "Theodore Ts'o" <tytso(a)mit.edu>
Cc: Andreas Dilger <adilger.kernel(a)dilger.ca>
Cc: linux-ext4(a)vger.kernel.org
Dear Customer,
We can not deliver your parcel arrived at January 23.
You can find more details in this e-mail attachment!
With thanks and appreciation,
Jaime Solomon,
USPS Station Manager.
I would like to discuss approaches to finish preparing the kernel to
be y2038 ready.
Arnd started the effort a few years ago and I'm working on a few parts
of the problem.
Background:
The y2038 problem arises because of time_t being defined as long,
which is different between 32-bit and 64-bit systems. This leaves
insufficient bits to represent time on a 32-bit system from the year
2038. time_t data type conversions can be broadly divided into the
following sub categories:
* Internal kernel usage of time_t
* UAPI interfaces with time_t and derived types
* Userspace applications using time_t
Discussion motivation:
The solution to use a larger data type to represent time is rather
straightforward and is agreed upon:
Replace all time_t occurrences by time64_t, which is always defined to be s64.
The tricky part is how to reach the goal of this transition without
breaking backward compatibility of interfaces internal and external to
the kernel. This can be done in more than one way. After long
discussions, we have managed to get some initial clean up patches
merged. These will help the VFS transition to using time64_t. It is
now a good time to look at the remaining problems in changing time_t.
Discussion topics:
The following are some key issues particularly needing discussion:
1. Time types we plan to retain within the kernel and in system APIs.
We posted multiple series, there have been a few changes since then.
https://lkml.org/lkml/2014/5/30/669https://lkml.org/lkml/2016/1/7/20
2. Syscall transition: Arnd had posted a version of this. There are a
few updates here as well. I intend to post an update soon.
https://sourceware.org/ml/libc-alpha/2015-05/msg00070.html
3. Policy for filesystems that do not support a y2038 safe on-disk
representation: I posted a series and the initial xfstest patch.
https://lwn.net/Articles/705358/https://www.spinics.net/lists/y2038/msg01945.html
4. VFS transition to using struct timespec64: I posted a few revisions
and our approach has changed for the cleanup patches. A discussion
would help pick an approach.
https://lwn.net/Articles/675381/
-Deepa
Dear Customer,
We can not deliver your parcel arrived at January 01.
Download postal receipt attached to e-mail!
With sincere appreciation,
Chester Hendrix,
USPS Mail Delivery Agent.
CURRENT_TIME is not y2038 safe.
CURRENT_TIME macro is also not appropriate for filesystems
as it doesn't use the right granularity for filesystem
timestamps.
Logical Volume Integrity format is described to have the
same timestamp format for "Recording Date and time" as
the other [a,c,m]timestamps.
The function udf_time_to_disk_format() does this conversion.
Hence the timestamp is passed directly to the function and
not truncated. This is as per Arnd's suggestion on the
thread.
This is also in preparation for the patch that transitions
vfs timestamps to use 64 bit time and hence make them
y2038 safe. As part of the effort current_time() will be
extended to do range checks.
Signed-off-by: Deepa Dinamani <deepa.kernel(a)gmail.com>
Reviewed-by: Jan Kara <jack(a)suse.cz>
Reviewed-by: Arnd Bergmann <arnd(a)arndb.de>
---
fs/udf/super.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 4942549..967ad87 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1986,6 +1986,7 @@ static void udf_open_lvid(struct super_block *sb)
struct buffer_head *bh = sbi->s_lvid_bh;
struct logicalVolIntegrityDesc *lvid;
struct logicalVolIntegrityDescImpUse *lvidiu;
+ struct timespec ts;
if (!bh)
return;
@@ -1997,8 +1998,8 @@ static void udf_open_lvid(struct super_block *sb)
mutex_lock(&sbi->s_alloc_mutex);
lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
- udf_time_to_disk_stamp(&lvid->recordingDateAndTime,
- CURRENT_TIME);
+ ktime_get_real_ts(&ts);
+ udf_time_to_disk_stamp(&lvid->recordingDateAndTime, ts);
lvid->integrityType = cpu_to_le32(LVID_INTEGRITY_TYPE_OPEN);
lvid->descTag.descCRC = cpu_to_le16(
@@ -2019,6 +2020,7 @@ static void udf_close_lvid(struct super_block *sb)
struct buffer_head *bh = sbi->s_lvid_bh;
struct logicalVolIntegrityDesc *lvid;
struct logicalVolIntegrityDescImpUse *lvidiu;
+ struct timespec ts;
if (!bh)
return;
@@ -2030,7 +2032,8 @@ static void udf_close_lvid(struct super_block *sb)
mutex_lock(&sbi->s_alloc_mutex);
lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX;
lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;
- udf_time_to_disk_stamp(&lvid->recordingDateAndTime, CURRENT_TIME);
+ ktime_get_real_ts(&ts);
+ udf_time_to_disk_stamp(&lvid->recordingDateAndTime, ts);
if (UDF_MAX_WRITE_VERSION > le16_to_cpu(lvidiu->maxUDFWriteRev))
lvidiu->maxUDFWriteRev = cpu_to_le16(UDF_MAX_WRITE_VERSION);
if (sbi->s_udfrev > le16_to_cpu(lvidiu->minUDFReadRev))
--
2.7.4