net: Compute protocol sequence numbers and fragment IDs using MD5, CVE-2011-3188
[linux-flexiantxendom0-natty.git] / net / ipv4 / inetpeer.c
1 /*
2  *              INETPEER - A storage for permanent information about peers
3  *
4  *  This source is covered by the GNU GPL, the same as all kernel sources.
5  *
6  *  Authors:    Andrey V. Savochkin <saw@msu.ru>
7  */
8
9 #include <linux/module.h>
10 #include <linux/types.h>
11 #include <linux/slab.h>
12 #include <linux/interrupt.h>
13 #include <linux/spinlock.h>
14 #include <linux/random.h>
15 #include <linux/timer.h>
16 #include <linux/time.h>
17 #include <linux/kernel.h>
18 #include <linux/mm.h>
19 #include <linux/net.h>
20 #include <net/ip.h>
21 #include <net/inetpeer.h>
22 #include <net/secure_seq.h>
23
24 /*
25  *  Theory of operations.
26  *  We keep one entry for each peer IP address.  The nodes contains long-living
27  *  information about the peer which doesn't depend on routes.
28  *  At this moment this information consists only of ID field for the next
29  *  outgoing IP packet.  This field is incremented with each packet as encoded
30  *  in inet_getid() function (include/net/inetpeer.h).
31  *  At the moment of writing this notes identifier of IP packets is generated
32  *  to be unpredictable using this code only for packets subjected
33  *  (actually or potentially) to defragmentation.  I.e. DF packets less than
34  *  PMTU in size uses a constant ID and do not use this code (see
35  *  ip_select_ident() in include/net/ip.h).
36  *
37  *  Route cache entries hold references to our nodes.
38  *  New cache entries get references via lookup by destination IP address in
39  *  the avl tree.  The reference is grabbed only when it's needed i.e. only
40  *  when we try to output IP packet which needs an unpredictable ID (see
41  *  __ip_select_ident() in net/ipv4/route.c).
42  *  Nodes are removed only when reference counter goes to 0.
43  *  When it's happened the node may be removed when a sufficient amount of
44  *  time has been passed since its last use.  The less-recently-used entry can
45  *  also be removed if the pool is overloaded i.e. if the total amount of
46  *  entries is greater-or-equal than the threshold.
47  *
48  *  Node pool is organised as an AVL tree.
49  *  Such an implementation has been chosen not just for fun.  It's a way to
50  *  prevent easy and efficient DoS attacks by creating hash collisions.  A huge
51  *  amount of long living nodes in a single hash slot would significantly delay
52  *  lookups performed with disabled BHs.
53  *
54  *  Serialisation issues.
55  *  1.  Nodes may appear in the tree only with the pool lock held.
56  *  2.  Nodes may disappear from the tree only with the pool lock held
57  *      AND reference count being 0.
58  *  3.  Nodes appears and disappears from unused node list only under
59  *      "inet_peer_unused_lock".
60  *  4.  Global variable peer_total is modified under the pool lock.
61  *  5.  struct inet_peer fields modification:
62  *              avl_left, avl_right, avl_parent, avl_height: pool lock
63  *              unused: unused node list lock
64  *              refcnt: atomically against modifications on other CPU;
65  *                 usually under some other lock to prevent node disappearing
66  *              dtime: unused node list lock
67  *              daddr: unchangeable
68  *              ip_id_count: atomic value (no lock needed)
69  */
70
71 static struct kmem_cache *peer_cachep __read_mostly;
72
73 #define node_height(x) x->avl_height
74
75 #define peer_avl_empty ((struct inet_peer *)&peer_fake_node)
76 #define peer_avl_empty_rcu ((struct inet_peer __rcu __force *)&peer_fake_node)
77 static const struct inet_peer peer_fake_node = {
78         .avl_left       = peer_avl_empty_rcu,
79         .avl_right      = peer_avl_empty_rcu,
80         .avl_height     = 0
81 };
82
83 struct inet_peer_base {
84         struct inet_peer __rcu *root;
85         spinlock_t      lock;
86         int             total;
87 };
88
89 static struct inet_peer_base v4_peers = {
90         .root           = peer_avl_empty_rcu,
91         .lock           = __SPIN_LOCK_UNLOCKED(v4_peers.lock),
92         .total          = 0,
93 };
94
95 static struct inet_peer_base v6_peers = {
96         .root           = peer_avl_empty_rcu,
97         .lock           = __SPIN_LOCK_UNLOCKED(v6_peers.lock),
98         .total          = 0,
99 };
100
101 #define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */
102
103 /* Exported for sysctl_net_ipv4.  */
104 int inet_peer_threshold __read_mostly = 65536 + 128;    /* start to throw entries more
105                                          * aggressively at this stage */
106 int inet_peer_minttl __read_mostly = 120 * HZ;  /* TTL under high load: 120 sec */
107 int inet_peer_maxttl __read_mostly = 10 * 60 * HZ;      /* usual time to live: 10 min */
108 int inet_peer_gc_mintime __read_mostly = 10 * HZ;
109 int inet_peer_gc_maxtime __read_mostly = 120 * HZ;
110
111 static struct {
112         struct list_head        list;
113         spinlock_t              lock;
114 } unused_peers = {
115         .list                   = LIST_HEAD_INIT(unused_peers.list),
116         .lock                   = __SPIN_LOCK_UNLOCKED(unused_peers.lock),
117 };
118
119 static void peer_check_expire(unsigned long dummy);
120 static DEFINE_TIMER(peer_periodic_timer, peer_check_expire, 0, 0);
121
122
123 /* Called from ip_output.c:ip_init  */
124 void __init inet_initpeers(void)
125 {
126         struct sysinfo si;
127
128         /* Use the straight interface to information about memory. */
129         si_meminfo(&si);
130         /* The values below were suggested by Alexey Kuznetsov
131          * <kuznet@ms2.inr.ac.ru>.  I don't have any opinion about the values
132          * myself.  --SAW
133          */
134         if (si.totalram <= (32768*1024)/PAGE_SIZE)
135                 inet_peer_threshold >>= 1; /* max pool size about 1MB on IA32 */
136         if (si.totalram <= (16384*1024)/PAGE_SIZE)
137                 inet_peer_threshold >>= 1; /* about 512KB */
138         if (si.totalram <= (8192*1024)/PAGE_SIZE)
139                 inet_peer_threshold >>= 2; /* about 128KB */
140
141         peer_cachep = kmem_cache_create("inet_peer_cache",
142                         sizeof(struct inet_peer),
143                         0, SLAB_HWCACHE_ALIGN | SLAB_PANIC,
144                         NULL);
145
146         /* All the timers, started at system startup tend
147            to synchronize. Perturb it a bit.
148          */
149         peer_periodic_timer.expires = jiffies
150                 + net_random() % inet_peer_gc_maxtime
151                 + inet_peer_gc_maxtime;
152         add_timer(&peer_periodic_timer);
153 }
154
155 /* Called with or without local BH being disabled. */
156 static void unlink_from_unused(struct inet_peer *p)
157 {
158         if (!list_empty(&p->unused)) {
159                 spin_lock_bh(&unused_peers.lock);
160                 list_del_init(&p->unused);
161                 spin_unlock_bh(&unused_peers.lock);
162         }
163 }
164
165 static int addr_compare(const struct inetpeer_addr *a,
166                         const struct inetpeer_addr *b)
167 {
168         int i, n = (a->family == AF_INET ? 1 : 4);
169
170         for (i = 0; i < n; i++) {
171                 if (a->a6[i] == b->a6[i])
172                         continue;
173                 if (a->a6[i] < b->a6[i])
174                         return -1;
175                 return 1;
176         }
177
178         return 0;
179 }
180
181 /*
182  * Called with local BH disabled and the pool lock held.
183  */
184 #define lookup(_daddr, _stack, _base)                           \
185 ({                                                              \
186         struct inet_peer *u;                                    \
187         struct inet_peer __rcu **v;                             \
188                                                                 \
189         stackptr = _stack;                                      \
190         *stackptr++ = &_base->root;                             \
191         for (u = rcu_dereference_protected(_base->root,         \
192                         lockdep_is_held(&_base->lock));         \
193              u != peer_avl_empty; ) {                           \
194                 int cmp = addr_compare(_daddr, &u->daddr);      \
195                 if (cmp == 0)                                   \
196                         break;                                  \
197                 if (cmp == -1)                                  \
198                         v = &u->avl_left;                       \
199                 else                                            \
200                         v = &u->avl_right;                      \
201                 *stackptr++ = v;                                \
202                 u = rcu_dereference_protected(*v,               \
203                         lockdep_is_held(&_base->lock));         \
204         }                                                       \
205         u;                                                      \
206 })
207
208 /*
209  * Called with rcu_read_lock_bh()
210  * Because we hold no lock against a writer, its quite possible we fall
211  * in an endless loop.
212  * But every pointer we follow is guaranteed to be valid thanks to RCU.
213  * We exit from this function if number of links exceeds PEER_MAXDEPTH
214  */
215 static struct inet_peer *lookup_rcu_bh(const struct inetpeer_addr *daddr,
216                                        struct inet_peer_base *base)
217 {
218         struct inet_peer *u = rcu_dereference_bh(base->root);
219         int count = 0;
220
221         while (u != peer_avl_empty) {
222                 int cmp = addr_compare(daddr, &u->daddr);
223                 if (cmp == 0) {
224                         /* Before taking a reference, check if this entry was
225                          * deleted, unlink_from_pool() sets refcnt=-1 to make
226                          * distinction between an unused entry (refcnt=0) and
227                          * a freed one.
228                          */
229                         if (unlikely(!atomic_add_unless(&u->refcnt, 1, -1)))
230                                 u = NULL;
231                         return u;
232                 }
233                 if (cmp == -1)
234                         u = rcu_dereference_bh(u->avl_left);
235                 else
236                         u = rcu_dereference_bh(u->avl_right);
237                 if (unlikely(++count == PEER_MAXDEPTH))
238                         break;
239         }
240         return NULL;
241 }
242
243 /* Called with local BH disabled and the pool lock held. */
244 #define lookup_rightempty(start, base)                          \
245 ({                                                              \
246         struct inet_peer *u;                                    \
247         struct inet_peer __rcu **v;                             \
248         *stackptr++ = &start->avl_left;                         \
249         v = &start->avl_left;                                   \
250         for (u = rcu_dereference_protected(*v,                  \
251                         lockdep_is_held(&base->lock));          \
252              u->avl_right != peer_avl_empty_rcu; ) {            \
253                 v = &u->avl_right;                              \
254                 *stackptr++ = v;                                \
255                 u = rcu_dereference_protected(*v,               \
256                         lockdep_is_held(&base->lock));          \
257         }                                                       \
258         u;                                                      \
259 })
260
261 /* Called with local BH disabled and the pool lock held.
262  * Variable names are the proof of operation correctness.
263  * Look into mm/map_avl.c for more detail description of the ideas.
264  */
265 static void peer_avl_rebalance(struct inet_peer __rcu **stack[],
266                                struct inet_peer __rcu ***stackend,
267                                struct inet_peer_base *base)
268 {
269         struct inet_peer __rcu **nodep;
270         struct inet_peer *node, *l, *r;
271         int lh, rh;
272
273         while (stackend > stack) {
274                 nodep = *--stackend;
275                 node = rcu_dereference_protected(*nodep,
276                                 lockdep_is_held(&base->lock));
277                 l = rcu_dereference_protected(node->avl_left,
278                                 lockdep_is_held(&base->lock));
279                 r = rcu_dereference_protected(node->avl_right,
280                                 lockdep_is_held(&base->lock));
281                 lh = node_height(l);
282                 rh = node_height(r);
283                 if (lh > rh + 1) { /* l: RH+2 */
284                         struct inet_peer *ll, *lr, *lrl, *lrr;
285                         int lrh;
286                         ll = rcu_dereference_protected(l->avl_left,
287                                 lockdep_is_held(&base->lock));
288                         lr = rcu_dereference_protected(l->avl_right,
289                                 lockdep_is_held(&base->lock));
290                         lrh = node_height(lr);
291                         if (lrh <= node_height(ll)) {   /* ll: RH+1 */
292                                 RCU_INIT_POINTER(node->avl_left, lr);   /* lr: RH or RH+1 */
293                                 RCU_INIT_POINTER(node->avl_right, r);   /* r: RH */
294                                 node->avl_height = lrh + 1; /* RH+1 or RH+2 */
295                                 RCU_INIT_POINTER(l->avl_left, ll);       /* ll: RH+1 */
296                                 RCU_INIT_POINTER(l->avl_right, node);   /* node: RH+1 or RH+2 */
297                                 l->avl_height = node->avl_height + 1;
298                                 RCU_INIT_POINTER(*nodep, l);
299                         } else { /* ll: RH, lr: RH+1 */
300                                 lrl = rcu_dereference_protected(lr->avl_left,
301                                         lockdep_is_held(&base->lock));  /* lrl: RH or RH-1 */
302                                 lrr = rcu_dereference_protected(lr->avl_right,
303                                         lockdep_is_held(&base->lock));  /* lrr: RH or RH-1 */
304                                 RCU_INIT_POINTER(node->avl_left, lrr);  /* lrr: RH or RH-1 */
305                                 RCU_INIT_POINTER(node->avl_right, r);   /* r: RH */
306                                 node->avl_height = rh + 1; /* node: RH+1 */
307                                 RCU_INIT_POINTER(l->avl_left, ll);      /* ll: RH */
308                                 RCU_INIT_POINTER(l->avl_right, lrl);    /* lrl: RH or RH-1 */
309                                 l->avl_height = rh + 1; /* l: RH+1 */
310                                 RCU_INIT_POINTER(lr->avl_left, l);      /* l: RH+1 */
311                                 RCU_INIT_POINTER(lr->avl_right, node);  /* node: RH+1 */
312                                 lr->avl_height = rh + 2;
313                                 RCU_INIT_POINTER(*nodep, lr);
314                         }
315                 } else if (rh > lh + 1) { /* r: LH+2 */
316                         struct inet_peer *rr, *rl, *rlr, *rll;
317                         int rlh;
318                         rr = rcu_dereference_protected(r->avl_right,
319                                 lockdep_is_held(&base->lock));
320                         rl = rcu_dereference_protected(r->avl_left,
321                                 lockdep_is_held(&base->lock));
322                         rlh = node_height(rl);
323                         if (rlh <= node_height(rr)) {   /* rr: LH+1 */
324                                 RCU_INIT_POINTER(node->avl_right, rl);  /* rl: LH or LH+1 */
325                                 RCU_INIT_POINTER(node->avl_left, l);    /* l: LH */
326                                 node->avl_height = rlh + 1; /* LH+1 or LH+2 */
327                                 RCU_INIT_POINTER(r->avl_right, rr);     /* rr: LH+1 */
328                                 RCU_INIT_POINTER(r->avl_left, node);    /* node: LH+1 or LH+2 */
329                                 r->avl_height = node->avl_height + 1;
330                                 RCU_INIT_POINTER(*nodep, r);
331                         } else { /* rr: RH, rl: RH+1 */
332                                 rlr = rcu_dereference_protected(rl->avl_right,
333                                         lockdep_is_held(&base->lock));  /* rlr: LH or LH-1 */
334                                 rll = rcu_dereference_protected(rl->avl_left,
335                                         lockdep_is_held(&base->lock));  /* rll: LH or LH-1 */
336                                 RCU_INIT_POINTER(node->avl_right, rll); /* rll: LH or LH-1 */
337                                 RCU_INIT_POINTER(node->avl_left, l);    /* l: LH */
338                                 node->avl_height = lh + 1; /* node: LH+1 */
339                                 RCU_INIT_POINTER(r->avl_right, rr);     /* rr: LH */
340                                 RCU_INIT_POINTER(r->avl_left, rlr);     /* rlr: LH or LH-1 */
341                                 r->avl_height = lh + 1; /* r: LH+1 */
342                                 RCU_INIT_POINTER(rl->avl_right, r);     /* r: LH+1 */
343                                 RCU_INIT_POINTER(rl->avl_left, node);   /* node: LH+1 */
344                                 rl->avl_height = lh + 2;
345                                 RCU_INIT_POINTER(*nodep, rl);
346                         }
347                 } else {
348                         node->avl_height = (lh > rh ? lh : rh) + 1;
349                 }
350         }
351 }
352
353 /* Called with local BH disabled and the pool lock held. */
354 #define link_to_pool(n, base)                                   \
355 do {                                                            \
356         n->avl_height = 1;                                      \
357         n->avl_left = peer_avl_empty_rcu;                       \
358         n->avl_right = peer_avl_empty_rcu;                      \
359         /* lockless readers can catch us now */                 \
360         rcu_assign_pointer(**--stackptr, n);                    \
361         peer_avl_rebalance(stack, stackptr, base);              \
362 } while (0)
363
364 static void inetpeer_free_rcu(struct rcu_head *head)
365 {
366         kmem_cache_free(peer_cachep, container_of(head, struct inet_peer, rcu));
367 }
368
369 /* May be called with local BH enabled. */
370 static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base,
371                              struct inet_peer __rcu **stack[PEER_MAXDEPTH])
372 {
373         int do_free;
374
375         do_free = 0;
376
377         spin_lock_bh(&base->lock);
378         /* Check the reference counter.  It was artificially incremented by 1
379          * in cleanup() function to prevent sudden disappearing.  If we can
380          * atomically (because of lockless readers) take this last reference,
381          * it's safe to remove the node and free it later.
382          * We use refcnt=-1 to alert lockless readers this entry is deleted.
383          */
384         if (atomic_cmpxchg(&p->refcnt, 1, -1) == 1) {
385                 struct inet_peer __rcu ***stackptr, ***delp;
386                 if (lookup(&p->daddr, stack, base) != p)
387                         BUG();
388                 delp = stackptr - 1; /* *delp[0] == p */
389                 if (p->avl_left == peer_avl_empty_rcu) {
390                         *delp[0] = p->avl_right;
391                         --stackptr;
392                 } else {
393                         /* look for a node to insert instead of p */
394                         struct inet_peer *t;
395                         t = lookup_rightempty(p, base);
396                         BUG_ON(rcu_dereference_protected(*stackptr[-1],
397                                         lockdep_is_held(&base->lock)) != t);
398                         **--stackptr = t->avl_left;
399                         /* t is removed, t->daddr > x->daddr for any
400                          * x in p->avl_left subtree.
401                          * Put t in the old place of p. */
402                         RCU_INIT_POINTER(*delp[0], t);
403                         t->avl_left = p->avl_left;
404                         t->avl_right = p->avl_right;
405                         t->avl_height = p->avl_height;
406                         BUG_ON(delp[1] != &p->avl_left);
407                         delp[1] = &t->avl_left; /* was &p->avl_left */
408                 }
409                 peer_avl_rebalance(stack, stackptr, base);
410                 base->total--;
411                 do_free = 1;
412         }
413         spin_unlock_bh(&base->lock);
414
415         if (do_free)
416                 call_rcu_bh(&p->rcu, inetpeer_free_rcu);
417         else
418                 /* The node is used again.  Decrease the reference counter
419                  * back.  The loop "cleanup -> unlink_from_unused
420                  *   -> unlink_from_pool -> putpeer -> link_to_unused
421                  *   -> cleanup (for the same node)"
422                  * doesn't really exist because the entry will have a
423                  * recent deletion time and will not be cleaned again soon.
424                  */
425                 inet_putpeer(p);
426 }
427
428 static struct inet_peer_base *family_to_base(int family)
429 {
430         return (family == AF_INET ? &v4_peers : &v6_peers);
431 }
432
433 static struct inet_peer_base *peer_to_base(struct inet_peer *p)
434 {
435         return family_to_base(p->daddr.family);
436 }
437
438 /* May be called with local BH enabled. */
439 static int cleanup_once(unsigned long ttl, struct inet_peer __rcu **stack[PEER_MAXDEPTH])
440 {
441         struct inet_peer *p = NULL;
442
443         /* Remove the first entry from the list of unused nodes. */
444         spin_lock_bh(&unused_peers.lock);
445         if (!list_empty(&unused_peers.list)) {
446                 __u32 delta;
447
448                 p = list_first_entry(&unused_peers.list, struct inet_peer, unused);
449                 delta = (__u32)jiffies - p->dtime;
450
451                 if (delta < ttl) {
452                         /* Do not prune fresh entries. */
453                         spin_unlock_bh(&unused_peers.lock);
454                         return -1;
455                 }
456
457                 list_del_init(&p->unused);
458
459                 /* Grab an extra reference to prevent node disappearing
460                  * before unlink_from_pool() call. */
461                 atomic_inc(&p->refcnt);
462         }
463         spin_unlock_bh(&unused_peers.lock);
464
465         if (p == NULL)
466                 /* It means that the total number of USED entries has
467                  * grown over inet_peer_threshold.  It shouldn't really
468                  * happen because of entry limits in route cache. */
469                 return -1;
470
471         unlink_from_pool(p, peer_to_base(p), stack);
472         return 0;
473 }
474
475 /* Called with or without local BH being disabled. */
476 struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
477 {
478         struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr;
479         struct inet_peer_base *base = family_to_base(daddr->family);
480         struct inet_peer *p;
481
482         /* Look up for the address quickly, lockless.
483          * Because of a concurrent writer, we might not find an existing entry.
484          */
485         rcu_read_lock_bh();
486         p = lookup_rcu_bh(daddr, base);
487         rcu_read_unlock_bh();
488
489         if (p) {
490                 /* The existing node has been found.
491                  * Remove the entry from unused list if it was there.
492                  */
493                 unlink_from_unused(p);
494                 return p;
495         }
496
497         /* retry an exact lookup, taking the lock before.
498          * At least, nodes should be hot in our cache.
499          */
500         spin_lock_bh(&base->lock);
501         p = lookup(daddr, stack, base);
502         if (p != peer_avl_empty) {
503                 atomic_inc(&p->refcnt);
504                 spin_unlock_bh(&base->lock);
505                 /* Remove the entry from unused list if it was there. */
506                 unlink_from_unused(p);
507                 return p;
508         }
509         p = create ? kmem_cache_alloc(peer_cachep, GFP_ATOMIC) : NULL;
510         if (p) {
511                 p->daddr = *daddr;
512                 atomic_set(&p->refcnt, 1);
513                 atomic_set(&p->rid, 0);
514                 atomic_set(&p->ip_id_count, secure_ip_id(daddr->a4));
515                 p->tcp_ts_stamp = 0;
516                 INIT_LIST_HEAD(&p->unused);
517
518
519                 /* Link the node. */
520                 link_to_pool(p, base);
521                 base->total++;
522         }
523         spin_unlock_bh(&base->lock);
524
525         if (base->total >= inet_peer_threshold)
526                 /* Remove one less-recently-used entry. */
527                 cleanup_once(0, stack);
528
529         return p;
530 }
531
532 static int compute_total(void)
533 {
534         return v4_peers.total + v6_peers.total;
535 }
536 EXPORT_SYMBOL_GPL(inet_getpeer);
537
538 /* Called with local BH disabled. */
539 static void peer_check_expire(unsigned long dummy)
540 {
541         unsigned long now = jiffies;
542         int ttl, total;
543         struct inet_peer __rcu **stack[PEER_MAXDEPTH];
544
545         total = compute_total();
546         if (total >= inet_peer_threshold)
547                 ttl = inet_peer_minttl;
548         else
549                 ttl = inet_peer_maxttl
550                                 - (inet_peer_maxttl - inet_peer_minttl) / HZ *
551                                         total / inet_peer_threshold * HZ;
552         while (!cleanup_once(ttl, stack)) {
553                 if (jiffies != now)
554                         break;
555         }
556
557         /* Trigger the timer after inet_peer_gc_mintime .. inet_peer_gc_maxtime
558          * interval depending on the total number of entries (more entries,
559          * less interval). */
560         total = compute_total();
561         if (total >= inet_peer_threshold)
562                 peer_periodic_timer.expires = jiffies + inet_peer_gc_mintime;
563         else
564                 peer_periodic_timer.expires = jiffies
565                         + inet_peer_gc_maxtime
566                         - (inet_peer_gc_maxtime - inet_peer_gc_mintime) / HZ *
567                                 total / inet_peer_threshold * HZ;
568         add_timer(&peer_periodic_timer);
569 }
570
571 void inet_putpeer(struct inet_peer *p)
572 {
573         local_bh_disable();
574
575         if (atomic_dec_and_lock(&p->refcnt, &unused_peers.lock)) {
576                 list_add_tail(&p->unused, &unused_peers.list);
577                 p->dtime = (__u32)jiffies;
578                 spin_unlock(&unused_peers.lock);
579         }
580
581         local_bh_enable();
582 }
583 EXPORT_SYMBOL_GPL(inet_putpeer);