lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0_sotmv40qHkhE5M=PwEYLuJfX+uRFZvh9iGzhv6R6vw@mail.gmail.com>
Date:   Wed, 15 Jan 2020 16:03:12 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Pali Rohár <pali.rohar@...il.com>
Cc:     Namjae Jeon <linkinjeon@...il.com>,
        Namjae Jeon <namjae.jeon@...sung.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
        gregkh <gregkh@...uxfoundation.org>,
        Valdis Kletnieks <valdis.kletnieks@...edu>,
        Christoph Hellwig <hch@....de>, sj1557.seo@...sung.com
Subject: Re: [PATCH v10 09/14] exfat: add misc operations

On Wed, Jan 15, 2020 at 3:24 PM Pali Rohár <pali.rohar@...il.com> wrote:
> On Wednesday 15 January 2020 14:50:10 Arnd Bergmann wrote:
> > On Wed, Jan 15, 2020 at 2:38 PM Pali Rohár <pali.rohar@...il.com> wrote:
> > > On Wednesday 15 January 2020 22:30:59 Namjae Jeon wrote:
> > > > 2020-01-15 19:10 GMT+09:00, Arnd Bergmann <arnd@...db.de>:
> > However, in user space, every user may set their own timezone with
> > the 'TZ' variable, and the default timezone may be different inside of a
> > container based on the contents of /etc/timezone in its root directory.
>
> So kernel timezone is shared across all containers, right?

Yes.

> > You can use it to access removable media that were written in
> > a different timezone or a partition that is shared with another OS
> > running on the same machine but with different timezone settings.
>
> So... basically all userspace <--> kernel API which works with timestamp
> do not have information about timezone right? creat(), utime() or
> utimensat() just pass timestamp without timezone information. Is this
> timestamp mean to be in UTC or in local user time zone (as specified by
> user's TZ= env variable)?

As a rule, all timekeeping in the kernel is done in terms of UTC. You can
see what the current exceptions are using

$ git grep -wl sys_tz
Documentation/filesystems/vfat.txt
arch/alpha/kernel/osf_sys.c
arch/nds32/kernel/vdso.c
arch/powerpc/kernel/time.c
arch/s390/kernel/time.c
arch/sparc/kernel/vdso.c
drivers/media/platform/vivid/vivid-rds-gen.c
drivers/media/platform/vivid/vivid-vbi-gen.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-sas.c
drivers/scsi/aacraid/commsup.c
drivers/scsi/arcmsr/arcmsr_hba.c
drivers/scsi/mvumi.c
drivers/scsi/mvumi.h
drivers/scsi/smartpqi/smartpqi_init.c
fs/affs/amigaffs.c
fs/affs/inode.c
fs/affs/super.c
fs/fat/misc.c
fs/hfs/hfs_fs.h
fs/hfs/inode.c
fs/hfs/sysdep.c
fs/hpfs/hpfs_fn.h
fs/udf/udftime.c
include/linux/time.h
kernel/debug/kdb/kdb_main.c
kernel/time/ntp.c
kernel/time/time.c
kernel/time/timekeeping.c
kernel/time/vsyscall.c
net/netfilter/nft_meta.c
net/netfilter/xt_time.c
tools/testing/selftests/x86/test_vdso.c

The vdso and kernel/time/ code are for maintaining the timezone through
settimeofday()/gettimeofday(), and the drivers should probably all be changed
to use UTC. The file systems (affs, fat, hfs, hpfs and udf) do this for
compatibility with other operating systems that store the metadata in
localtime.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ