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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Jul 2022 11:51:31 +0200
From:   Miklos Szeredi <miklos@...redi.hu>
To:     Daniil Lunev <dlunev@...omium.org>
Cc:     linux-fsdevel@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>,
        Christoph Hellwig <hch@...radead.org>,
        "Theodore Ts'o" <tytso@....edu>, linux-kernel@...r.kernel.org,
        fuse-devel <fuse-devel@...ts.sourceforge.net>,
        Daniil Lunev <dlunev@...gle.com>
Subject: Re: [PATCH v4 1/2] fs/super: function to prevent super re-use

On Wed, 1 Jun 2022 at 03:11, Daniil Lunev <dlunev@...omium.org> wrote:
>
> From: Daniil Lunev <dlunev@...omium.org>
>
> The function is to be called from filesystem-specific code to mark a
> superblock to be ignored by superblock test and thus never re-used. The
> function also unregisters bdi if the bdi is per-superblock to avoid
> collision if a new superblock is created to represent the filesystem.
> generic_shutdown_super() skips unregistering bdi for a retired
> superlock as it assumes retire function has already done it.
>
> Signed-off-by: Daniil Lunev <dlunev@...omium.org>
> Signed-off-by: Daniil Lunev <dlunev@...gle.com>
> ---
>
> Changes in v4:
> - Simplify condition according to Christoph Hellwig's comments.
>
> Changes in v3:
> - Back to state tracking from v1
> - Use s_iflag to mark superblocked ignored
> - Only unregister private bdi in retire, without freeing
>
> Changes in v2:
> - Remove super from list of superblocks instead of using a flag
>
>  fs/super.c         | 28 ++++++++++++++++++++++++++--
>  include/linux/fs.h |  2 ++
>  2 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/fs/super.c b/fs/super.c
> index f1d4a193602d6..3fb9fc8d61160 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -422,6 +422,30 @@ bool trylock_super(struct super_block *sb)
>         return false;
>  }
>
> +/**
> + *     retire_super    -       prevernts superblock from being reused

s/prevernts/prevents/

> + *     @sb: superblock to retire
> + *
> + *     The function marks superblock to be ignored in superblock test, which
> + *     prevents it from being reused for any new mounts.

This works for block supers and nothing else, at least as this patch
stands.  That might be okay, but should at least be documented.

Thanks,
Miklos

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ