mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +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
@ -10,6 +10,7 @@
|
||||
#include <linux/uio.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/splice.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/fs.h>
|
||||
#include "overlayfs.h"
|
||||
@ -520,7 +521,9 @@ static long ovl_real_ioctl(struct file *file, unsigned int cmd,
|
||||
return ret;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(security_file_ioctl);
|
||||
|
||||
static inline unsigned long mmap_prot(struct file *file, unsigned long prot)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user