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]
Message-Id: <6C3CB775-988A-4543-9A92-3DB67BA3D92A@dilger.ca>
Date:   Fri, 20 Apr 2018 14:26:13 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     David Howells <dhowells@...hat.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vfs: Undo an overly zealous MS_RDONLY -> SB_RDONLY
 conversion

On Apr 20, 2018, at 11:03 AM, Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> 
> On Fri, Apr 20, 2018 at 5:35 AM, David Howells <dhowells@...hat.com> wrote:
>> In do_mount() when the MS_* flags are being converted to MNT_* flags,
>> MS_RDONLY got accidentally convered to SB_RDONLY.
> 
> Applied.
> 
> I guess they have the same value (1). How did you notice? Do you have
> some patches that turn the kernel flags into a bitwise type? Or did
> you just happen on it manually?

Making s_flags and mnt_flags differently-named enums would help make
this problem more obvious (and some compilers might complain if used
incorrectly).  That also makes it more clear what kind of flags are
being passed to do_mount(), rather than "unsigned long flags".

Even while looking at the code for this, I see that s_flags is being
used incorrectly with MS_* flags all over the place:

static inline bool sb_rdonly(const struct super_block *sb) {
	return sb->s_flags & MS_RDONLY;
}

void inode_add_lru(struct inode *inode)
{
        if (!(inode->i_state & (I_DIRTY_ALL | I_SYNC |
                                I_FREEING | I_WILL_FREE)) &&
            !atomic_read(&inode->i_count) && inode->i_sb->s_flags & MS_ACTIVE)
                inode_lru_list_add(inode);
}

A quick grep showed 243 lines matching "->s_flags.*MS_".

Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ