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, 15 Jun 2020 11:12:25 +0900
From:   Hyunchul Lee <hyc.lee@...il.com>
To:     Namjae Jeon <namjae.jeon@...sung.com>
Cc:     linux-fsdevel@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        Sungjong Seo <sj1557.seo@...sung.com>
Subject: Re: [PATCH 2/2] exfat: allow to change some mount options for remount

2020년 6월 15일 (월) 오전 9:18, Namjae Jeon <namjae.jeon@...sung.com>님이 작성:
>
> > Allow to change permission masks, allow_utime, errors. But ignore other options.
> >
> > Signed-off-by: Hyunchul Lee <hyc.lee@...il.com>
> > ---
> >  fs/exfat/super.c | 40 +++++++++++++++++++++++++++++-----------
> >  1 file changed, 29 insertions(+), 11 deletions(-)
> >
> > diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 61c6cf240c19..3c1d47289ba2 100644
> > --- a/fs/exfat/super.c
> > +++ b/fs/exfat/super.c
> > @@ -696,9 +696,13 @@ static void exfat_free(struct fs_context *fc)  static int
> > exfat_reconfigure(struct fs_context *fc)  {
> >       struct super_block *sb = fc->root->d_sb;
> > +     struct exfat_sb_info *sbi = EXFAT_SB(sb);
> > +     struct exfat_mount_options *new_opts;
> >       int ret;
> >       bool new_rdonly;
> >
> > +     new_opts = &((struct exfat_sb_info *)fc->s_fs_info)->options;
> > +
> >       new_rdonly = fc->sb_flags & SB_RDONLY;
> >       if (new_rdonly != sb_rdonly(sb)) {
> >               if (new_rdonly) {
> > @@ -708,6 +712,12 @@ static int exfat_reconfigure(struct fs_context *fc)
> >                               return ret;
> >               }
> >       }
> > +
> > +     /* allow to change these options but ignore others */
> > +     sbi->options.fs_fmask = new_opts->fs_fmask;
> > +     sbi->options.fs_dmask = new_opts->fs_dmask;
> > +     sbi->options.allow_utime = new_opts->allow_utime;
> > +     sbi->options.errors = new_opts->errors;
> Is there any reason why you allow a few options on remount ?

while exfat is remounted, inodes are not reclaimed. So I think
changing fs_uid, fs_gid, or time_offset is not impossible.
And I am not sure changing the iocharset is safe.

I am curious about your opinion.

Thanks.


> >       return 0;
> >  }
> >
> > @@ -726,17 +736,25 @@ static int exfat_init_fs_context(struct fs_context *fc)
> >       if (!sbi)
> >               return -ENOMEM;
> >
> > -     mutex_init(&sbi->s_lock);
> > -     ratelimit_state_init(&sbi->ratelimit, DEFAULT_RATELIMIT_INTERVAL,
> > -                     DEFAULT_RATELIMIT_BURST);
> > -
> > -     sbi->options.fs_uid = current_uid();
> > -     sbi->options.fs_gid = current_gid();
> > -     sbi->options.fs_fmask = current->fs->umask;
> > -     sbi->options.fs_dmask = current->fs->umask;
> > -     sbi->options.allow_utime = -1;
> > -     sbi->options.iocharset = exfat_default_iocharset;
> > -     sbi->options.errors = EXFAT_ERRORS_RO;
> > +     if (fc->root) {
> > +             /* reconfiguration */
> > +             memcpy(&sbi->options, &EXFAT_SB(fc->root->d_sb)->options,
> > +                     sizeof(struct exfat_mount_options));
> > +             sbi->options.iocharset = exfat_default_iocharset;
> > +     } else {
> > +             mutex_init(&sbi->s_lock);
> > +             ratelimit_state_init(&sbi->ratelimit,
> > +                             DEFAULT_RATELIMIT_INTERVAL,
> > +                             DEFAULT_RATELIMIT_BURST);
> > +
> > +             sbi->options.fs_uid = current_uid();
> > +             sbi->options.fs_gid = current_gid();
> > +             sbi->options.fs_fmask = current->fs->umask;
> > +             sbi->options.fs_dmask = current->fs->umask;
> > +             sbi->options.allow_utime = -1;
> > +             sbi->options.iocharset = exfat_default_iocharset;
> > +             sbi->options.errors = EXFAT_ERRORS_RO;
> > +     }
> >
> >       fc->s_fs_info = sbi;
> >       fc->ops = &exfat_context_ops;
> > --
> > 2.17.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ