lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Oct 2021 12:56:14 +0300
From:   Amir Goldstein <amir73il@...il.com>
To:     Gabriel Krisman Bertazi <krisman@...labora.com>
Cc:     LTP List <ltp@...ts.linux.it>, Jan Kara <jack@...e.com>,
        Khazhismel Kumykov <khazhy@...gle.com>, kernel@...labora.com,
        Ext4 <linux-ext4@...r.kernel.org>,
        Matthew Bobrowski <repnop@...gle.com>
Subject: Re: [PATCH v2 08/10] syscalls/fanotify20: Test event after filesystem abort

On Tue, Oct 26, 2021 at 9:44 PM Gabriel Krisman Bertazi
<krisman@...labora.com> wrote:
>
> This test monitors the error triggered after a file system abort.  It
> works by forcing a remount with the option "abort".  This is an error
> not related to a file so it is reported against the superblock with a
> zero size fh.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@...labora.com>
> ---
>  testcases/kernel/syscalls/fanotify/fanotify20.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c
> index 298bb303a810..5c5ee3c6fb74 100644
> --- a/testcases/kernel/syscalls/fanotify/fanotify20.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c
> @@ -57,6 +57,12 @@ static void do_debugfs_request(const char *dev, char *request)
>         SAFE_CMD(cmd, NULL, NULL);
>  }
>
> +static void trigger_fs_abort(void)
> +{
> +       SAFE_MOUNT(tst_device->dev, MOUNT_PATH, tst_device->fs_type,
> +                  MS_REMOUNT|MS_RDONLY, "abort");
> +}
> +
>  static struct test_case {
>         char *name;
>         int error;
> @@ -64,6 +70,13 @@ static struct test_case {
>         struct fanotify_fid_t *fid;
>         void (*trigger_error)(void);
>  } testcases[] = {
> +       {
> +               .name = "Trigger abort",
> +               .trigger_error = &trigger_fs_abort,
> +               .error_count = 1,
> +               .error = ESHUTDOWN,
> +               .fid = &null_fid,
> +       },
>  };
>

I suppose you did not try to run fanotify20 -i 10 ...?
I guess you will need to end the setup() stage with unmounted fs and perform:
mount; fanotify_init; fanotify_mark; at beginning of do_test()
finishing do_test() with closing fanotify fd and unmount.
I never checked it there are pre-test/post-test callbacks available in LTP,
but setup/clean are called at start/end of test loop.

Thanks,
Amir.

Powered by blists - more mailing lists