OSDN Git Service

selinux: convert cond_list to array
[tomoyo/tomoyo-test1.git] / security / selinux / selinuxfs.c
index 79c7109..533ab17 100644 (file)
@@ -668,6 +668,14 @@ static ssize_t sel_write_checkreqprot(struct file *file, const char __user *buf,
        if (sscanf(page, "%u", &new_value) != 1)
                goto out;
 
+       if (new_value) {
+               char comm[sizeof(current->comm)];
+
+               memcpy(comm, current->comm, sizeof(comm));
+               pr_warn_once("SELinux: %s (%d) set checkreqprot to 1. This is deprecated and will be rejected in a future kernel release.\n",
+                            comm, current->pid);
+       }
+
        fsi->state->checkreqprot = new_value ? 1 : 0;
        length = count;
 out:
@@ -1327,14 +1335,14 @@ static void sel_remove_entries(struct dentry *de)
 
 static int sel_make_bools(struct selinux_fs_info *fsi)
 {
-       int i, ret;
+       int ret;
        ssize_t len;
        struct dentry *dentry = NULL;
        struct dentry *dir = fsi->bool_dir;
        struct inode *inode = NULL;
        struct inode_security_struct *isec;
        char **names = NULL, *page;
-       int num;
+       u32 i, num;
        int *values = NULL;
        u32 sid;
 
@@ -1536,6 +1544,7 @@ static struct avc_cache_stats *sel_avc_get_stat_idx(loff_t *idx)
                *idx = cpu + 1;
                return &per_cpu(avc_cache_stats, cpu);
        }
+       (*idx)++;
        return NULL;
 }