1. 25 Sep, 2009 1 commit
  2. 22 Sep, 2009 1 commit
  3. 18 Jun, 2009 1 commit
  4. 17 Jun, 2009 1 commit
  5. 28 Mar, 2009 1 commit
  6. 21 Mar, 2009 2 commits
  7. 10 Mar, 2009 1 commit
  8. 01 Feb, 2009 1 commit
  9. 13 Nov, 2008 1 commit
  10. 06 Oct, 2008 1 commit
  11. 20 Jul, 2008 1 commit
  12. 17 Jun, 2008 1 commit
    • David S. Miller's avatar
      ax25: Use sock_graft() and remove bogus sk_socket and sk_sleep init. · 9375cb8a
      David S. Miller authored
      
      
      The way that listening sockets work in ax25 is that the packet input
      code path creates new socks via ax25_make_new() and attaches them
      to the incoming SKB.  This SKB gets queued up into the listening
      socket's receive queue.
      
      When accept()'d the sock gets hooked up to the real parent socket.
      Alternatively, if the listening socket is closed and released, any
      unborn socks stuff up in the receive queue get released.
      
      So during this time period these sockets are unreachable in any
      other way, so no wakeup events nor references to their ->sk_socket
      and ->sk_sleep members can occur.  And even if they do, all such
      paths have to make NULL checks.
      
      So do not deceptively initialize them in ax25_make_new() to the
      values in the listening socket.  Leave them at NULL.
      
      Finally, use sock_graft() in ax25_accept().
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9375cb8a
  13. 25 Mar, 2008 2 commits
  14. 13 Feb, 2008 2 commits
    • Jarek Poplawski's avatar
      [AX25] ax25_timer: use mod_timer instead of add_timer · 21fab4a8
      Jarek Poplawski authored
      
      
      According to one of Jann's OOPS reports it looks like
      BUG_ON(timer_pending(timer)) triggers during add_timer()
      in ax25_start_t1timer(). This patch changes current use
      of: init_timer(), add_timer() and del_timer() to
      setup_timer() with mod_timer(), which should be safer
      anyway.
      Reported-by: default avatarJann Traschewski <jann@gmx.de>
      Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21fab4a8
    • Jarek Poplawski's avatar
      [AX25] af_ax25: remove sock lock in ax25_info_show() · 1105b5d1
      Jarek Poplawski authored
      This lockdep warning:
      
      > =======================================================
      > [ INFO: possible circular locking dependency detected ]
      > 2.6.24 #3
      
      
      > -------------------------------------------------------
      > swapper/0 is trying to acquire lock:
      >  (ax25_list_lock){-+..}, at: [<f91dd3b1>] ax25_destroy_socket+0x171/0x1f0 [ax25]
      >
      > but task is already holding lock:
      >  (slock-AF_AX25){-+..}, at: [<f91dbabc>] ax25_std_heartbeat_expiry+0x1c/0xe0 [ax25]
      >
      > which lock already depends on the new lock.
      ...
      
      shows that ax25_list_lock and slock-AF_AX25 are taken in different
      order: ax25_info_show() takes slock (bh_lock_sock(ax25->sk)) while
      ax25_list_lock is held, so reversely to other functions. To fix this
      the sock lock should be moved to ax25_info_start(), and there would
      be still problem with breaking ax25_list_lock (it seems this "proper"
      order isn't optimal yet). But, since it's only for reading proc info
      it seems this is not necessary (e.g.  ax25_send_to_raw() does similar
      reading without this lock too).
      
      So, this patch removes sock lock to avoid deadlock possibility; there
      is also used sock_i_ino() function, which reads sk_socket under proper
      read lock. Additionally printf format of this i_ino is changed to %lu.
      Reported-by: default avatarBernard Pidoux F6BVP <f6bvp@free.fr>
      Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1105b5d1
  15. 01 Feb, 2008 1 commit
  16. 28 Jan, 2008 2 commits
    • Eric Dumazet's avatar
      [AX25]: sparse cleanups · f16f3026
      Eric Dumazet authored
      
      
      net/ax25/ax25_route.c:251:13: warning: context imbalance in
      'ax25_rt_seq_start' - wrong count at exit
      net/ax25/ax25_route.c:276:13: warning: context imbalance in 'ax25_rt_seq_stop'
      - unexpected unlock
      net/ax25/ax25_std_timer.c:65:25: warning: expensive signed divide
      net/ax25/ax25_uid.c:46:1: warning: symbol 'ax25_uid_list' was not declared.
      Should it be static?
      net/ax25/ax25_uid.c:146:13: warning: context imbalance in 'ax25_uid_seq_start'
      - wrong count at exit
      net/ax25/ax25_uid.c:169:13: warning: context imbalance in 'ax25_uid_seq_stop'
      - unexpected unlock
      net/ax25/af_ax25.c:573:28: warning: expensive signed divide
      net/ax25/af_ax25.c:1865:13: warning: context imbalance in 'ax25_info_start' -
      wrong count at exit
      net/ax25/af_ax25.c:1888:13: warning: context imbalance in 'ax25_info_stop' -
      unexpected unlock
      net/ax25/ax25_ds_timer.c:133:25: warning: expensive signed divide
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f16f3026
    • Pavel Emelyanov's avatar
      [NET]: Convert init_timer into setup_timer · b24b8a24
      Pavel Emelyanov authored
      
      
      Many-many code in the kernel initialized the timer->function
      and  timer->data together with calling init_timer(timer). There
      is already a helper for this. Use it for networking code.
      
      The patch is HUGE, but makes the code 130 lines shorter
      (98 insertions(+), 228 deletions(-)).
      Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b24b8a24
  17. 11 Jan, 2008 1 commit
    • Jarek Poplawski's avatar
      [AX25] af_ax25: Possible circular locking. · ecd2ebde
      Jarek Poplawski authored
      Bernard Pidoux F6BVP reported:
      > When I killall kissattach I can see the following message.
      >
      > This happens on kernel 2.6.24-rc5 already patched with the 6 previously
      > patches I sent recently.
      >
      >
      > =======================================================
      > [ INFO: possible circular locking dependency detected ]
      > 2.6.23.9 #1
      > -------------------------------------------------------
      > kissattach/2906 is trying to acquire lock:
      >  (linkfail_lock){-+..}, at: [<d8bd4603>] ax25_link_failed+0x11/0x39 [ax25]
      >
      > but task is already holding lock:
      >  (ax25_list_lock){-+..}, at: [<d8bd7c7c>] ax25_device_event+0x38/0x84
      > [ax25]
      >
      > which lock already depends on the new lock.
      >
      >
      > the existing dependency chain (in reverse order) is:
      ...
      
      lockdep is worried about the different order here:
      
      #1 (rose_neigh_list_lock){-+..}:
      #3 (ax25_list_lock){-+..}:
      
      #0 (linkfail_lock){-+..}:
      #1 (rose_neigh_list_lock){-+..}:
      
      #3
      
       (ax25_list_lock){-+..}:
      #0 (linkfail_lock){-+..}:
      
      So, ax25_list_lock could be taken before and after linkfail_lock. 
      I don't know if this three-thread clutch is very probable (or
      possible at all), but it seems another bug reported by Bernard
      ("[...] system impossible to reboot with linux-2.6.24-rc5")
      could have similar source - namely ax25_list_lock held by
      ax25_kill_by_device() during ax25_disconnect(). It looks like the
      only place which calls ax25_disconnect() this way, so I guess, it
      isn't necessary.
      
      This patch is breaking the lock for ax25_disconnect().
      Reported-and-tested-by: default avatarBernard Pidoux <f6bvp@free.fr>
      Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ecd2ebde
  18. 10 Jan, 2008 1 commit
  19. 01 Nov, 2007 1 commit
  20. 10 Oct, 2007 4 commits
    • Eric W. Biederman's avatar
      [NET]: Make the device list and device lookups per namespace. · 881d966b
      Eric W. Biederman authored
      
      
      This patch makes most of the generic device layer network
      namespace safe.  This patch makes dev_base_head a
      network namespace variable, and then it picks up
      a few associated variables.  The functions:
      dev_getbyhwaddr
      dev_getfirsthwbytype
      dev_get_by_flags
      dev_get_by_name
      __dev_get_by_name
      dev_get_by_index
      __dev_get_by_index
      dev_ioctl
      dev_ethtool
      dev_load
      wireless_process_ioctl
      
      were modified to take a network namespace argument, and
      deal with it.
      
      vlan_ioctl_set and brioctl_set were modified so their
      hooks will receive a network namespace argument.
      
      So basically anthing in the core of the network stack that was
      affected to by the change of dev_base was modified to handle
      multiple network namespaces.  The rest of the network stack was
      simply modified to explicitly use &init_net the initial network
      namespace.  This can be fixed when those components of the network
      stack are modified to handle multiple network namespaces.
      
      For now the ifindex generator is left global.
      
      Fundametally ifindex numbers are per namespace, or else
      we will have corner case problems with migration when
      we get that far.
      
      At the same time there are assumptions in the network stack
      that the ifindex of a network device won't change.  Making
      the ifindex number global seems a good compromise until
      the network stack can cope with ifindex changes when
      you change namespaces, and the like.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      881d966b
    • Eric W. Biederman's avatar
      [NET]: Make device event notification network namespace safe · e9dc8653
      Eric W. Biederman authored
      
      
      Every user of the network device notifiers is either a protocol
      stack or a pseudo device.  If a protocol stack that does not have
      support for multiple network namespaces receives an event for a
      device that is not in the initial network namespace it quite possibly
      can get confused and do the wrong thing.
      
      To avoid problems until all of the protocol stacks are converted
      this patch modifies all netdev event handlers to ignore events on
      devices that are not in the initial network namespace.
      
      As the rest of the code is made network namespace aware these
      checks can be removed.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9dc8653
    • Eric W. Biederman's avatar
      [NET]: Make socket creation namespace safe. · 1b8d7ae4
      Eric W. Biederman authored
      
      
      This patch passes in the namespace a new socket should be created in
      and has the socket code do the appropriate reference counting.  By
      virtue of this all socket create methods are touched.  In addition
      the socket create methods are modified so that they will fail if
      you attempt to create a socket in a non-default network namespace.
      
      Failing if we attempt to create a socket outside of the default
      network namespace ensures that as we incrementally make the network stack
      network namespace aware we will not export functionality that someone
      has not audited and made certain is network namespace safe.
      Allowing us to partially enable network namespaces before all of the
      exotic protocols are supported.
      
      Any protocol layers I have missed will fail to compile because I now
      pass an extra parameter into the socket creation code.
      
      [ Integrated AF_IUCV build fixes from Andrew Morton... -DaveM ]
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1b8d7ae4
    • Eric W. Biederman's avatar
      [NET]: Make /proc/net per network namespace · 457c4cbc
      Eric W. Biederman authored
      
      
      This patch makes /proc/net per network namespace.  It modifies the global
      variables proc_net and proc_net_stat to be per network namespace.
      The proc_net file helpers are modified to take a network namespace argument,
      and all of their callers are fixed to pass &init_net for that argument.
      This ensures that all of the /proc/net files are only visible and
      usable in the initial network namespace until the code behind them
      has been updated to be handle multiple network namespaces.
      
      Making /proc/net per namespace is necessary as at least some files
      in /proc/net depend upon the set of network devices which is per
      network namespace, and even more files in /proc/net have contents
      that are relevant to a single network namespace.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      457c4cbc
  21. 19 Jul, 2007 1 commit
  22. 11 Jul, 2007 1 commit
  23. 08 May, 2007 1 commit
  24. 26 Apr, 2007 7 commits
  25. 12 Feb, 2007 1 commit
  26. 11 Feb, 2007 1 commit
  27. 18 Dec, 2006 1 commit