]> git.baikalelectronics.ru Git - kernel.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)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 15 Aug 2012 11:01:24 +0000 (13:01 +0200)
commit079d85ead08079dec451352173382111d7340a85
tree7d5f3416543a750574955fdef5f12b3dd498de05
parentfb5368e5f1196d6ec40d8733e65bfb6a0434d3a0
vfs: canonicalize create mode in build_open_flags()

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>
CC: stable@vger.kernel.org
fs/open.c