[LTP] [PATCH] lib: tst_fd: Add kernel version check to memfd_secret

Edward Liaw edliaw@google.com
Fri Jul 12 20:40:52 CEST 2024


Hi Nobuhiro,

On Fri, Jun 28, 2024 at 1:40 AM <nobuhiro1.iwamatsu@toshiba.co.jp> wrote:
>
> Hi Petr,
>
> > -----Original Message-----
> > From: Petr Vorel <pvorel@suse.cz>
> > Sent: Friday, June 21, 2024 8:09 PM
> > To: iwamatsu nobuhiro(岩松 信洋 ○DITC□DIT○OST)
> > <nobuhiro1.iwamatsu@toshiba.co.jp>
> > Cc: ltp@lists.linux.it; Cyril Hrubis <chrubis@suse.cz>
> > Subject: Re: [LTP] [PATCH] lib: tst_fd: Add kernel version check to
> > memfd_secret
> >
> > Hi Nobuhiro,
> >
> > > memfd_secret is a syscall added since 5.14. On earlier kernels, tests
> > > such as accept03, readahead01 and splice07 that use memfd_secret fail.
> > > This adds a kernel version check to the tst_fd library when running
> > > tests using memfd_secret.
> >
> > Cyril's suggestion to add fallback definitions sounds to me as a good idea:
> >
> > https://lore.kernel.org/ltp/ZnVCcU6jOU98DYek@yuki/
> >
> >       I guess that the best fix is to add fallback definitions for
> >       memfd_secret into include/lapi/syscalls/*.in files. That way we
> > should
> >       get -1 and EINVAL properly even when kernel does not support the
> >       syscall.
> >
> > Could you please try that first?
>
> OK, I will create a v2 patch based on that suggestion.

A vendor on arm32 ran into this issueI and I didn't see a v2 submitted
yet, so I sent https://lore.kernel.org/ltp/20240711004220.1338086-2-edliaw@google.com/
which is working for me; do you mind testing it?.

>
> >
> > Kind regards,
> > Petr
>
> Best regards,
>   Nobuhiro
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp

Thanks,
Edward


More information about the ltp mailing list