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] [day] [month] [year] [list]
Date:   Sat, 29 Jun 2019 22:09:01 +0200
From:   Jan Kara <jack@...e.cz>
To:     " Darrick J. Wong " <darrick.wong@...cle.com>
Cc:     adilger.kernel@...ger.ca, clm@...com, yuchao0@...wei.com,
        hch@...radead.org, jaegeuk@...nel.org, shaggy@...nel.org,
        ard.biesheuvel@...aro.org, tytso@....edu,
        matthew.garrett@...ula.com, jk@...abs.org,
        David Sterba <dsterba@...e.com>, Jan Kara <jack@...e.com>,
        josef@...icpanda.com, viro@...iv.linux.org.uk,
        linux-mtd@...ts.infradead.org,
        jfs-discussion@...ts.sourceforge.net,
        linux-f2fs-devel@...ts.sourceforge.net, ocfs2-devel@....oracle.com,
        cluster-devel@...hat.com, linux-btrfs@...r.kernel.org,
        linux-efi@...r.kernel.org, linux-ext4@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-nilfs@...r.kernel.org, linux-xfs@...r.kernel.org,
        reiserfs-devel@...r.kernel.org
Subject: Re: [PATCH 5/5] vfs: only allow FSSETXATTR to set DAX flag on files
 and dirs

On Fri 28-06-19 11:34:31,  Darrick J. Wong  wrote:
> From: Darrick J. Wong <darrick.wong@...cle.com>
> 
> The DAX flag only applies to files and directories, so don't let it get
> set for other types of files.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/inode.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> 
> diff --git a/fs/inode.c b/fs/inode.c
> index 670d5408d022..f08711b34341 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2259,6 +2259,14 @@ int vfs_ioc_fssetxattr_check(struct inode *inode, const struct fsxattr *old_fa,
>  	    !S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
>  		return -EINVAL;
>  
> +	/*
> +	 * It is only valid to set the DAX flag on regular files and
> +	 * directories on filesystems.
> +	 */
> +	if ((fa->fsx_xflags & FS_XFLAG_DAX) &&
> +	    !(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
> +		return -EINVAL;
> +
>  	/* Extent size hints of zero turn off the flags. */
>  	if (fa->fsx_extsize == 0)
>  		fa->fsx_xflags &= ~(FS_XFLAG_EXTSIZE | FS_XFLAG_EXTSZINHERIT);
> 
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ