[LTP] [PATCH 2/7] syscalls/fsopen: New tests

Viresh Kumar viresh.kumar@linaro.org
Tue Feb 18 10:08:21 CET 2020


On 18-02-20, 17:02, Li Wang wrote:
> On Tue, Feb 18, 2020 at 4:25 PM Viresh Kumar <viresh.kumar@linaro.org>
> wrote:
> 
> > On 18-02-20, 09:15, Li Wang wrote:
> > > On Mon, Feb 17, 2020 at 9:36 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> > >
> > > > ...
> > > > > > +static struct tst_test test = {
> > > > > > +       .min_kver = "5.2",
> > > > > >
> > > > >
> > > > > I suggest removing .min_kver check in all of the tests to let they
> > can be
> > > > > running on many distributions(which backport the features).
> > > >
> > > > If we do that we have to explicitely check for ENOSYS errno in each
> > > > test, quite possibly with a dummy call to the tested syscall in test
> > > > setup, because once these calls gets libc wrappers we will no longer
> > > > call the tst_syscall() that checks for it.
> > > >
> > >
> > > +1 add dummy call to the tested syscall in the setup.
> > > Agree, thanks for point out this.
> >
> > Not sure if I understood it very clearly and don't want to spam everyone
> > with an
> > incorrect patchset still missing this point and so asking here :)
> >
> > How exactly would the setup() routine look like? Something like this ?
> >
> >         syscall(#NR, ##__VA_ARGS__);
> >
> 
> I suggest to use tst_syscall(...);.
> 
> A dummy call in setup() just helps check the ENOSYS errno, something like:
> 
> $ cat testcases/cve/cve-2016-7117.c |grep setup -A 10
> static void setup(void)
> {
>         ...
>         tst_syscall(__NR_recvmmsg, 0, 0, 0, 0, 0);
> }

Okay, thanks.

-- 
viresh


More information about the ltp mailing list