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:   Thu, 13 Jun 2019 07:34:09 +0000
From:   Wang Shilong <wshilong@....com>
To:     Chao Yu <yuchao0@...wei.com>,
        Wang Shilong <wangshilong1991@...il.com>,
        "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
        "linux-f2fs-devel@...ts.sourceforge.net" 
        <linux-f2fs-devel@...ts.sourceforge.net>
CC:     Andreas Dilger <adilger@...ger.ca>
Subject: 回复: [PATCH 2/2] f2fs: only set project inherit bit for directory

Hi Chao,

 I just sent a V2, but I think we'd better do that when reading inode, for two reasons:

1) not only F2FS_IOC_GETFLAGS need filter flags but also F2FS_IOC_FSGETXATTR need that, so the amended parts is not enough IMO.

2) doing that by reading inode give a benefit that we could correct on disk flags for regular file next dirtying inode happen.

________________________________________
发件人: Chao Yu <yuchao0@...wei.com>
发送时间: 2019年6月13日 14:36
收件人: Wang Shilong; linux-ext4@...r.kernel.org; linux-f2fs-devel@...ts.sourceforge.net
抄送: Wang Shilong; Andreas Dilger
主题: Re: [PATCH 2/2] f2fs: only set project inherit bit for directory

On 2019/6/6 12:32, Wang Shilong wrote:
> From: Wang Shilong <wshilong@....com>
>
> It doesn't make any sense to have project inherit bits
> for regular files, even though this won't cause any
> problem, but it is better fix this.
>
> Cc: Andreas Dilger <adilger@...ger.ca>
> Signed-off-by: Wang Shilong <wshilong@....com>
> ---
>  fs/f2fs/f2fs.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 06b89a9862ab..f02ebecb68ea 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -2370,7 +2370,8 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr)
>                          F2FS_PROJINHERIT_FL)
>
>  /* Flags that are appropriate for regular files (all but dir-specific ones). */
> -#define F2FS_REG_FLMASK              (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL))
> +#define F2FS_REG_FLMASK      (~(F2FS_DIRSYNC_FL | F2FS_TOPDIR_FL |\
> +                                F2FS_PROJINHERIT_FL))

Hi Shilong,

Could you please add below diff as ext4 did?

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index efdafa886510..295ca5ed42d9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1759,6 +1759,9 @@ static int f2fs_ioc_getflags(struct file *filp, unsigned
long arg)

        fsflags &= F2FS_GETTABLE_FS_FL;

+       if (S_ISREG(inode->i_mode))
+               fsflags &= ~FS_PROJINHERIT_FL;
+
        return put_user(fsflags, (int __user *)arg);
 }

Thanks,

>
>  /* Flags that are appropriate for non-directories/regular files. */
>  #define F2FS_OTHER_FLMASK    (F2FS_NODUMP_FL | F2FS_NOATIME_FL)
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ