#include <linux/proc_fs.h>
#include <linux/shmem_fs.h>
#include <linux/security.h>
+#include <linux/vs_base.h>
+
#include <asm/uaccess.h>
#include "util.h"
.open = shm_open, /* callback for a new vm-area open */
.close = shm_close, /* callback for when the vm-area is released */
.nopage = shmem_nopage,
+#ifdef CONFIG_NUMA
+ .set_policy = shmem_set_policy,
+ .get_policy = shmem_get_policy,
+#endif
};
static int newseg (key_t key, int shmflg, size_t size)
return -ENOMEM;
shp->shm_perm.key = key;
+ shp->shm_perm.xid = current->xid;
shp->shm_flags = (shmflg & S_IRWXUGO);
shp->shm_perm.security = NULL;
struct shmid_kernel* shp;
shp = shm_lock(i);
- if(shp!=NULL) {
+ if (shp) {
#define SMALL_STRING "%10d %10d %4o %10u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n"
#define BIG_STRING "%10d %10d %4o %21u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n"
char *format;
+ if (!vx_check(shp->shm_perm.xid, VX_IDENT)) {
+ shm_unlock(shp);
+ continue;
+ }
if (sizeof(size_t) <= sizeof(int))
format = SMALL_STRING;
else