[Y2038] Re: RTC hctosys disabled for 32-bit systems

2022-09-02 Thread Arnd Bergmann
On Thu, Sep 1, 2022, at 11:11 PM, Alexandre Belloni wrote: > On 01/09/2022 22:33:46+0200, Arnd Bergmann wrote: >> On Thu, Sep 1, 2022, at 6:02 PM, Russell King (Oracle) wrote: >> > On Thu, Sep 01, 2022 at 05:48:01PM +0200, Arnd Bergmann wrote: >> > >> >

[Y2038] Re: RTC hctosys disabled for 32-bit systems

2022-09-01 Thread Arnd Bergmann
On Thu, Sep 1, 2022, at 6:02 PM, Russell King (Oracle) wrote: > On Thu, Sep 01, 2022 at 05:48:01PM +0200, Arnd Bergmann wrote: > >> I think the systems that can send the timekeeping back into the early >> 1900s (or at least after 1970) are fine, the problem is the systems >>

[Y2038] Re: RTC hctosys disabled for 32-bit systems

2022-09-01 Thread Arnd Bergmann
On Thu, Sep 1, 2022, at 3:46 PM, Russell King (Oracle) wrote: > On Thu, Sep 01, 2022 at 03:12:57PM +0200, Arnd Bergmann wrote: >> Ah, I forgot that systemd actually needs it. So I guess there is >> currently no way to use systemd on 32-bit machines that are >> meant to sur

[Y2038] Re: RTC hctosys disabled for 32-bit systems

2022-09-01 Thread Arnd Bergmann
On Thu, Sep 1, 2022, at 3:57 PM, Alexandre Belloni wrote: > On 01/09/2022 15:12:57+0200, Arnd Bergmann wrote: >> As far as I remember, the workaround was only needed for >> certain devices that may set the time to something after 2038 >> on a depleted battery, but other device

[Y2038] Re: RTC hctosys disabled for 32-bit systems

2022-09-01 Thread Arnd Bergmann
On Thu, Sep 1, 2022, at 2:49 PM, Alexandre Belloni wrote: > On 01/09/2022 13:55:19+0200, Arnd Bergmann wrote: >> >> The only reliable fix I can see would be to disable >> CONFIG_RTC_HCTOSYS_DEVICE. I think this is Alexandre's plan >> for the long run anyway, but I don't

[Y2038] Re: RTC hctosys disabled for 32-bit systems

2022-09-01 Thread Arnd Bergmann
On Thu, Sep 1, 2022, at 1:31 PM, Reinier Kuipers wrote: > > I'm working to fix the y2038 issue for an existing sama5d3-based > product. This involves updating the kernel and glibc to appropriate > versions (5.10 and 2.35.1 respectively) and I got things running up to > a state where, from

[Y2038] Re: PROBLEM: with daemon.c after y2038 on 32-bits Kernel

2022-05-31 Thread Arnd Bergmann
(cc correct libc-alpha list, sorry for the typo) On Tue, May 31, 2022 at 10:24 AM Arnd Bergmann wrote: > On 17/05/2022 09:51, Arnaud Panaïotis wrote: > > I'm working for a client to generate embedded 32-bits Linux Kernel working > > after y2038 issue. > > > > I gene

[Y2038] Re: PROBLEM: with daemon.c after y2038 on 32-bits Kernel

2022-05-31 Thread Arnd Bergmann
On 17/05/2022 09:51, Arnaud Panaïotis wrote: > Hello, > > I'm working for a client to generate embedded 32-bits Linux Kernel working > after y2038 issue. > > I generated a 5.15 Kernel thought Buildroot with Coreutils 9.0, GCC 11.2.0, > Binutils 2.37, Glibc 2.34-9 and CFLAGS -D_LARGEFILE_SOURCE

Re: [Y2038] [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-19 Thread Arnd Bergmann
On Tue, Oct 19, 2021 at 4:16 PM Rich Felker wrote: > On Mon, Oct 18, 2021 at 04:42:04PM -0400, Rich Felker wrote: > > > > Well for little endian either would work (because adj is 0 :) but yes > > there are 3 such paddings before the second member on big endian, so > > it should be 3. > > How

Re: [Y2038] [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-18 Thread Arnd Bergmann
On Mon, Oct 18, 2021 at 5:08 PM Rich Felker wrote: > On Mon, Oct 18, 2021 at 04:58:03PM +0200, Takashi Iwai wrote: > > On Mon, 18 Oct 2021 16:43:00 +0200, Rich Felker wrote: > > No, I don't think so. The musl translator is to translate between the > time64 ioctl structures and the old time32 ones

Re: [Y2038] [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-08 Thread Arnd Bergmann
On Fri, Oct 8, 2021 at 2:06 PM Rich Felker wrote: > On Fri, Oct 08, 2021 at 11:24:39AM +0200, Arnd Bergmann wrote: > > > > I've tried to understand this part of musl's convert_ioctl_struct(), but I > > just > > can't figure out whether it does the convers

Re: [Y2038] [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-08 Thread Arnd Bergmann
On Fri, Oct 8, 2021 at 1:53 PM Takashi Iwai wrote: > On Fri, 08 Oct 2021 13:45:45 +0200, Arnd Bergmann wrote: > > On Fri, Oct 8, 2021 at 1:11 PM Takashi Iwai wrote: > > > On Fri, 08 Oct 2021 11:24:39 +0200, Arnd Bergmann wrote: > > > The below is a revised kernel p

Re: [Y2038] [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-08 Thread Arnd Bergmann
On Fri, Oct 8, 2021 at 1:11 PM Takashi Iwai wrote: > On Fri, 08 Oct 2021 11:24:39 +0200, Arnd Bergmann wrote: > > > > I've tried to understand this part of musl's convert_ioctl_struct(), but I > > just > > can't figure out whether it does the convers

Re: [Y2038] [musl] Re: [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-08 Thread Arnd Bergmann
On Fri, Oct 8, 2021 at 10:43 AM Takashi Iwai wrote: > On Thu, 07 Oct 2021 18:51:58 +0200, Rich Felker wrote: > > On Thu, Oct 07, 2021 at 06:18:52PM +0200, Takashi Iwai wrote: > > @@ -557,11 +558,15 @@ struct __snd_pcm_sync_ptr { > #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : >

Re: [Y2038] [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-07 Thread Arnd Bergmann
On Thu, Oct 7, 2021 at 2:43 PM Takashi Iwai wrote: > On Thu, 07 Oct 2021 13:48:44 +0200, Arnd Bergmann wrote: > > On Thu, Oct 7, 2021 at 12:53 PM Takashi Iwai wrote: > > > On Wed, 06 Oct 2021 19:49:17 +0200, Michael Forney wrote: > > > > As far as I can tell, th

Re: [Y2038] [alsa-devel] [PATCH v7 8/9] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2021-10-07 Thread Arnd Bergmann
On Thu, Oct 7, 2021 at 12:53 PM Takashi Iwai wrote: > On Wed, 06 Oct 2021 19:49:17 +0200, Michael Forney wrote: > > > > Arnd Bergmann wrote: > > > +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : > > > defined(__BIG_ENDIAN) > > > +typ

Re: [Y2038] ia32 signed long treated as x64 unsigned int by __ia32_sys*

2021-09-23 Thread Arnd Bergmann
On Thu, Sep 23, 2021 at 12:01 PM Richard Palethorpe wrote: > Arnd Bergmann writes: > > On Wed, Sep 22, 2021 at 10:46 AM Richard Palethorpe > > wrote: > >> Richard Palethorpe writes: > > > > I also noticed that only x86 and s390 even have separate entry

Re: [Y2038] ia32 signed long treated as x64 unsigned int by __ia32_sys*

2021-09-22 Thread Arnd Bergmann
On Wed, Sep 22, 2021 at 10:46 AM Richard Palethorpe wrote: > Richard Palethorpe writes: > > > > Then the output is: > > > > [ 11.252268] io_pgetevents(f7f19000, 4294967295, 1, ...) > > [ 11.252401] comparing 4294967295 <= 1 > > io_pgetevents02.c:114: TPASS: invalid min_nr: io_pgetevents()

Re: [Y2038] [PATCH] aio: Wire up compat_sys_io_pgetevents_time64 for x86

2021-09-21 Thread Arnd Bergmann
On Tue, Sep 21, 2021 at 3:01 PM Richard Palethorpe wrote: > > The LTP test io_pgetevents02 fails in 32bit compat mode because an > nr_max of -1 appears to be treated as a large positive integer. This > causes pgetevents_time64 to return an event. The test expects the call > to fail and errno to

Re: [Y2038] Trying Debian/armhf rebootstrap with time64

2020-03-23 Thread Arnd Bergmann
On Mon, Mar 23, 2020 at 7:21 PM Steve McIntyre wrote: > On Wed, Mar 11, 2020 at 01:52:00PM +0100, Arnd Bergmann wrote: > >* Adding a time64 armhf as a separate (incompatible) target in glibc > > that defines __TIMESIZE==64 and a 64-bit __time_t would avoid > > most of the

Re: [Y2038] Trying Debian/armhf rebootstrap with time64

2020-03-18 Thread Arnd Bergmann
On Mon, Mar 16, 2020 at 11:12 PM Lukasz Majewski wrote: > > On Fri, Mar 13, 2020 at 9:22 PM Rich Felker wrote: > > > > - Removing the time32 symbols from the glibc shared object did > > > > not work as they are still used (a lot) internally, and by the > > > > testsuite. > > > > > > That

Re: [Y2038] Trying Debian/armhf rebootstrap with time64

2020-03-16 Thread Arnd Bergmann
On Mon, Mar 16, 2020 at 3:47 PM Rich Felker wrote: > libtirpc is the replacement. I wasn't aware if uses libc-provided rpc > headers (presumably only if they exist, since folks are using it fine > on musl) but even if so I think the types will automatically update > when time_t changes. Of

Re: [Y2038] Trying Debian/armhf rebootstrap with time64

2020-03-16 Thread Arnd Bergmann
On Fri, Mar 13, 2020 at 9:22 PM Rich Felker wrote: > > On Wed, 11 Mar 2020 13:52:00 +01000, Arnd Bergmann wrote: > > As discussed before, I tried using the rebootstrap tool [1] to see what > > problems come up once the entire distro gets rebuilt. Based on Lukasz' > >

Re: [Y2038] Trying Debian/armhf rebootstrap with time64

2020-03-12 Thread Arnd Bergmann
[some mailing lists appear to have classified the earlier mail as spam, it was quite long and contained a lot of links. See https://lists.debian.org/debian-arm/2020/03/msg00032.html for the start of the thread if you did not get that] On Wed, Mar 11, 2020 at 3:37 PM Lukasz Majewski wrote: > >

[Y2038] Trying Debian/armhf rebootstrap with time64

2020-03-11 Thread Arnd Bergmann
As discussed before, I tried using the rebootstrap tool [1] to see what problems come up once the entire distro gets rebuilt. Based on Lukasz' recommendation, I tried the 'y2038_edge' branch with his experimental glibc patches [2], using commit c2de7ee9461 dated 2020-02-17. Here is a rough

[Y2038] [GIT PULL] compat-ioctl fix for v5.6

2020-02-08 Thread Arnd Bergmann
testing on 64-bit kernels. Let's fix it in -rc1 before others run into the same issue. Arnd Bergmann (1): compat_ioctl: fix FIONREAD on devices fs/ioctl.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions

[Y2038] [GIT PULL] y2038: core, driver and file system changes

2020-01-29 Thread Arnd Bergmann
rnel/git/arnd/playground.git/log/?h=y2038-endgame [2] https://lore.kernel.org/lkml/20191108213257.3097633-1-a...@arndb.de/ ---- Arnd Bergmann (21): fat: use prandom_u32() for i_generation dlm: use SO_SNDTIMEO_NEW instead of SO

Re: [Y2038] [PATCH] hcidump: add support for time64 based libc

2020-01-11 Thread Arnd Bergmann
was On Sat, Jan 11, 2020 at 12:32 AM Guy Harris wrote: > > On Jan 10, 2020, at 1:19 PM, Arnd Bergmann wrote: > > > On Fri, Jan 10, 2020 at 10:05 PM Rich Felker wrote: > >> > >> On Fri, Jan 10, 2020 at 09:49:03PM +0100, Arnd Bergmann wrote: > >>>

Re: [Y2038] [PATCH] hcidump: add support for time64 based libc

2020-01-10 Thread Arnd Bergmann
On Fri, Jan 10, 2020 at 10:05 PM Rich Felker wrote: > > On Fri, Jan 10, 2020 at 09:49:03PM +0100, Arnd Bergmann wrote: > > musl is moving to a default of 64-bit time_t on all architectures, > > glibc will follow later. This breaks reading timestamps through cmsg > > data

[Y2038] [PATCH] hcidump: add support for time64 based libc

2020-01-10 Thread Arnd Bergmann
the dependencies first. libpcap has the same bug and needs a similar fix to work on future 32-bit Linux systems. Everything else apparently uses the generic SO_TIMESTAMP timestamps, which work correctly when using new enough kernels with a time64 libc. Signed-off-by: Arnd Bergmann --- monitor/hcidump.c | 32

Re: [Y2038] [RFC] y2038: HCI_TIME_STAMP with time64

2020-01-10 Thread Arnd Bergmann
On Fri, Jan 10, 2020 at 4:44 PM Marcel Holtmann wrote: > > I noticed earlier this week that the HCI_CMSG_TSTAMP/HCI_TIME_STAMP > > interface has no time64 equivalent, as we apparently missed that when > > converting the normal socket timestamps to support both time32 and time64 > > variants of

[Y2038] [PATCH 3/3] y2038: hide timeval/timespec/itimerval/itimerspec types

2020-01-10 Thread Arnd Bergmann
There are no in-kernel users remaining, but there may still be users that include linux/time.h instead of sys/time.h from user space, so leave the types available to user space while hiding them from kernel space. Only the __kernel_old_* versions of these types remain now. Signed-off-by: Arnd

[Y2038] [PATCH 1/3] y2038: remove ktime to/from timespec/timeval conversion

2020-01-10 Thread Arnd Bergmann
A couple of helpers are now obsolete and can be removed, so drivers can no longer start using them and instead use y2038-safe interfaces. Signed-off-by: Arnd Bergmann --- include/linux/ktime.h | 37 - 1 file changed, 37 deletions(-) diff --git a/include

[Y2038] [PATCH 2/3] y2038: remove unused time32 interfaces

2020-01-10 Thread Arnd Bergmann
No users remain, so kill these off before we grow new ones. Signed-off-by: Arnd Bergmann --- include/linux/compat.h| 29 --- include/linux/time32.h| 154 +- include/linux/timekeeping32.h | 32 --- include/linux/types.h | 5

[Y2038] [PATCH 0/3] y2038: remove unused interfaces

2020-01-10 Thread Arnd Bergmann
/linux/time32.h and some other related code can be removed from the kernel, so it would be good to send these at the end of the coming merge window, and to give them some more testing in linux-next to make sure we don't gain any new users. Arnd Arnd Bergmann (3): y2038: remove ktime to/from

[Y2038] [RFC] y2038: HCI_TIME_STAMP with time64

2020-01-10 Thread Arnd Bergmann
I noticed earlier this week that the HCI_CMSG_TSTAMP/HCI_TIME_STAMP interface has no time64 equivalent, as we apparently missed that when converting the normal socket timestamps to support both time32 and time64 variants of the sockopt and cmsg data. The interface was originally added back in

Re: [Y2038] [GIT PULL v3 00/27] block, scsi: final compat_ioctl cleanup

2020-01-03 Thread Arnd Bergmann
On Fri, Jan 3, 2020 at 1:22 AM Ben Hutchings wrote: > > On Thu, 2020-01-02 at 15:55 +0100, Arnd Bergmann wrote: > [...] > > Changes since v2: > > - Rebase to v5.5-rc4, which contains the earlier bugfixes > > - Fix sr_block_compat_ioctl() error handling bug f

[Y2038] [PATCH v3 2/2] xfs: quota: move to time64_t interfaces

2020-01-02 Thread Arnd Bergmann
2106 on 32-bit instead of year 2038. Note that common user space tools using the XFS quotactl interface instead of the generic one still use the y2038 dates. To fix quotas properly, both the on-disk format and user space still need to be changed. Signed-off-by: Arnd Bergmann --- This has a small

[Y2038] [PATCH v3 1/2] xfs: rename compat_time_t to old_time32_t

2020-01-02 Thread Arnd Bergmann
The compat_time_t type has been removed everywhere else, as most users rely on old_time32_t for both native and compat mode handling of 32-bit time_t. Remove the last one in xfs. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Arnd Bergmann --- As explained in https

Re: [Y2038] [PATCH 2/3] xfs: disallow broken ioctls without compat-32-bit-time

2020-01-02 Thread Arnd Bergmann
On Thu, Jan 2, 2020 at 10:16 AM Arnd Bergmann wrote: > On Tue, Dec 24, 2019 at 9:45 AM Christoph Hellwig wrote: > > On Wed, Dec 18, 2019 at 05:39:29PM +0100, Arnd Bergmann wrote: > > > +/* disallow y2038-unsafe ioctls with CONFIG_COMPAT_32BIT_TIME=n */

Re: [Y2038] [GIT PULL v3 00/27] block, scsi: final compat_ioctl cleanup

2020-01-02 Thread Arnd Bergmann
On Thu, Jan 2, 2020 at 3:56 PM Arnd Bergmann wrote: > > Hi Martin, James, > > If this version seems ok to everyone, please pull into > the scsi tree. It seems I slightly messed up the Cc list here, in case some of you are missing patches, the full series (22 patches, not 27) is mi

[Y2038] [GIT PULL v3 00/27] block, scsi: final compat_ioctl cleanup

2020-01-02 Thread Arnd Bergmann
53b16f129f ---- Arnd Bergmann (22): compat: ARM64: always include asm-generic/compat.h compat: provide compat_ptr() on all architectures compat: scsi: sg: fix v3 compat read/write interface compat_ioctl: block: add blkdev_compat_ptr_ioctl compat_ioctl: ubd

Re: [Y2038] [PATCH 2/3] xfs: disallow broken ioctls without compat-32-bit-time

2020-01-02 Thread Arnd Bergmann
On Tue, Dec 24, 2019 at 9:45 AM Christoph Hellwig wrote: > On Wed, Dec 18, 2019 at 05:39:29PM +0100, Arnd Bergmann wrote: > > +/* disallow y2038-unsafe ioctls with CONFIG_COMPAT_32BIT_TIME=n */ > > +static bool xfs_have_compat_bstat_time32(unsigned int cmd) > > +{ >

Re: [Y2038] [PATCH v2 27/27] Documentation: document ioctl interfaces better

2019-12-19 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 11:45 PM Ben Hutchings wrote: > On Tue, 2019-12-17 at 23:17 +0100, Arnd Bergmann wrote: > > --- /dev/null > > +++ b/Documentation/core-api/ioctl.rst > > +``include/uapi/asm-generic/ioctl.h`` provides four macros for defining > > +ioctl

Re: [Y2038] [PATCH v2 21/27] compat_ioctl: move cdrom commands into cdrom.c

2019-12-19 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 9:11 PM Ben Hutchings wrote: > > On Tue, 2019-12-17 at 23:17 +0100, Arnd Bergmann wrote: > [...] > > @@ -1710,6 +1711,38 @@ static int idecd_ioctl(struct block_device *bdev, > > fmode_t mode, > > return ret; > > } > > &g

Re: [Y2038] [PATCH v2 18/27] compat_ioctl: scsi: move ioctl handling into drivers

2019-12-19 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 8:57 PM Ben Hutchings wrote: > > On Tue, 2019-12-17 at 23:16 +0100, Arnd Bergmann wrote: > > + > > + /* > > + * CDROM ioctls are handled in the block layer, but > > + * do the scsi blk ioctls here. > > + */ > >

Re: [Y2038] [PATCH] generic/402: fix for updated behavior of timestamp limits

2019-12-19 Thread Arnd Bergmann
On Thu, Dec 19, 2019 at 9:40 AM Greg KH wrote: > On Thu, Dec 19, 2019 at 09:28:23AM +0100, Arnd Bergmann wrote: > > On Wed, Dec 18, 2019 at 9:46 PM Amir Goldstein wrote: > > > > [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html > > Ugh, that'

Re: [Y2038] [PATCH] generic/402: fix for updated behavior of timestamp limits

2019-12-19 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 9:46 PM Amir Goldstein wrote: > > I don't think there is a clear policy about being friendly to testing > less that master kernels in xfstest (Eryu?), but IMO we should try to > accommodate > this use case, because it is in the best interest of everyone that stable >

Re: [Y2038] [PATCH v2 23/27] compat_ioctl: move HDIO ioctl handling into drivers/ide

2019-12-18 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 10:11 PM Ben Hutchings wrote: > On Tue, 2019-12-17 at 23:17 +0100, Arnd Bergmann wrote: > > Most of the HDIO ioctls are only used by the obsolete drivers/ide > > subsystem, these can be handled by changing ide_cmd_ioctl() to be aware > > of

Re: [Y2038] [PATCH v2 17/27] compat_ioctl: ide: floppy: add handler

2019-12-18 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 7:45 PM Ben Hutchings wrote: > > On Tue, 2019-12-17 at 23:16 +0100, Arnd Bergmann wrote: > > Rather than relying on fs/compat_ioctl.c, this adds support > > for a compat_ioctl() callback in the ide-floppy driver directly, > > which lets it tra

Re: [Y2038] [PATCH v2 00/12] nfsd: avoid 32-bit time_t

2019-12-18 Thread Arnd Bergmann
On Wed, Dec 18, 2019 at 6:25 PM J. Bruce Fields wrote: > On Wed, Dec 18, 2019 at 06:21:06PM +0100, Arnd Bergmann wrote: > > On Fri, Dec 13, 2019 at 3:12 PM Arnd Bergmann wrote: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git > > y2038-nfsd-v2

Re: [Y2038] [GIT PULL v2 00/27] block, scsi: final compat_ioctl cleanup

2019-12-18 Thread Arnd Bergmann
On Tue, Dec 17, 2019 at 11:17 PM Arnd Bergmann wrote: > My plan was originally to keep the SCSI and block parts separate. > This did not work easily because of interdependencies: I cannot > do the final SCSI cleanup in a good way without first addressing the > CDROM ioctls, so this i

Re: [Y2038] [PATCH v2 00/12] nfsd: avoid 32-bit time_t

2019-12-18 Thread Arnd Bergmann
On Fri, Dec 13, 2019 at 3:12 PM Arnd Bergmann wrote: > > Hi Bruce, Chuck, > > NFSd is one of the last areas of the kernel that is not y2038 safe > yet, this series addresses the remaining issues here. > > I did not get any comments for the first version I posted [1], and >

[Y2038] [PATCH 3/3] xfs: quota: move to time64_t interfaces

2019-12-18 Thread Arnd Bergmann
2106 on 32-bit instead of year 2038. Note that common user space tools using the XFS quotactl interface instead of the generic one still use the y2038 dates. To fix quotas properly, both the on-disk format and user space still need to be changed. Signed-off-by: Arnd Bergmann --- fs/xfs

[Y2038] [PATCH 1/3] xfs: rename compat_time_t to old_time32_t

2019-12-18 Thread Arnd Bergmann
The compat_time_t type has been removed everywhere else, as most users rely on old_time32_t for both native and compat mode handling of 32-bit time_t. Remove the last one in xfs. Reviewed-by: Darrick J. Wong Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_ioctl32.c | 2 +- fs/xfs/xfs_ioctl32.h

[Y2038] [PATCH 2/3] xfs: disallow broken ioctls without compat-32-bit-time

2019-12-18 Thread Arnd Bergmann
interfaces. Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_ioctl.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 7b35d62ede9f..d43582e933a0 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -36,6 +36,7

[Y2038] [PATCH v2 11/27] compat_ioctl: move CDROM_SEND_PACKET handling into scsi

2019-12-17 Thread Arnd Bergmann
failed to convert the structure on the way out, so the updated fields never got written back to user space. This is either not important, or it has never worked and should be fixed now. Signed-off-by: Arnd Bergmann --- block/compat_ioctl.c| 47 +- block/scsi_ioctl.c | 185

[Y2038] [PATCH v2 04/27] compat_ioctl: block: handle add zone open, close and finish ioctl

2019-12-17 Thread Arnd Bergmann
These were added to blkdev_ioctl() in linux-5.5 but not blkdev_compat_ioctl, so add them now. Fixes: e876df1fe0ad ("block: add zone open, close and finish ioctl support") Reviewed-by: Damien Le Moal Signed-off-by: Arnd Bergmann --- block/compat_ioctl.c | 3 +++ 1 file changed, 3

[Y2038] [PATCH v2 24/27] compat_ioctl: block: move blkdev_compat_ioctl() into ioctl.c

2019-12-17 Thread Arnd Bergmann
Having both in the same file allows a number of simplifications to the compat path, and makes it more likely that changes to the native path get applied to the compat version as well. Signed-off-by: Arnd Bergmann --- block/Makefile | 1 - block/compat_ioctl.c | 225

[Y2038] [PATCH v2 18/27] compat_ioctl: scsi: move ioctl handling into drivers

2019-12-17 Thread Arnd Bergmann
mode, with the argument passed through compat_ptr(). With this, we can remove the entries from fs/compat_ioctl.c. The new code is larger, but should be easier to maintain and keep updated with newly added commands. Signed-off-by: Arnd Bergmann --- drivers/block/virtio_blk.c | 3 + drivers/scsi

[Y2038] [PATCH v2 16/27] compat_ioctl: bsg: add handler

2019-12-17 Thread Arnd Bergmann
an SG_IO command that is different from the other drivers and does not need emulation. Signed-off-by: Arnd Bergmann --- block/bsg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bsg.c b/block/bsg.c index 833c44b3d458..d7bae94b64d9 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -382,6

[Y2038] [PATCH v2 21/27] compat_ioctl: move cdrom commands into cdrom.c

2019-12-17 Thread Arnd Bergmann
There is no need for the special cases for the cdrom ioctls any more now, so make sure that each cdrom driver has a .compat_ioctl() callback and calls cdrom_compat_ioctl() directly there. Signed-off-by: Arnd Bergmann --- block/compat_ioctl.c | 45

[Y2038] [PATCH v2 27/27] Documentation: document ioctl interfaces better

2019-12-17 Thread Arnd Bergmann
of the core-api documentation better. Signed-off-by: Arnd Bergmann --- Documentation/core-api/index.rst | 1 + Documentation/core-api/ioctl.rst | 248 +++ 2 files changed, 249 insertions(+) create mode 100644 Documentation/core-api/ioctl.rst diff --git

[Y2038] [PATCH v2 23/27] compat_ioctl: move HDIO ioctl handling into drivers/ide

2019-12-17 Thread Arnd Bergmann
the same commands are already doing this in the drivers, so the compat_blkdev_driver_ioctl() function is no longer needed now. The BLKSECTSET and HDIO_GETGEO_BIG ioctls are not implemented in any driver any more and no longer need any conversion. Signed-off-by: Arnd Bergmann --- block

[Y2038] [PATCH v2 22/27] compat_ioctl: scsi: handle HDIO commands from drivers

2019-12-17 Thread Arnd Bergmann
to check for in_compat_syscall() in order to do both cases correctly, and change all callers to use it as both native and compat callback pointers, including the indirect callers through sas_ioctl and ata_scsi_ioctl. Signed-off-by: Arnd Bergmann --- drivers/ata/libata-scsi.c | 9

[Y2038] [PATCH v2 20/27] compat_ioctl: simplify the implementation

2019-12-17 Thread Arnd Bergmann
tasks, along with FS_IOC_RESVSP_32/FS_IOC_RESVSP64_32. This is harmless for i386 emulation, and can be considered a bugfix for x32 emulation, which never supported these in the past. Signed-off-by: Arnd Bergmann --- fs/internal.h | 6 -- fs/ioctl.c | 157

[Y2038] [PATCH v2 15/27] compat_ioctl: add scsi_compat_ioctl

2019-12-17 Thread Arnd Bergmann
In order to move the compat handling for SCSI ioctl commands out of fs/compat_ioctl.c into the individual drivers, we need a helper function first to match the native ioctl handler called by sd, sr, st, etc. Signed-off-by: Arnd Bergmann --- drivers/scsi/scsi_ioctl.c | 54

[Y2038] [PATCH v2 17/27] compat_ioctl: ide: floppy: add handler

2019-12-17 Thread Arnd Bergmann
Rather than relying on fs/compat_ioctl.c, this adds support for a compat_ioctl() callback in the ide-floppy driver directly, which lets it translate the scsi commands. Signed-off-by: Arnd Bergmann --- drivers/ide/ide-floppy.c | 4 drivers/ide/ide-floppy.h | 2 ++ drivers/ide

[Y2038] [PATCH v2 26/27] compat_ioctl: simplify up block/ioctl.c

2019-12-17 Thread Arnd Bergmann
kept as a separate exported interfact for drivers/char/raw.c, which lacks a compat_ioctl variant. We should probably either move raw.c to staging if there are no more users, or export blkdev_compat_ioctl() as well. Signed-off-by: Arnd Bergmann --- block/ioctl.c | 269

[Y2038] [PATCH v2 14/27] compat_ioctl: block: handle cdrom compat ioctl in non-cdrom drivers

2019-12-17 Thread Arnd Bergmann
or no arguments are passed, the same handler can be used for .ioctl and .compat_ioctl, and when only pointer arguments are passed, the newly added blkdev_compat_ptr_ioctl can be used. Signed-off-by: Arnd Bergmann --- drivers/block/floppy.c | 3 +++ drivers/block/paride/pd.c| 1 + drivers

[Y2038] [PATCH v2 07/27] compat: provide compat_ptr() on all architectures

2019-12-17 Thread Arnd Bergmann
In order to avoid needless #ifdef CONFIG_COMPAT checks, move the compat_ptr() definition to linux/compat.h where it can be seen by any file regardless of the architecture. Only s390 needs a special definition, this can use the self-#define trick we have elsewhere. Signed-off-by: Arnd Bergmann

[Y2038] [PATCH v2 25/27] compat_ioctl: block: simplify compat_blkpg_ioctl()

2019-12-17 Thread Arnd Bergmann
There is no need to go through a compat_alloc_user_space() copy any more, just wrap the function in a small helper that works the same way for native and compat mode. Signed-off-by: Arnd Bergmann --- block/ioctl.c | 74 ++- 1 file changed, 38

[Y2038] [PATCH v2 19/27] compat_ioctl: move sys_compat_ioctl() to ioctl.c

2019-12-17 Thread Arnd Bergmann
The rest of the fs/compat_ioctl.c file is no longer useful now, so move the actual syscall as planned. Signed-off-by: Arnd Bergmann --- fs/Makefile | 2 +- fs/compat_ioctl.c | 133 -- fs/ioctl.c| 90 +++ 3

[Y2038] [PATCH v2 02/27] compat_ioctl: block: handle BLKREPORTZONE/BLKRESETZONE

2019-12-17 Thread Arnd Bergmann
These were added to blkdev_ioctl() but not blkdev_compat_ioctl, so add them now. Cc: # v4.10+ Fixes: 3ed05a987e0f ("blk-zoned: implement ioctls") Reviewed-by: Damien Le Moal Signed-off-by: Arnd Bergmann --- block/compat_ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --g

[Y2038] [PATCH v2 13/27] compat_ioctl: cdrom: handle CDROM_LAST_WRITTEN

2019-12-17 Thread Arnd Bergmann
This is the only ioctl command that does not have a proper compat handler. Making the normal implementation do the right thing is actually very simply, so just do that by using an in_compat_syscall() check to avoid the special case in the pkcdvd driver. Signed-off-by: Arnd Bergmann --- drivers

[Y2038] [PATCH v2 12/27] compat_ioctl: move CDROMREADADIO to cdrom.c

2019-12-17 Thread Arnd Bergmann
Again, there is only one file that needs this, so move the conversion handler into the native implementation. Signed-off-by: Arnd Bergmann --- block/compat_ioctl.c | 36 drivers/cdrom/cdrom.c | 28 +--- 2 files changed, 25 insertions

[Y2038] [PATCH v2 08/27] compat: scsi: sg: fix v3 compat read/write interface

2019-12-17 Thread Arnd Bergmann
to a simpler version that gets the expected results. Fixes: c35a5cfb4150 ("scsi: sg: sg_read(): simplify reading ->pack_id of userland sg_io_hdr_t") Fixes: 98aaaec4a150 ("compat_ioctl: reimplement SG_IO handling") Signed-off-by: Arnd Bergmann --- block/scsi_ioctl.c | 29 +--

[Y2038] [PATCH v2 06/27] compat: ARM64: always include asm-generic/compat.h

2019-12-17 Thread Arnd Bergmann
In order to use compat_* type defininitions in device drivers outside of CONFIG_COMPAT, move the inclusion of asm-generic/compat.h ahead of the #ifdef. All other architectures already do this. Acked-by: Will Deacon Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/compat.h | 5 +++-- 1

[Y2038] [PATCH v2 03/27] compat_ioctl: block: handle BLKGETZONESZ/BLKGETNRZONES

2019-12-17 Thread Arnd Bergmann
These were added to blkdev_ioctl() in v4.20 but not blkdev_compat_ioctl, so add them now. Cc: # v4.20+ Fixes: 72cd87576d1d ("block: Introduce BLKGETZONESZ ioctl") Fixes: 65e4e3eee83d ("block: Introduce BLKGETNRZONES ioctl") Reviewed-by: Damien Le Moal Signed-off-by: Arnd

[Y2038] [PATCH v2 10/27] compat_ioctl: ubd, aoe: use blkdev_compat_ptr_ioctl

2019-12-17 Thread Arnd Bergmann
() as their .compat_ioctl callback. Signed-off-by: Arnd Bergmann --- arch/um/drivers/ubd_kern.c | 1 + drivers/block/aoe/aoeblk.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 6627d7c30f37..582eb5b1f09b 100644 --- a/arch/um/drivers

[Y2038] [PATCH v2 09/27] compat_ioctl: block: add blkdev_compat_ptr_ioctl

2019-12-17 Thread Arnd Bergmann
. This mirrors the compat_ptr_ioctl() helper function used in character devices. Signed-off-by: Arnd Bergmann --- block/ioctl.c | 21 + include/linux/blkdev.h | 7 +++ 2 files changed, 28 insertions(+) diff --git a/block/ioctl.c b/block/ioctl.c index

[Y2038] [PATCH v2 05/27] compat_ioctl: block: handle Persistent Reservations

2019-12-17 Thread Arnd Bergmann
These were added to blkdev_ioctl() in linux-5.5 but not blkdev_compat_ioctl, so add them now. Cc: # v4.4+ Fixes: bbd3e064362e ("block: add an API for Persistent Reservations") Signed-off-by: Arnd Bergmann --- block/compat_ioctl.c | 8 1 file changed, 8 insertions(+)

[Y2038] [PATCH v2 01/27] pktcdvd: fix regression on 64-bit architectures

2019-12-17 Thread Arnd Bergmann
Signed-off-by: Arnd Bergmann Please apply for v5.5, I just noticed the regression while rebasing some of the patches I created on top. --- drivers/block/pktcdvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index ee

[Y2038] [GIT PULL v2 00/27] block, scsi: final compat_ioctl cleanup

2019-12-17 Thread Arnd Bergmann
l function; bug spotted by Ben Hutchings - Improve formatting of documentation [1] https://lore.kernel.org/linux-block/20191211204306.1207817-1-a...@arndb.de/T/#m9f89df30565fc66abbded5d01f4db553b16f129f ---- Arnd Bergmann (22): (plus

Re: [Y2038] [PATCH 10/24] compat_ioctl: cdrom: handle CDROM_LAST_WRITTEN

2019-12-17 Thread Arnd Bergmann
On Tue, Dec 17, 2019 at 4:20 PM Ben Hutchings wrote: > > On Wed, 2019-12-11 at 21:42 +0100, Arnd Bergmann wrote: > > This is the only ioctl command that does not have a proper > > compat handler. Making the normal implementation do the > > right thing is actually

[Y2038] [GIT PULL, v8] Fix year 2038 issue for sound subsystem

2019-12-17 Thread Arnd Bergmann
and needs source changes to fix them. [1] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git y2038-alsa-v8 [2] https://lore.kernel.org/lkml/cak8p3a2os66+iwqyf97qh05w2jp8rmwao8zmkohixqvhvyy...@mail.gmail.com/T/#m6519cb07cfda08adf1dedea6596bb98892b4d5dc Signed-off-by: Arnd Bergmann

Re: [Y2038] [PATCH v7 0/8] Fix year 2038 issue for sound subsystem

2019-12-17 Thread Arnd Bergmann
On Tue, Dec 17, 2019 at 11:42 AM Takashi Iwai wrote: > On Wed, 11 Dec 2019 22:20:16 +0100, > Arnd Bergmann wrote: > > > > I hope I addressed all review comments by now, so please pull this > > for linux-5.6. > > > > A git branch with the same con

Re: [Y2038] [PATCH v2 20/24] xfs: disallow broken ioctls without compat-32-bit-time

2019-12-17 Thread Arnd Bergmann
On Mon, Dec 16, 2019 at 5:52 PM Darrick J. Wong wrote: > On Mon, Dec 16, 2019 at 05:45:29PM +0100, Arnd Bergmann wrote: > > On Fri, Dec 13, 2019 at 10:05 PM Darrick J. Wong > > wrote: > > What is the timeline for that work now? I'm mainly interested in > > getting the

Re: [Y2038] [PATCH v2 21/24] xfs: quota: move to time64_t interfaces

2019-12-17 Thread Arnd Bergmann
On Mon, Dec 16, 2019 at 5:52 PM Arnd Bergmann wrote: > On Fri, Dec 13, 2019 at 10:17 PM Darrick J. Wong > wrote: >> >> Hmm, so one thing that I clean up on the way to bigtime is the total >> lack of clamping here. If (for example) it's September 2105 and >>

Re: [Y2038] [PATCH v2 21/24] xfs: quota: move to time64_t interfaces

2019-12-16 Thread Arnd Bergmann
On Fri, Dec 13, 2019 at 10:17 PM Darrick J. Wong wrote: > > On Fri, Dec 13, 2019 at 09:53:49PM +0100, Arnd Bergmann wrote: > > As a preparation for removing the 32-bit time_t type and > > all associated interfaces, change xfs to use time64_t and > > ktime_get_real

Re: [Y2038] [PATCH v2 20/24] xfs: disallow broken ioctls without compat-32-bit-time

2019-12-16 Thread Arnd Bergmann
On Fri, Dec 13, 2019 at 10:05 PM Darrick J. Wong wrote: > > On Fri, Dec 13, 2019 at 09:53:48PM +0100, Arnd Bergmann wrote: > > When building a kernel that disables support for 32-bit time_t > > system calls, it also makes sense to disable the old xfs_bstat > > ioctls comp

Re: [Y2038] [PATCH v2 19/24] xfs: rename compat_time_t to old_time32_t

2019-12-16 Thread Arnd Bergmann
On Fri, Dec 13, 2019 at 10:18 PM Darrick J. Wong wrote: > > On Fri, Dec 13, 2019 at 09:53:47PM +0100, Arnd Bergmann wrote: > > The compat_time_t type has been removed everywhere else, > > as most users rely on old_time32_t for both native and > > compat mode h

[Y2038] [PATCH v6 7/8] media: v4l2-core: fix compat VIDIOC_DQEVENT for time64 ABI

2019-12-16 Thread Arnd Bergmann
inside of an #ifdef so it does not get used on architectures other than x86. Signed-off-by: Arnd Bergmann --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 60 ++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b

[Y2038] [PATCH v6 8/8] media: v4l2-core: fix compat v4l2_buffer handling for time64 ABI

2019-12-16 Thread Arnd Bergmann
alternative, but is out of scope of the y2038 work. Note: x32 support for v4l2_buffer32 has always been broken and remains so after this change, fixing it would have required even more duplication, and apparently nobody has cared so far. Signed-off-by: Arnd Bergmann --- drivers/media/v4l2-core/v4l2

[Y2038] [PATCH v6 6/8] media: v4l2-core: fix v4l2_buffer handling for time64 ABI

2019-12-16 Thread Arnd Bergmann
for now, but unfortunately this may turn into a maintenance burden later. A larger-scale rework of the compat code might be a better alternative, but is out of scope of the y2038 work. Sparc64 needs a special case because of their special suseconds_t definition. Signed-off-by: Arnd Bergmann

[Y2038] [PATCH v6 3/8] media: v4l2-core: compat: ignore native command codes

2019-12-16 Thread Arnd Bergmann
, not for deciding on the conversion, in order to make the compat behavior match the native behavior. Actual support for the 64-bit time_t version of VIDIOC_DQEVENT_TIME and other commands still needs to be added in a separate patch. Cc: sta...@vger.kernel.org Signed-off-by: Arnd Bergmann --- drivers

[Y2038] [PATCH v6 5/8] media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABI

2019-12-16 Thread Arnd Bergmann
architecture. The easiest way to do this is during the copy from/to user space. Signed-off-by: Arnd Bergmann --- drivers/media/v4l2-core/v4l2-event.c | 5 - drivers/media/v4l2-core/v4l2-ioctl.c | 29 ++- drivers/media/v4l2-core/v4l2-subdev.c | 26

[Y2038] [PATCH v6 2/8] media: v4l2: abstract timeval handling in v4l2_buffer

2019-12-16 Thread Arnd Bergmann
of the uapi header. Signed-off-by: Arnd Bergmann --- .../media/common/videobuf2/videobuf2-v4l2.c | 4 ++-- drivers/media/pci/meye/meye.c | 4 ++-- drivers/media/usb/cpia2/cpia2_v4l.c | 4 ++-- drivers/media/usb/stkwebcam/stk-webcam.c | 2 +- drivers/media/usb

[Y2038] [PATCH v6 1/8] media: documentation: fix video_event description

2019-12-16 Thread Arnd Bergmann
The type for the timestamp in video_event was changed to 'long' a long time ago, change the documentation to match. Signed-off-by: Arnd Bergmann --- Documentation/media/uapi/dvb/video-get-event.rst | 2 +- Documentation/media/uapi/dvb/video_types.rst | 2 +- 2 files changed, 2 insertions

[Y2038] [PATCH v6 0/8] y2038 safety in v4l2

2019-12-16 Thread Arnd Bergmann
by automated build bots. [1] https://lwn.net/Articles/657754/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-v4l2-v6 Arnd Bergmann (8): media: documentation: fix video_event description media: v4l2: abstract timeval handling in v4l2_buffer media: v4l2-core

  1   2   3   4   5   6   7   8   9   10   >