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, 24 Jan 2022 19:25:44 +0000
From:   Eric Biggers <ebiggers@...nel.org>
To:     Harry Austen <harryausten@...mail.co.uk>
Cc:     linux-f2fs-devel@...ts.sourceforge.net, jaegeuk@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix fileattr_set unsupported attribute
 handling

On Sat, Jan 22, 2022 at 12:59:03PM +0000, Harry Austen wrote:
> FS_IOC_SETFLAGS ioctl should return EOPNOTSUPP if the file attribute
> (e.g. FS_NOCOW_FL) is not supported, rather than silently ignoring it
> and returning success.
> 
> Fixes: 9b1bb01c8ae7 (f2fs: convert to fileattr)
> Signed-off-by: Harry Austen <harryausten@...mail.co.uk>
> ---
>  fs/f2fs/file.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 92ec2699bc85..061bf35c2582 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -3085,9 +3085,8 @@ int f2fs_fileattr_set(struct user_namespace *mnt_userns,
>  		return -EIO;
>  	if (!f2fs_is_checkpoint_ready(F2FS_I_SB(inode)))
>  		return -ENOSPC;
> -	if (fsflags & ~F2FS_GETTABLE_FS_FL)
> +	if (fsflags & ~F2FS_SETTABLE_FS_FL)
>  		return -EOPNOTSUPP;
> -	fsflags &= F2FS_SETTABLE_FS_FL;
>  	if (!fa->flags_valid)
>  		mask &= FS_COMMON_FL;

This is intentional, and matches what ext4 does; see the comment in the ext4
implementation of this:

        /*
         * chattr(1) grabs flags via GETFLAGS, modifies the result and
         * passes that to SETFLAGS. So we cannot easily make SETFLAGS
         * more restrictive than just silently masking off visible but
         * not settable flags as we always did.
         */

Also, even if this patch was correct, the Fixes tag is wrong.

- Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ