netfilter: xtables: obtain random bytes earlier, in checkentry
[pandora-kernel.git] / net / netfilter / xt_recent.c
1 /*
2  * Copyright (c) 2006 Patrick McHardy <kaber@trash.net>
3  * Copyright © CC Computer Consultants GmbH, 2007 - 2008
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * This is a replacement of the old ipt_recent module, which carried the
10  * following copyright notice:
11  *
12  * Author: Stephen Frost <sfrost@snowman.net>
13  * Copyright 2002-2003, Stephen Frost, 2.5.x port by laforge@netfilter.org
14  */
15 #include <linux/init.h>
16 #include <linux/ip.h>
17 #include <linux/ipv6.h>
18 #include <linux/module.h>
19 #include <linux/moduleparam.h>
20 #include <linux/proc_fs.h>
21 #include <linux/seq_file.h>
22 #include <linux/string.h>
23 #include <linux/ctype.h>
24 #include <linux/list.h>
25 #include <linux/random.h>
26 #include <linux/jhash.h>
27 #include <linux/bitops.h>
28 #include <linux/skbuff.h>
29 #include <linux/inet.h>
30 #include <net/net_namespace.h>
31
32 #include <linux/netfilter/x_tables.h>
33 #include <linux/netfilter/xt_recent.h>
34
35 MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
36 MODULE_AUTHOR("Jan Engelhardt <jengelh@computergmbh.de>");
37 MODULE_DESCRIPTION("Xtables: \"recently-seen\" host matching for IPv4");
38 MODULE_LICENSE("GPL");
39 MODULE_ALIAS("ipt_recent");
40 MODULE_ALIAS("ip6t_recent");
41
42 static unsigned int ip_list_tot = 100;
43 static unsigned int ip_pkt_list_tot = 20;
44 static unsigned int ip_list_hash_size = 0;
45 static unsigned int ip_list_perms = 0644;
46 static unsigned int ip_list_uid = 0;
47 static unsigned int ip_list_gid = 0;
48 module_param(ip_list_tot, uint, 0400);
49 module_param(ip_pkt_list_tot, uint, 0400);
50 module_param(ip_list_hash_size, uint, 0400);
51 module_param(ip_list_perms, uint, 0400);
52 module_param(ip_list_uid, uint, 0400);
53 module_param(ip_list_gid, uint, 0400);
54 MODULE_PARM_DESC(ip_list_tot, "number of IPs to remember per list");
55 MODULE_PARM_DESC(ip_pkt_list_tot, "number of packets per IP to remember (max. 255)");
56 MODULE_PARM_DESC(ip_list_hash_size, "size of hash table used to look up IPs");
57 MODULE_PARM_DESC(ip_list_perms, "permissions on /proc/net/xt_recent/* files");
58 MODULE_PARM_DESC(ip_list_uid,"owner of /proc/net/xt_recent/* files");
59 MODULE_PARM_DESC(ip_list_gid,"owning group of /proc/net/xt_recent/* files");
60
61 struct recent_entry {
62         struct list_head        list;
63         struct list_head        lru_list;
64         union nf_inet_addr      addr;
65         u_int16_t               family;
66         u_int8_t                ttl;
67         u_int8_t                index;
68         u_int16_t               nstamps;
69         unsigned long           stamps[0];
70 };
71
72 struct recent_table {
73         struct list_head        list;
74         char                    name[XT_RECENT_NAME_LEN];
75         unsigned int            refcnt;
76         unsigned int            entries;
77         struct list_head        lru_list;
78         struct list_head        iphash[0];
79 };
80
81 static LIST_HEAD(tables);
82 static DEFINE_SPINLOCK(recent_lock);
83 static DEFINE_MUTEX(recent_mutex);
84
85 #ifdef CONFIG_PROC_FS
86 #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
87 static struct proc_dir_entry *proc_old_dir;
88 #endif
89 static struct proc_dir_entry *recent_proc_dir;
90 static const struct file_operations recent_old_fops, recent_mt_fops;
91 #endif
92
93 static u_int32_t hash_rnd __read_mostly;
94 static bool hash_rnd_inited __read_mostly;
95
96 static inline unsigned int recent_entry_hash4(const union nf_inet_addr *addr)
97 {
98         return jhash_1word((__force u32)addr->ip, hash_rnd) &
99                (ip_list_hash_size - 1);
100 }
101
102 static inline unsigned int recent_entry_hash6(const union nf_inet_addr *addr)
103 {
104         return jhash2((u32 *)addr->ip6, ARRAY_SIZE(addr->ip6), hash_rnd) &
105                (ip_list_hash_size - 1);
106 }
107
108 static struct recent_entry *
109 recent_entry_lookup(const struct recent_table *table,
110                     const union nf_inet_addr *addrp, u_int16_t family,
111                     u_int8_t ttl)
112 {
113         struct recent_entry *e;
114         unsigned int h;
115
116         if (family == NFPROTO_IPV4)
117                 h = recent_entry_hash4(addrp);
118         else
119                 h = recent_entry_hash6(addrp);
120
121         list_for_each_entry(e, &table->iphash[h], list)
122                 if (e->family == family &&
123                     memcmp(&e->addr, addrp, sizeof(e->addr)) == 0 &&
124                     (ttl == e->ttl || ttl == 0 || e->ttl == 0))
125                         return e;
126         return NULL;
127 }
128
129 static void recent_entry_remove(struct recent_table *t, struct recent_entry *e)
130 {
131         list_del(&e->list);
132         list_del(&e->lru_list);
133         kfree(e);
134         t->entries--;
135 }
136
137 static struct recent_entry *
138 recent_entry_init(struct recent_table *t, const union nf_inet_addr *addr,
139                   u_int16_t family, u_int8_t ttl)
140 {
141         struct recent_entry *e;
142
143         if (t->entries >= ip_list_tot) {
144                 e = list_entry(t->lru_list.next, struct recent_entry, lru_list);
145                 recent_entry_remove(t, e);
146         }
147         e = kmalloc(sizeof(*e) + sizeof(e->stamps[0]) * ip_pkt_list_tot,
148                     GFP_ATOMIC);
149         if (e == NULL)
150                 return NULL;
151         memcpy(&e->addr, addr, sizeof(e->addr));
152         e->ttl       = ttl;
153         e->stamps[0] = jiffies;
154         e->nstamps   = 1;
155         e->index     = 1;
156         e->family    = family;
157         if (family == NFPROTO_IPV4)
158                 list_add_tail(&e->list, &t->iphash[recent_entry_hash4(addr)]);
159         else
160                 list_add_tail(&e->list, &t->iphash[recent_entry_hash6(addr)]);
161         list_add_tail(&e->lru_list, &t->lru_list);
162         t->entries++;
163         return e;
164 }
165
166 static void recent_entry_update(struct recent_table *t, struct recent_entry *e)
167 {
168         e->stamps[e->index++] = jiffies;
169         if (e->index > e->nstamps)
170                 e->nstamps = e->index;
171         e->index %= ip_pkt_list_tot;
172         list_move_tail(&e->lru_list, &t->lru_list);
173 }
174
175 static struct recent_table *recent_table_lookup(const char *name)
176 {
177         struct recent_table *t;
178
179         list_for_each_entry(t, &tables, list)
180                 if (!strcmp(t->name, name))
181                         return t;
182         return NULL;
183 }
184
185 static void recent_table_flush(struct recent_table *t)
186 {
187         struct recent_entry *e, *next;
188         unsigned int i;
189
190         for (i = 0; i < ip_list_hash_size; i++)
191                 list_for_each_entry_safe(e, next, &t->iphash[i], list)
192                         recent_entry_remove(t, e);
193 }
194
195 static bool
196 recent_mt(const struct sk_buff *skb, const struct xt_match_param *par)
197 {
198         const struct xt_recent_mtinfo *info = par->matchinfo;
199         struct recent_table *t;
200         struct recent_entry *e;
201         union nf_inet_addr addr = {};
202         u_int8_t ttl;
203         bool ret = info->invert;
204
205         if (par->match->family == NFPROTO_IPV4) {
206                 const struct iphdr *iph = ip_hdr(skb);
207
208                 if (info->side == XT_RECENT_DEST)
209                         addr.ip = iph->daddr;
210                 else
211                         addr.ip = iph->saddr;
212
213                 ttl = iph->ttl;
214         } else {
215                 const struct ipv6hdr *iph = ipv6_hdr(skb);
216
217                 if (info->side == XT_RECENT_DEST)
218                         memcpy(&addr.in6, &iph->daddr, sizeof(addr.in6));
219                 else
220                         memcpy(&addr.in6, &iph->saddr, sizeof(addr.in6));
221
222                 ttl = iph->hop_limit;
223         }
224
225         /* use TTL as seen before forwarding */
226         if (par->out != NULL && skb->sk == NULL)
227                 ttl++;
228
229         spin_lock_bh(&recent_lock);
230         t = recent_table_lookup(info->name);
231         e = recent_entry_lookup(t, &addr, par->match->family,
232                                 (info->check_set & XT_RECENT_TTL) ? ttl : 0);
233         if (e == NULL) {
234                 if (!(info->check_set & XT_RECENT_SET))
235                         goto out;
236                 e = recent_entry_init(t, &addr, par->match->family, ttl);
237                 if (e == NULL)
238                         *par->hotdrop = true;
239                 ret = !ret;
240                 goto out;
241         }
242
243         if (info->check_set & XT_RECENT_SET)
244                 ret = !ret;
245         else if (info->check_set & XT_RECENT_REMOVE) {
246                 recent_entry_remove(t, e);
247                 ret = !ret;
248         } else if (info->check_set & (XT_RECENT_CHECK | XT_RECENT_UPDATE)) {
249                 unsigned long time = jiffies - info->seconds * HZ;
250                 unsigned int i, hits = 0;
251
252                 for (i = 0; i < e->nstamps; i++) {
253                         if (info->seconds && time_after(time, e->stamps[i]))
254                                 continue;
255                         if (++hits >= info->hit_count) {
256                                 ret = !ret;
257                                 break;
258                         }
259                 }
260         }
261
262         if (info->check_set & XT_RECENT_SET ||
263             (info->check_set & XT_RECENT_UPDATE && ret)) {
264                 recent_entry_update(t, e);
265                 e->ttl = ttl;
266         }
267 out:
268         spin_unlock_bh(&recent_lock);
269         return ret;
270 }
271
272 static bool recent_mt_check(const struct xt_mtchk_param *par)
273 {
274         const struct xt_recent_mtinfo *info = par->matchinfo;
275         struct recent_table *t;
276 #ifdef CONFIG_PROC_FS
277         struct proc_dir_entry *pde;
278 #endif
279         unsigned i;
280         bool ret = false;
281
282         if (unlikely(!hash_rnd_inited)) {
283                 get_random_bytes(&hash_rnd, sizeof(hash_rnd));
284                 hash_rnd_inited = true;
285         }
286         if (hweight8(info->check_set &
287                      (XT_RECENT_SET | XT_RECENT_REMOVE |
288                       XT_RECENT_CHECK | XT_RECENT_UPDATE)) != 1)
289                 return false;
290         if ((info->check_set & (XT_RECENT_SET | XT_RECENT_REMOVE)) &&
291             (info->seconds || info->hit_count))
292                 return false;
293         if (info->hit_count > ip_pkt_list_tot)
294                 return false;
295         if (info->name[0] == '\0' ||
296             strnlen(info->name, XT_RECENT_NAME_LEN) == XT_RECENT_NAME_LEN)
297                 return false;
298
299         mutex_lock(&recent_mutex);
300         t = recent_table_lookup(info->name);
301         if (t != NULL) {
302                 t->refcnt++;
303                 ret = true;
304                 goto out;
305         }
306
307         t = kzalloc(sizeof(*t) + sizeof(t->iphash[0]) * ip_list_hash_size,
308                     GFP_KERNEL);
309         if (t == NULL)
310                 goto out;
311         t->refcnt = 1;
312         strcpy(t->name, info->name);
313         INIT_LIST_HEAD(&t->lru_list);
314         for (i = 0; i < ip_list_hash_size; i++)
315                 INIT_LIST_HEAD(&t->iphash[i]);
316 #ifdef CONFIG_PROC_FS
317         pde = proc_create_data(t->name, ip_list_perms, recent_proc_dir,
318                   &recent_mt_fops, t);
319         if (pde == NULL) {
320                 kfree(t);
321                 goto out;
322         }
323         pde->uid = ip_list_uid;
324         pde->gid = ip_list_gid;
325 #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
326         pde = proc_create_data(t->name, ip_list_perms, proc_old_dir,
327                       &recent_old_fops, t);
328         if (pde == NULL) {
329                 remove_proc_entry(t->name, proc_old_dir);
330                 kfree(t);
331                 goto out;
332         }
333         pde->uid = ip_list_uid;
334         pde->gid = ip_list_gid;
335 #endif
336 #endif
337         spin_lock_bh(&recent_lock);
338         list_add_tail(&t->list, &tables);
339         spin_unlock_bh(&recent_lock);
340         ret = true;
341 out:
342         mutex_unlock(&recent_mutex);
343         return ret;
344 }
345
346 static void recent_mt_destroy(const struct xt_mtdtor_param *par)
347 {
348         const struct xt_recent_mtinfo *info = par->matchinfo;
349         struct recent_table *t;
350
351         mutex_lock(&recent_mutex);
352         t = recent_table_lookup(info->name);
353         if (--t->refcnt == 0) {
354                 spin_lock_bh(&recent_lock);
355                 list_del(&t->list);
356                 spin_unlock_bh(&recent_lock);
357 #ifdef CONFIG_PROC_FS
358 #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
359                 remove_proc_entry(t->name, proc_old_dir);
360 #endif
361                 remove_proc_entry(t->name, recent_proc_dir);
362 #endif
363                 recent_table_flush(t);
364                 kfree(t);
365         }
366         mutex_unlock(&recent_mutex);
367 }
368
369 #ifdef CONFIG_PROC_FS
370 struct recent_iter_state {
371         const struct recent_table *table;
372         unsigned int            bucket;
373 };
374
375 static void *recent_seq_start(struct seq_file *seq, loff_t *pos)
376         __acquires(recent_lock)
377 {
378         struct recent_iter_state *st = seq->private;
379         const struct recent_table *t = st->table;
380         struct recent_entry *e;
381         loff_t p = *pos;
382
383         spin_lock_bh(&recent_lock);
384
385         for (st->bucket = 0; st->bucket < ip_list_hash_size; st->bucket++)
386                 list_for_each_entry(e, &t->iphash[st->bucket], list)
387                         if (p-- == 0)
388                                 return e;
389         return NULL;
390 }
391
392 static void *recent_seq_next(struct seq_file *seq, void *v, loff_t *pos)
393 {
394         struct recent_iter_state *st = seq->private;
395         const struct recent_table *t = st->table;
396         const struct recent_entry *e = v;
397         const struct list_head *head = e->list.next;
398
399         while (head == &t->iphash[st->bucket]) {
400                 if (++st->bucket >= ip_list_hash_size)
401                         return NULL;
402                 head = t->iphash[st->bucket].next;
403         }
404         (*pos)++;
405         return list_entry(head, struct recent_entry, list);
406 }
407
408 static void recent_seq_stop(struct seq_file *s, void *v)
409         __releases(recent_lock)
410 {
411         spin_unlock_bh(&recent_lock);
412 }
413
414 static int recent_seq_show(struct seq_file *seq, void *v)
415 {
416         const struct recent_entry *e = v;
417         unsigned int i;
418
419         i = (e->index - 1) % ip_pkt_list_tot;
420         if (e->family == NFPROTO_IPV4)
421                 seq_printf(seq, "src=%pI4 ttl: %u last_seen: %lu oldest_pkt: %u",
422                            &e->addr.ip, e->ttl, e->stamps[i], e->index);
423         else
424                 seq_printf(seq, "src=%pI6 ttl: %u last_seen: %lu oldest_pkt: %u",
425                            &e->addr.in6, e->ttl, e->stamps[i], e->index);
426         for (i = 0; i < e->nstamps; i++)
427                 seq_printf(seq, "%s %lu", i ? "," : "", e->stamps[i]);
428         seq_printf(seq, "\n");
429         return 0;
430 }
431
432 static const struct seq_operations recent_seq_ops = {
433         .start          = recent_seq_start,
434         .next           = recent_seq_next,
435         .stop           = recent_seq_stop,
436         .show           = recent_seq_show,
437 };
438
439 static int recent_seq_open(struct inode *inode, struct file *file)
440 {
441         struct proc_dir_entry *pde = PDE(inode);
442         struct recent_iter_state *st;
443
444         st = __seq_open_private(file, &recent_seq_ops, sizeof(*st));
445         if (st == NULL)
446                 return -ENOMEM;
447
448         st->table    = pde->data;
449         return 0;
450 }
451
452 #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
453 static int recent_old_seq_open(struct inode *inode, struct file *filp)
454 {
455         static bool warned_of_old;
456
457         if (unlikely(!warned_of_old)) {
458                 printk(KERN_INFO KBUILD_MODNAME ": Use of /proc/net/ipt_recent"
459                        " is deprecated; use /proc/net/xt_recent.\n");
460                 warned_of_old = true;
461         }
462         return recent_seq_open(inode, filp);
463 }
464
465 static ssize_t recent_old_proc_write(struct file *file,
466                                      const char __user *input,
467                                      size_t size, loff_t *loff)
468 {
469         const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
470         struct recent_table *t = pde->data;
471         struct recent_entry *e;
472         char buf[sizeof("+255.255.255.255")], *c = buf;
473         union nf_inet_addr addr = {};
474         int add;
475
476         if (size > sizeof(buf))
477                 size = sizeof(buf);
478         if (copy_from_user(buf, input, size))
479                 return -EFAULT;
480
481         c = skip_spaces(c);
482
483         if (size - (c - buf) < 5)
484                 return c - buf;
485         if (!strncmp(c, "clear", 5)) {
486                 c += 5;
487                 spin_lock_bh(&recent_lock);
488                 recent_table_flush(t);
489                 spin_unlock_bh(&recent_lock);
490                 return c - buf;
491         }
492
493         switch (*c) {
494         case '-':
495                 add = 0;
496                 c++;
497                 break;
498         case '+':
499                 c++;
500         default:
501                 add = 1;
502                 break;
503         }
504         addr.ip = in_aton(c);
505
506         spin_lock_bh(&recent_lock);
507         e = recent_entry_lookup(t, &addr, NFPROTO_IPV4, 0);
508         if (e == NULL) {
509                 if (add)
510                         recent_entry_init(t, &addr, NFPROTO_IPV4, 0);
511         } else {
512                 if (add)
513                         recent_entry_update(t, e);
514                 else
515                         recent_entry_remove(t, e);
516         }
517         spin_unlock_bh(&recent_lock);
518         return size;
519 }
520
521 static const struct file_operations recent_old_fops = {
522         .open           = recent_old_seq_open,
523         .read           = seq_read,
524         .write          = recent_old_proc_write,
525         .release        = seq_release_private,
526         .owner          = THIS_MODULE,
527 };
528 #endif
529
530 static ssize_t
531 recent_mt_proc_write(struct file *file, const char __user *input,
532                      size_t size, loff_t *loff)
533 {
534         const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
535         struct recent_table *t = pde->data;
536         struct recent_entry *e;
537         char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
538         const char *c = buf;
539         union nf_inet_addr addr = {};
540         u_int16_t family;
541         bool add, succ;
542
543         if (size == 0)
544                 return 0;
545         if (size > sizeof(buf))
546                 size = sizeof(buf);
547         if (copy_from_user(buf, input, size) != 0)
548                 return -EFAULT;
549
550         /* Strict protocol! */
551         if (*loff != 0)
552                 return -ESPIPE;
553         switch (*c) {
554         case '/': /* flush table */
555                 spin_lock_bh(&recent_lock);
556                 recent_table_flush(t);
557                 spin_unlock_bh(&recent_lock);
558                 return size;
559         case '-': /* remove address */
560                 add = false;
561                 break;
562         case '+': /* add address */
563                 add = true;
564                 break;
565         default:
566                 printk(KERN_INFO KBUILD_MODNAME ": Need +ip, -ip or /\n");
567                 return -EINVAL;
568         }
569
570         ++c;
571         --size;
572         if (strnchr(c, size, ':') != NULL) {
573                 family = NFPROTO_IPV6;
574                 succ   = in6_pton(c, size, (void *)&addr, '\n', NULL);
575         } else {
576                 family = NFPROTO_IPV4;
577                 succ   = in4_pton(c, size, (void *)&addr, '\n', NULL);
578         }
579
580         if (!succ) {
581                 printk(KERN_INFO KBUILD_MODNAME ": illegal address written "
582                        "to procfs\n");
583                 return -EINVAL;
584         }
585
586         spin_lock_bh(&recent_lock);
587         e = recent_entry_lookup(t, &addr, family, 0);
588         if (e == NULL) {
589                 if (add)
590                         recent_entry_init(t, &addr, family, 0);
591         } else {
592                 if (add)
593                         recent_entry_update(t, e);
594                 else
595                         recent_entry_remove(t, e);
596         }
597         spin_unlock_bh(&recent_lock);
598         /* Note we removed one above */
599         *loff += size + 1;
600         return size + 1;
601 }
602
603 static const struct file_operations recent_mt_fops = {
604         .open    = recent_seq_open,
605         .read    = seq_read,
606         .write   = recent_mt_proc_write,
607         .release = seq_release_private,
608         .owner   = THIS_MODULE,
609 };
610 #endif /* CONFIG_PROC_FS */
611
612 static struct xt_match recent_mt_reg[] __read_mostly = {
613         {
614                 .name       = "recent",
615                 .revision   = 0,
616                 .family     = NFPROTO_IPV4,
617                 .match      = recent_mt,
618                 .matchsize  = sizeof(struct xt_recent_mtinfo),
619                 .checkentry = recent_mt_check,
620                 .destroy    = recent_mt_destroy,
621                 .me         = THIS_MODULE,
622         },
623         {
624                 .name       = "recent",
625                 .revision   = 0,
626                 .family     = NFPROTO_IPV6,
627                 .match      = recent_mt,
628                 .matchsize  = sizeof(struct xt_recent_mtinfo),
629                 .checkentry = recent_mt_check,
630                 .destroy    = recent_mt_destroy,
631                 .me         = THIS_MODULE,
632         },
633 };
634
635 static int __init recent_mt_init(void)
636 {
637         int err;
638
639         if (!ip_list_tot || !ip_pkt_list_tot || ip_pkt_list_tot > 255)
640                 return -EINVAL;
641         ip_list_hash_size = 1 << fls(ip_list_tot);
642
643         err = xt_register_matches(recent_mt_reg, ARRAY_SIZE(recent_mt_reg));
644 #ifdef CONFIG_PROC_FS
645         if (err)
646                 return err;
647         recent_proc_dir = proc_mkdir("xt_recent", init_net.proc_net);
648         if (recent_proc_dir == NULL) {
649                 xt_unregister_matches(recent_mt_reg, ARRAY_SIZE(recent_mt_reg));
650                 err = -ENOMEM;
651         }
652 #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
653         if (err < 0)
654                 return err;
655         proc_old_dir = proc_mkdir("ipt_recent", init_net.proc_net);
656         if (proc_old_dir == NULL) {
657                 remove_proc_entry("xt_recent", init_net.proc_net);
658                 xt_unregister_matches(recent_mt_reg, ARRAY_SIZE(recent_mt_reg));
659                 err = -ENOMEM;
660         }
661 #endif
662 #endif
663         return err;
664 }
665
666 static void __exit recent_mt_exit(void)
667 {
668         BUG_ON(!list_empty(&tables));
669         xt_unregister_matches(recent_mt_reg, ARRAY_SIZE(recent_mt_reg));
670 #ifdef CONFIG_PROC_FS
671 #ifdef CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT
672         remove_proc_entry("ipt_recent", init_net.proc_net);
673 #endif
674         remove_proc_entry("xt_recent", init_net.proc_net);
675 #endif
676 }
677
678 module_init(recent_mt_init);
679 module_exit(recent_mt_exit);