]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vfs: canonicalize create mode in build_open_flags()
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 15 Aug 2012 11:01:24 +0000 (13:01 +0200)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 8 Oct 2012 10:28:08 +0000 (03:28 -0700)
commit0cffe8133408c03f32c60b7c07f27654f7f12861
treefb3a35a1618b53fde7e13f500805b68560bd7625
parente107eebfed9e711af68a056aab97a0150ee4cd81
vfs: canonicalize create mode in build_open_flags()

commit e68726ff72cf7ba5e7d789857fcd9a75ca573f03 upstream.

Userspace can pass weird create mode in open(2) that we canonicalize to
"(mode & S_IALLUGO) | S_IFREG" in vfs_create().

The problem is that we use the uncanonicalized mode before calling vfs_create()
with unforseen consequences.

So do the canonicalization early in build_open_flags().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/open.c