#include <linux/swap.h>
#include <linux/aio.h>
-static struct vfsmount *shm_mnt;
+struct vfsmount *shm_mnt;
#ifdef CONFIG_SHMEM
/*
#define BOGO_DIRENT_SIZE 20
/* Symlink up to this size is kmalloc'ed instead of using a swappable page */
-#define SHORT_SYMLINK_LEN 128
+#define SHORT_SYMLINK_LEN 64
/*
* shmem_fallocate communicates with shmem_fault or shmem_writepage via
static int shmem_xattr_validate(const char *name)
{
struct { const char *prefix; size_t len; } arr[] = {
+
+#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
+ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN},
+#endif
+
{ XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN },
{ XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN }
};
if (err)
return err;
+#ifdef CONFIG_PAX_XATTR_PAX_FLAGS
+ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
+ if (strcmp(name, XATTR_NAME_PAX_FLAGS))
+ return -EOPNOTSUPP;
+ if (size > 8)
+ return -EINVAL;
+ }
+#endif
+
return simple_xattr_set(&info->xattrs, name, value, size, flags);
}
int err = -ENOMEM;
/* Round up to L1_CACHE_BYTES to resist false sharing */
- sbinfo = kzalloc(max((int)sizeof(struct shmem_sb_info),
- L1_CACHE_BYTES), GFP_KERNEL);
+ sbinfo = kzalloc(max(sizeof(struct shmem_sb_info), L1_CACHE_BYTES), GFP_KERNEL);
if (!sbinfo)
return -ENOMEM;