1. 20 3月, 2013 1 次提交
  2. 19 2月, 2013 2 次提交
  3. 11 2月, 2013 1 次提交
  4. 06 2月, 2013 1 次提交
    • S
      xfrm: Add a state resolution packet queue · a0073fe1
      Steffen Klassert 提交于
      As the default, we blackhole packets until the key manager resolves
      the states. This patch implements a packet queue where IPsec packets
      are queued until the states are resolved. We generate a dummy xfrm
      bundle, the output routine of the returned route enqueues the packet
      to a per policy queue and arms a timer that checks for state resolution
      when dst_output() is called. Once the states are resolved, the packets
      are sent out of the queue. If the states are not resolved after some
      time, the queue is flushed.
      
      This patch keeps the defaut behaviour to blackhole packets as long
      as we have no states. To enable the packet queue the sysctl
      xfrm_larval_drop must be switched off.
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      a0073fe1
  5. 01 2月, 2013 2 次提交
  6. 30 1月, 2013 1 次提交
  7. 21 1月, 2013 1 次提交
  8. 18 1月, 2013 1 次提交
    • N
      net/xfrm/xfrm_replay: avoid division by zero · e2f67259
      Nickolai Zeldovich 提交于
      All of the xfrm_replay->advance functions in xfrm_replay.c check if
      x->replay_esn->replay_window is zero (and return if so).  However,
      one of them, xfrm_replay_advance_bmp(), divides by that value (in the
      '%' operator) before doing the check, which can potentially trigger
      a divide-by-zero exception.  Some compilers will also assume that the
      earlier division means the value cannot be zero later, and thus will
      eliminate the subsequent zero check as dead code.
      
      This patch moves the division to after the check.
      Signed-off-by: NNickolai Zeldovich <nickolai@csail.mit.edu>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      e2f67259
  9. 17 1月, 2013 1 次提交
  10. 16 1月, 2013 2 次提交
  11. 08 1月, 2013 1 次提交
  12. 07 1月, 2013 1 次提交
  13. 19 11月, 2012 2 次提交
    • E
      net: Allow userns root to control llc, netfilter, netlink, packet, and xfrm · df008c91
      Eric W. Biederman 提交于
      Allow an unpriviled user who has created a user namespace, and then
      created a network namespace to effectively use the new network
      namespace, by reducing capable(CAP_NET_ADMIN) and
      capable(CAP_NET_RAW) calls to be ns_capable(net->user_ns,
      CAP_NET_ADMIN), or capable(net->user_ns, CAP_NET_RAW) calls.
      
      Allow creation of af_key sockets.
      Allow creation of llc sockets.
      Allow creation of af_packet sockets.
      
      Allow sending xfrm netlink control messages.
      
      Allow binding to netlink multicast groups.
      Allow sending to netlink multicast groups.
      Allow adding and dropping netlink multicast groups.
      Allow sending to all netlink multicast groups and port ids.
      
      Allow reading the netfilter SO_IP_SET socket option.
      Allow sending netfilter netlink messages.
      Allow setting and getting ip_vs netfilter socket options.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df008c91
    • E
      net: Don't export sysctls to unprivileged users · 464dc801
      Eric W. Biederman 提交于
      In preparation for supporting the creation of network namespaces
      by unprivileged users, modify all of the per net sysctl exports
      and refuse to allow them to unprivileged users.
      
      This makes it safe for unprivileged users in general to access
      per net sysctls, and allows sysctls to be exported to unprivileged
      users on an individual basis as they are deemed safe.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      464dc801
  14. 13 11月, 2012 1 次提交
    • S
      net: xfrm: use __this_cpu_read per-cpu helper · f7c83bcb
      Shan Wei 提交于
      this_cpu_ptr/this_cpu_read is faster than per_cpu_ptr(p, smp_processor_id())
      and can reduce  memory accesses.
      The latter helper needs to find the offset for current cpu,
      and needs more assembler instructions which objdump shows in following.
      
      this_cpu_ptr relocates and address. this_cpu_read() relocates the address
      and performs the fetch. this_cpu_read() saves you more instructions
      since it can do the relocation and the fetch in one instruction.
      
      per_cpu_ptr(p, smp_processor_id()):
        1e:   65 8b 04 25 00 00 00 00         mov    %gs:0x0,%eax
        26:   48 98                           cltq
        28:   31 f6                           xor    %esi,%esi
        2a:   48 c7 c7 00 00 00 00            mov    $0x0,%rdi
        31:   48 8b 04 c5 00 00 00 00         mov    0x0(,%rax,8),%rax
        39:   c7 44 10 04 14 00 00 00         movl   $0x14,0x4(%rax,%rdx,1)
      
      this_cpu_ptr(p)
        1e:   65 48 03 14 25 00 00 00 00      add    %gs:0x0,%rdx
        27:   31 f6                           xor    %esi,%esi
        29:   c7 42 04 14 00 00 00            movl   $0x14,0x4(%rdx)
        30:   48 c7 c7 00 00 00 00            mov    $0x0,%rdi
      Signed-off-by: NShan Wei <davidshan@tencent.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      f7c83bcb
  15. 08 11月, 2012 1 次提交
  16. 21 9月, 2012 6 次提交
  17. 19 9月, 2012 4 次提交
  18. 18 9月, 2012 1 次提交
    • E
      userns: Convert the audit loginuid to be a kuid · e1760bd5
      Eric W. Biederman 提交于
      Always store audit loginuids in type kuid_t.
      
      Print loginuids by converting them into uids in the appropriate user
      namespace, and then printing the resulting uid.
      
      Modify audit_get_loginuid to return a kuid_t.
      
      Modify audit_set_loginuid to take a kuid_t.
      
      Modify /proc/<pid>/loginuid on read to convert the loginuid into the
      user namespace of the opener of the file.
      
      Modify /proc/<pid>/loginud on write to convert the loginuid
      rom the user namespace of the opener of the file.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Paul Moore <paul@paul-moore.com> ?
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      e1760bd5
  19. 11 9月, 2012 2 次提交
  20. 09 9月, 2012 1 次提交
  21. 05 9月, 2012 1 次提交
  22. 01 9月, 2012 1 次提交
  23. 23 8月, 2012 1 次提交
    • E
      xfrm: fix RCU bugs · ef8531b6
      Eric Dumazet 提交于
      This patch reverts commit 56892261 (xfrm: Use rcu_dereference_bh to
      deference pointer protected by rcu_read_lock_bh), and fixes bugs
      introduced in commit 418a99ac ( Replace rwlock on xfrm_policy_afinfo
      with rcu )
      
      1) We properly use RCU variant in this file, not a mix of RCU/RCU_BH
      
      2) We must defer some writes after the synchronize_rcu() call or a reader
       can crash dereferencing NULL pointer.
      
      3) Now we use the xfrm_policy_afinfo_lock spinlock only from process
      context, we no longer need to block BH in xfrm_policy_register_afinfo()
      and xfrm_policy_unregister_afinfo()
      
      4) Can use RCU_INIT_POINTER() instead of rcu_assign_pointer() in
      xfrm_policy_unregister_afinfo()
      
      5) Remove a forward inline declaration (xfrm_policy_put_afinfo()),
        and also move xfrm_policy_get_afinfo() declaration.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Fan Du <fan.du@windriver.com>
      Cc: Priyanka Jain <Priyanka.Jain@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef8531b6
  24. 20 8月, 2012 1 次提交
    • P
      net: ipv6: fix oops in inet_putpeer() · 9d7b0fc1
      Patrick McHardy 提交于
      Commit 97bab73f (inet: Hide route peer accesses behind helpers.) introduced
      a bug in xfrm6_policy_destroy(). The xfrm_dst's _rt6i_peer member is not
      initialized, causing a false positive result from inetpeer_ptr_is_peer(),
      which in turn causes a NULL pointer dereference in inet_putpeer().
      
      Pid: 314, comm: kworker/0:1 Not tainted 3.6.0-rc1+ #17 To Be Filled By O.E.M. To Be Filled By O.E.M./P4S800D-X
      EIP: 0060:[<c03abf93>] EFLAGS: 00010246 CPU: 0
      EIP is at inet_putpeer+0xe/0x16
      EAX: 00000000 EBX: f3481700 ECX: 00000000 EDX: 000dd641
      ESI: f3481700 EDI: c05e949c EBP: f551def4 ESP: f551def4
       DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
      CR0: 8005003b CR2: 00000070 CR3: 3243d000 CR4: 00000750
      DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      DR6: ffff0ff0 DR7: 00000400
       f551df04 c0423de1 00000000 f3481700 f551df18 c038d5f7 f254b9f8 f551df28
       f34f85d8 f551df20 c03ef48d f551df3c c0396870 f30697e8 f24e1738 c05e98f4
       f5509540 c05cd2b4 f551df7c c0142d2b c043feb5 f5509540 00000000 c05cd2e8
       [<c0423de1>] xfrm6_dst_destroy+0x42/0xdb
       [<c038d5f7>] dst_destroy+0x1d/0xa4
       [<c03ef48d>] xfrm_bundle_flo_delete+0x2b/0x36
       [<c0396870>] flow_cache_gc_task+0x85/0x9f
       [<c0142d2b>] process_one_work+0x122/0x441
       [<c043feb5>] ? apic_timer_interrupt+0x31/0x38
       [<c03967eb>] ? flow_cache_new_hashrnd+0x2b/0x2b
       [<c0143e2d>] worker_thread+0x113/0x3cc
      
      Fix by adding a init_dst() callback to struct xfrm_policy_afinfo to
      properly initialize the dst's peer pointer.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d7b0fc1
  25. 17 8月, 2012 1 次提交
  26. 16 8月, 2012 1 次提交
  27. 15 8月, 2012 1 次提交