mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ovl: call secutiry hook in ovl_real_ioctl()
Verify LSM permissions for underlying file, since vfs_ioctl() doesn't do it. [Stephen Rothwell] export security_file_ioctl Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
56230d9567
commit
292f902a40
2 changed files with 5 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include <linux/uio.h>
|
#include <linux/uio.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <linux/splice.h>
|
#include <linux/splice.h>
|
||||||
|
#include <linux/security.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include "overlayfs.h"
|
#include "overlayfs.h"
|
||||||
|
@ -520,7 +521,9 @@ static long ovl_real_ioctl(struct file *file, unsigned int cmd,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
old_cred = ovl_override_creds(file_inode(file)->i_sb);
|
old_cred = ovl_override_creds(file_inode(file)->i_sb);
|
||||||
ret = vfs_ioctl(real.file, cmd, arg);
|
ret = security_file_ioctl(real.file, cmd, arg);
|
||||||
|
if (!ret)
|
||||||
|
ret = vfs_ioctl(real.file, cmd, arg);
|
||||||
revert_creds(old_cred);
|
revert_creds(old_cred);
|
||||||
|
|
||||||
fdput(real);
|
fdput(real);
|
||||||
|
|
|
@ -1459,6 +1459,7 @@ int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
return call_int_hook(file_ioctl, 0, file, cmd, arg);
|
return call_int_hook(file_ioctl, 0, file, cmd, arg);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(security_file_ioctl);
|
||||||
|
|
||||||
static inline unsigned long mmap_prot(struct file *file, unsigned long prot)
|
static inline unsigned long mmap_prot(struct file *file, unsigned long prot)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue