[PATCH 3/7] Update ioctl_tee test for linux v6.18 ioctl entries

Gleb Fotengauer-Malinovskiy glebfm at altlinux.org
Thu Jan 29 20:41:35 UTC 2026


On Thu, Jan 29, 2026 at 04:01:13PM +0100, Eugene Syromyatnikov wrote:
> On Thu, Jan 29, 2026 at 2:22 PM Gleb Fotengauer-Malinovskiy
> <glebfm at altlinux.org> wrote:
> >
> > * tests/ioctl_tee.c (main): Print TEE_IOC_SHM_REGISTER_FD instead of
> > raw _IOC value in expected output.
> > ---
> >  tests/ioctl_tee.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/ioctl_tee.c b/tests/ioctl_tee.c
> > index d8138e767..13b22c74f 100644
> > --- a/tests/ioctl_tee.c
> > +++ b/tests/ioctl_tee.c
> > @@ -169,7 +169,7 @@ main(void)
> >
> >         /* Valid parameterless calls */
> >         ioctl(-1, TEE_IOC_SHM_REGISTER_FD, NULL);
> > -       printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0xa4, 0x8, 0x18), NULL)"
> > +       printf("ioctl(-1, TEE_IOC_SHM_REGISTER_FD, NULL)"
> >                RVAL_EBADF);
> >         ioctl(-1, _IOC(_IOC_NONE, 0xa4, 0xa, 0), NULL);
> >         printf("ioctl(-1, _IOC(_IOC_NONE, 0xa4, 0xa, 0), 0)" RVAL_EBADF);
> > @@ -205,7 +205,7 @@ main(void)
> >                 shm_register_fd.fd = fd;
> >                 shm_register_fd.flags = TEE_IOCTL_SHM_DMA_BUF;
> >                 ioctl(-1, TEE_IOC_SHM_REGISTER_FD, &shm_register_fd);
> > -               printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE, 0xa4, 0x8, 0x18), "
> > +               printf("ioctl(-1, TEE_IOC_SHM_REGISTER_FD, "
> >                        "{fd=%d, flags=TEE_IOCTL_SHM_DMA_BUF})" RVAL_EBADF, fd);
> >         }
> 
> I think the idea of the check here is to serve as a guard, so it
> starts failing when a new ioctl command is added, so, the correct way
> to address this is to add a check for TEE_IOC_SHM_REGISTER_FD and bump
> the command number in "Update ioctl entries from linux v6.18 and fix
> affected tests".

No, this check is specific to the TEE_IOC_SHM_REGISTER_FD ioctl, for which
strace support existed (v5.9~8) long before the ioctl itself was actually
implemented in the mainline kernel (v6.18-rc1~145^2~16^2~4).  That said,
you are right, it would be a good idea to add such a check, similar to one
in tests/ioctl_ptp.c.

-- 
glebfm


More information about the Strace-devel mailing list