Re: [PATCH 15/16] io_uring: add file registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 15, 2019 at 3:56 AM Jens Axboe <axboe@xxxxxxxxx> wrote:

> @@ -132,4 +139,12 @@ struct io_uring_register_buffers {
>         __u32 nr_iovecs;
>  };
>
> +struct io_uring_register_files {
> +       union {
> +               __s32 *fds;
> +               __u64 pad;
> +       };
> +       __u32 nr_fds;
> +};

I think you should either remove the pad field here, or pass the pointer
using a __u64 argument itself. With the current definition, the ioctl
command code is the same between 32-bit and 64-bit architectures
(since the length is the same on anything other than x86), but the
structures are incompatible.

I would also suggest adding an explicit 32-bit pad field at the end
of the structure, to avoid the implicit padding on non-i386 machines.

     Arnd



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux