Revert "netfilter: xt_qtaguid: fix crash on non-full sks"
[firefly-linux-kernel-4.4.55.git] / net / netfilter / xt_quota2.c
index 44ebdcc75965c75c32efe65cce03d7897f2d06e2..99592ae56d9b0d6743cc3eaf7127f1452f4052de 100644 (file)
@@ -52,12 +52,9 @@ static DEFINE_SPINLOCK(counter_list_lock);
 
 static struct proc_dir_entry *proc_xt_quota;
 static unsigned int quota_list_perms = S_IRUGO | S_IWUSR;
-static unsigned int quota_list_uid   = 0;
-static unsigned int quota_list_gid   = 0;
+static kuid_t quota_list_uid = KUIDT_INIT(0);
+static kgid_t quota_list_gid = KGIDT_INIT(0);
 module_param_named(perms, quota_list_perms, uint, S_IRUGO | S_IWUSR);
-module_param_named(uid, quota_list_uid, uint, S_IRUGO | S_IWUSR);
-module_param_named(gid, quota_list_gid, uint, S_IRUGO | S_IWUSR);
-
 
 #ifdef CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG
 static void quota2_log(unsigned int hooknum,
@@ -122,7 +119,7 @@ static void quota2_log(unsigned int hooknum,
 }
 #endif  /* if+else CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG */
 
-static int quota_proc_read(struct file *file, char __user *buf,
+static ssize_t quota_proc_read(struct file *file, char __user *buf,
                           size_t size, loff_t *ppos)
 {
        struct xt_quota_counter *e = PDE_DATA(file_inode(file));
@@ -135,7 +132,7 @@ static int quota_proc_read(struct file *file, char __user *buf,
        return simple_read_from_buffer(buf, size, ppos, tmp, tmp_size);
 }
 
-static int quota_proc_write(struct file *file, const char __user *input,
+static ssize_t quota_proc_write(struct file *file, const char __user *input,
                             size_t size, loff_t *ppos)
 {
        struct xt_quota_counter *e = PDE_DATA(file_inode(file));