mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
494 lines
14 KiB
Diff
494 lines
14 KiB
Diff
---
|
|
arch/alpha/kernel/osf_sys.c | 11 ++++----
|
|
arch/mips/kernel/sysirix.c | 12 ++++-----
|
|
arch/parisc/hpux/sys_hpux.c | 11 ++++----
|
|
arch/sparc64/solaris/fs.c | 16 ++++--------
|
|
fs/compat.c | 13 +++++-----
|
|
fs/ecryptfs/super.c | 5 +++-
|
|
fs/nfsd/nfs4xdr.c | 2 -
|
|
fs/nfsd/vfs.c | 2 -
|
|
fs/open.c | 53 ++++++++++++++++++++++++++++++++++---------
|
|
include/asm-arm/statfs.h | 6 +++-
|
|
include/asm-generic/statfs.h | 9 ++++---
|
|
include/asm-ia64/compat.h | 3 +-
|
|
include/asm-ia64/statfs.h | 9 ++++---
|
|
include/asm-parisc/compat.h | 3 +-
|
|
include/asm-parisc/statfs.h | 9 ++++---
|
|
include/asm-powerpc/compat.h | 3 +-
|
|
include/asm-powerpc/statfs.h | 9 ++++---
|
|
include/asm-s390/compat.h | 3 +-
|
|
include/asm-s390/statfs.h | 9 ++++---
|
|
include/asm-sparc64/compat.h | 3 +-
|
|
include/asm-sparc64/statfs.h | 9 ++++---
|
|
include/asm-x86_64/compat.h | 3 +-
|
|
include/asm-x86_64/statfs.h | 9 ++++---
|
|
include/linux/fs.h | 2 -
|
|
include/linux/statfs.h | 13 +++++++++-
|
|
kernel/acct.c | 2 -
|
|
26 files changed, 151 insertions(+), 78 deletions(-)
|
|
|
|
Index: linux-2.6-apparmor/arch/alpha/kernel/osf_sys.c
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/arch/alpha/kernel/osf_sys.c
|
|
+++ linux-2.6-apparmor/arch/alpha/kernel/osf_sys.c
|
|
@@ -244,11 +244,11 @@ linux_to_osf_statfs(struct kstatfs *linu
|
|
}
|
|
|
|
static int
|
|
-do_osf_statfs(struct dentry * dentry, struct osf_statfs __user *buffer,
|
|
- unsigned long bufsiz)
|
|
+do_osf_statfs(struct dentry * dentry, struct vfsmount *mnt,
|
|
+ struct osf_statfs __user *buffer, unsigned long bufsiz)
|
|
{
|
|
struct kstatfs linux_stat;
|
|
- int error = vfs_statfs(dentry, &linux_stat);
|
|
+ int error = vfs_statfs(dentry, mnt, &linux_stat);
|
|
if (!error)
|
|
error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
|
|
return error;
|
|
@@ -262,7 +262,7 @@ osf_statfs(char __user *path, struct osf
|
|
|
|
retval = user_path_walk(path, &nd);
|
|
if (!retval) {
|
|
- retval = do_osf_statfs(nd.dentry, buffer, bufsiz);
|
|
+ retval = do_osf_statfs(nd.dentry, nd.mnt, buffer, bufsiz);
|
|
path_release(&nd);
|
|
}
|
|
return retval;
|
|
@@ -277,7 +277,8 @@ osf_fstatfs(unsigned long fd, struct osf
|
|
retval = -EBADF;
|
|
file = fget(fd);
|
|
if (file) {
|
|
- retval = do_osf_statfs(file->f_path.dentry, buffer, bufsiz);
|
|
+ retval = do_osf_statfs(file->f_path.dentry, file->f_path.mnt,
|
|
+ buffer, bufsiz);
|
|
fput(file);
|
|
}
|
|
return retval;
|
|
Index: linux-2.6-apparmor/arch/mips/kernel/sysirix.c
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/arch/mips/kernel/sysirix.c
|
|
+++ linux-2.6-apparmor/arch/mips/kernel/sysirix.c
|
|
@@ -694,7 +694,7 @@ asmlinkage int irix_statfs(const char __
|
|
if (error)
|
|
goto out;
|
|
|
|
- error = vfs_statfs(nd.dentry, &kbuf);
|
|
+ error = vfs_statfs(nd.dentry, nd.mnt, &kbuf);
|
|
if (error)
|
|
goto dput_and_out;
|
|
|
|
@@ -732,7 +732,7 @@ asmlinkage int irix_fstatfs(unsigned int
|
|
goto out;
|
|
}
|
|
|
|
- error = vfs_statfs(file->f_path.dentry, &kbuf);
|
|
+ error = vfs_statfs(file->f_path.dentry, file->f_path.mnt, &kbuf);
|
|
if (error)
|
|
goto out_f;
|
|
|
|
@@ -1360,7 +1360,7 @@ asmlinkage int irix_statvfs(char __user
|
|
error = user_path_walk(fname, &nd);
|
|
if (error)
|
|
goto out;
|
|
- error = vfs_statfs(nd.dentry, &kbuf);
|
|
+ error = vfs_statfs(nd.dentry, nd.mnt, &kbuf);
|
|
if (error)
|
|
goto dput_and_out;
|
|
|
|
@@ -1406,7 +1406,7 @@ asmlinkage int irix_fstatvfs(int fd, str
|
|
error = -EBADF;
|
|
goto out;
|
|
}
|
|
- error = vfs_statfs(file->f_path.dentry, &kbuf);
|
|
+ error = vfs_statfs(file->f_path.dentry, file->f_path.mnt, &kbuf);
|
|
if (error)
|
|
goto out_f;
|
|
|
|
@@ -1611,7 +1611,7 @@ asmlinkage int irix_statvfs64(char __use
|
|
error = user_path_walk(fname, &nd);
|
|
if (error)
|
|
goto out;
|
|
- error = vfs_statfs(nd.dentry, &kbuf);
|
|
+ error = vfs_statfs(nd.dentry, nd.mnt, &kbuf);
|
|
if (error)
|
|
goto dput_and_out;
|
|
|
|
@@ -1658,7 +1658,7 @@ asmlinkage int irix_fstatvfs64(int fd, s
|
|
error = -EBADF;
|
|
goto out;
|
|
}
|
|
- error = vfs_statfs(file->f_path.dentry, &kbuf);
|
|
+ error = vfs_statfs(file->f_path.dentry, file->f_path.mnt, &kbuf);
|
|
if (error)
|
|
goto out_f;
|
|
|
|
Index: linux-2.6-apparmor/arch/parisc/hpux/sys_hpux.c
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/arch/parisc/hpux/sys_hpux.c
|
|
+++ linux-2.6-apparmor/arch/parisc/hpux/sys_hpux.c
|
|
@@ -145,7 +145,7 @@ static int hpux_ustat(dev_t dev, struct
|
|
s = user_get_super(dev);
|
|
if (s == NULL)
|
|
goto out;
|
|
- err = vfs_statfs(s->s_root, &sbuf);
|
|
+ err = vfs_statfs(s->s_root, NULL, &sbuf);
|
|
drop_super(s);
|
|
if (err)
|
|
goto out;
|
|
@@ -186,12 +186,13 @@ struct hpux_statfs {
|
|
int16_t f_pad;
|
|
};
|
|
|
|
-static int vfs_statfs_hpux(struct dentry *dentry, struct hpux_statfs *buf)
|
|
+static int vfs_statfs_hpux(struct dentry *dentry, struct vfsmount *mnt,
|
|
+ struct hpux_statfs *buf)
|
|
{
|
|
struct kstatfs st;
|
|
int retval;
|
|
|
|
- retval = vfs_statfs(dentry, &st);
|
|
+ retval = vfs_statfs(dentry, mnt, &st);
|
|
if (retval)
|
|
return retval;
|
|
|
|
@@ -219,7 +220,7 @@ asmlinkage long hpux_statfs(const char _
|
|
error = user_path_walk(path, &nd);
|
|
if (!error) {
|
|
struct hpux_statfs tmp;
|
|
- error = vfs_statfs_hpux(nd.dentry, &tmp);
|
|
+ error = vfs_statfs_hpux(nd.dentry, nd.mnt, &tmp);
|
|
if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
|
|
error = -EFAULT;
|
|
path_release(&nd);
|
|
@@ -237,7 +238,7 @@ asmlinkage long hpux_fstatfs(unsigned in
|
|
file = fget(fd);
|
|
if (!file)
|
|
goto out;
|
|
- error = vfs_statfs_hpux(file->f_path.dentry, &tmp);
|
|
+ error = vfs_statfs_hpux(file->f_path.dentry, file->f_path.mnt, &tmp);
|
|
if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
|
|
error = -EFAULT;
|
|
fput(file);
|
|
Index: linux-2.6-apparmor/arch/sparc64/solaris/fs.c
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/arch/sparc64/solaris/fs.c
|
|
+++ linux-2.6-apparmor/arch/sparc64/solaris/fs.c
|
|
@@ -361,15 +361,12 @@ static int report_statvfs(struct vfsmoun
|
|
int error;
|
|
struct sol_statvfs __user *ss = A(buf);
|
|
|
|
- error = vfs_statfs(mnt->mnt_root, &s);
|
|
+ error = vfs_statfs(mnt->mnt_root, mnt, &s);
|
|
if (!error) {
|
|
const char *p = mnt->mnt_sb->s_type->name;
|
|
- int i = 0;
|
|
int j = strlen (p);
|
|
|
|
if (j > 15) j = 15;
|
|
- if (IS_RDONLY(inode)) i = 1;
|
|
- if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
|
|
if (!sysv_valid_dev(inode->i_sb->s_dev))
|
|
return -EOVERFLOW;
|
|
if (put_user (s.f_bsize, &ss->f_bsize) ||
|
|
@@ -384,7 +381,8 @@ static int report_statvfs(struct vfsmoun
|
|
__copy_to_user (ss->f_basetype,p,j) ||
|
|
__put_user (0, (char __user *)&ss->f_basetype[j]) ||
|
|
__put_user (s.f_namelen, &ss->f_namemax) ||
|
|
- __put_user (i, &ss->f_flag) ||
|
|
+ __put_user (s.s_flag & (ST_RDONLY | ST_NOSUID),
|
|
+ &ss->f_flag) ||
|
|
__clear_user (&ss->f_fstr, 32))
|
|
return -EFAULT;
|
|
}
|
|
@@ -397,15 +395,12 @@ static int report_statvfs64(struct vfsmo
|
|
int error;
|
|
struct sol_statvfs64 __user *ss = A(buf);
|
|
|
|
- error = vfs_statfs(mnt->mnt_root, &s);
|
|
+ error = vfs_statfs(mnt->mnt_root, mnt, &s);
|
|
if (!error) {
|
|
const char *p = mnt->mnt_sb->s_type->name;
|
|
- int i = 0;
|
|
int j = strlen (p);
|
|
|
|
if (j > 15) j = 15;
|
|
- if (IS_RDONLY(inode)) i = 1;
|
|
- if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
|
|
if (!sysv_valid_dev(inode->i_sb->s_dev))
|
|
return -EOVERFLOW;
|
|
if (put_user (s.f_bsize, &ss->f_bsize) ||
|
|
@@ -420,7 +415,8 @@ static int report_statvfs64(struct vfsmo
|
|
__copy_to_user (ss->f_basetype,p,j) ||
|
|
__put_user (0, (char __user *)&ss->f_basetype[j]) ||
|
|
__put_user (s.f_namelen, &ss->f_namemax) ||
|
|
- __put_user (i, &ss->f_flag) ||
|
|
+ __put_user (s.s_flag & (ST_RDONLY | ST_NOSUID),
|
|
+ &ss->f_flag) ||
|
|
__clear_user (&ss->f_fstr, 32))
|
|
return -EFAULT;
|
|
}
|
|
Index: linux-2.6-apparmor/include/asm-arm/statfs.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-arm/statfs.h
|
|
+++ linux-2.6-apparmor/include/asm-arm/statfs.h
|
|
@@ -17,7 +17,8 @@ struct statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
};
|
|
|
|
/*
|
|
@@ -36,7 +37,8 @@ struct statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
} __attribute__ ((packed,aligned(4)));
|
|
|
|
#endif
|
|
Index: linux-2.6-apparmor/include/asm-ia64/compat.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-ia64/compat.h
|
|
+++ linux-2.6-apparmor/include/asm-ia64/compat.h
|
|
@@ -102,7 +102,8 @@ struct compat_statfs {
|
|
compat_fsid_t f_fsid;
|
|
int f_namelen; /* SunOS ignores this field. */
|
|
int f_frsize;
|
|
- int f_spare[5];
|
|
+ int f_flag;
|
|
+ int f_spare[4];
|
|
};
|
|
|
|
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
|
|
Index: linux-2.6-apparmor/include/asm-ia64/statfs.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-ia64/statfs.h
|
|
+++ linux-2.6-apparmor/include/asm-ia64/statfs.h
|
|
@@ -27,7 +27,8 @@ struct statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
|
|
@@ -42,7 +43,8 @@ struct statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct compat_statfs64 {
|
|
@@ -56,7 +58,8 @@ struct compat_statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
} __attribute__((packed));
|
|
|
|
#endif /* _ASM_IA64_STATFS_H */
|
|
Index: linux-2.6-apparmor/include/asm-parisc/compat.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-parisc/compat.h
|
|
+++ linux-2.6-apparmor/include/asm-parisc/compat.h
|
|
@@ -102,7 +102,8 @@ struct compat_statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
s32 f_namelen;
|
|
s32 f_frsize;
|
|
- s32 f_spare[5];
|
|
+ s32 f_flag;
|
|
+ s32 f_spare[4];
|
|
};
|
|
|
|
struct compat_sigcontext {
|
|
Index: linux-2.6-apparmor/include/asm-parisc/statfs.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-parisc/statfs.h
|
|
+++ linux-2.6-apparmor/include/asm-parisc/statfs.h
|
|
@@ -24,7 +24,8 @@ struct statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct statfs64 {
|
|
@@ -38,7 +39,8 @@ struct statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct compat_statfs64 {
|
|
@@ -52,7 +54,8 @@ struct compat_statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
};
|
|
|
|
#endif
|
|
Index: linux-2.6-apparmor/include/asm-powerpc/compat.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-powerpc/compat.h
|
|
+++ linux-2.6-apparmor/include/asm-powerpc/compat.h
|
|
@@ -97,7 +97,8 @@ struct compat_statfs {
|
|
compat_fsid_t f_fsid;
|
|
int f_namelen; /* SunOS ignores this field. */
|
|
int f_frsize;
|
|
- int f_spare[5];
|
|
+ int f_flag;
|
|
+ int f_spare[4];
|
|
};
|
|
|
|
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
|
|
Index: linux-2.6-apparmor/include/asm-powerpc/statfs.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-powerpc/statfs.h
|
|
+++ linux-2.6-apparmor/include/asm-powerpc/statfs.h
|
|
@@ -26,7 +26,8 @@ struct statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct statfs64 {
|
|
@@ -40,7 +41,8 @@ struct statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct compat_statfs64 {
|
|
@@ -54,7 +56,8 @@ struct compat_statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
};
|
|
#endif /* ! __powerpc64__ */
|
|
#endif
|
|
Index: linux-2.6-apparmor/include/asm-s390/compat.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-s390/compat.h
|
|
+++ linux-2.6-apparmor/include/asm-s390/compat.h
|
|
@@ -127,7 +127,8 @@ struct compat_statfs {
|
|
compat_fsid_t f_fsid;
|
|
s32 f_namelen;
|
|
s32 f_frsize;
|
|
- s32 f_spare[6];
|
|
+ s32 f_flag;
|
|
+ s32 f_spare[5];
|
|
};
|
|
|
|
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
|
|
Index: linux-2.6-apparmor/include/asm-s390/statfs.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-s390/statfs.h
|
|
+++ linux-2.6-apparmor/include/asm-s390/statfs.h
|
|
@@ -36,7 +36,8 @@ struct statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
int f_namelen;
|
|
int f_frsize;
|
|
- int f_spare[5];
|
|
+ int f_flag;
|
|
+ int f_spare[4];
|
|
};
|
|
|
|
struct statfs64 {
|
|
@@ -50,7 +51,8 @@ struct statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
int f_namelen;
|
|
int f_frsize;
|
|
- int f_spare[5];
|
|
+ int f_flag;
|
|
+ int f_spare[4];
|
|
};
|
|
|
|
struct compat_statfs64 {
|
|
@@ -64,7 +66,8 @@ struct compat_statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
};
|
|
|
|
#endif /* __s390x__ */
|
|
Index: linux-2.6-apparmor/include/asm-sparc64/compat.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-sparc64/compat.h
|
|
+++ linux-2.6-apparmor/include/asm-sparc64/compat.h
|
|
@@ -131,7 +131,8 @@ struct compat_statfs {
|
|
compat_fsid_t f_fsid;
|
|
int f_namelen; /* SunOS ignores this field. */
|
|
int f_frsize;
|
|
- int f_spare[5];
|
|
+ int f_flag;
|
|
+ int f_spare[4];
|
|
};
|
|
|
|
#define COMPAT_RLIM_INFINITY 0x7fffffff
|
|
Index: linux-2.6-apparmor/include/asm-sparc64/statfs.h
|
|
===================================================================
|
|
--- linux-2.6-apparmor.orig/include/asm-sparc64/statfs.h
|
|
+++ linux-2.6-apparmor/include/asm-sparc64/statfs.h
|
|
@@ -21,7 +21,8 @@ struct statfs {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct statfs64 {
|
|
@@ -35,7 +36,8 @@ struct statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
long f_namelen;
|
|
long f_frsize;
|
|
- long f_spare[5];
|
|
+ long f_flag;
|
|
+ long f_spare[4];
|
|
};
|
|
|
|
struct compat_statfs64 {
|
|
@@ -49,7 +51,8 @@ struct compat_statfs64 {
|
|
__kernel_fsid_t f_fsid;
|
|
__u32 f_namelen;
|
|
__u32 f_frsize;
|
|
- __u32 f_spare[5];
|
|
+ __u32 f_flag;
|
|
+ __u32 f_spare[4];
|
|
};
|
|
|
|
#endif
|