[PATCH] sanitize proc_sysctl
[deliverable/linux.git] / kernel / sysctl.c
index c9a0af887033e02f92d7ff89cd084f525387c00d..ff5abcca5ddfb3412b8016500002e7921c2404ba 100644 (file)
@@ -1932,6 +1932,21 @@ void unregister_sysctl_table(struct ctl_table_header * header)
        spin_unlock(&sysctl_lock);
 }
 
+int sysctl_is_seen(struct ctl_table_header *p)
+{
+       struct ctl_table_set *set = p->set;
+       int res;
+       spin_lock(&sysctl_lock);
+       if (p->unregistering)
+               res = 0;
+       else if (!set->is_seen)
+               res = 1;
+       else
+               res = set->is_seen(set);
+       spin_unlock(&sysctl_lock);
+       return res;
+}
+
 void setup_sysctl_set(struct ctl_table_set *p,
        struct ctl_table_set *parent,
        int (*is_seen)(struct ctl_table_set *))
This page took 0.028176 seconds and 5 git commands to generate.