03 May, 2008

1 commit


21 Apr, 2008

1 commit

  • [ INFO: possible recursive locking detected ]
    2.6.25 #3
    ---------------------------------------------
    ax25ipd/3811 is trying to acquire lock:
    (rose_node_list_lock){-+..}, at: [] rose_get_neigh+0x1a/0xa0
    [rose]

    but task is already holding lock:
    (rose_node_list_lock){-+..}, at: []
    rose_route_frame+0x4d/0x620 [rose]

    other info that might help us debug this:
    6 locks held by ax25ipd/3811:
    #0: (&tty->atomic_write_lock){--..}, at: []
    tty_write_lock+0x1c/0x50
    #1: (rcu_read_lock){..--}, at: [] net_rx_action+0x96/0x230
    #2: (rcu_read_lock){..--}, at: [] netif_receive_skb+0x100/0x2f0
    #3: (rose_node_list_lock){-+..}, at: []
    rose_route_frame+0x4d/0x620 [rose]
    #4: (rose_neigh_list_lock){-+..}, at: []
    rose_route_frame+0x57/0x620 [rose]
    #5: (rose_route_list_lock){-+..}, at: []
    rose_route_frame+0x61/0x620 [rose]

    stack backtrace:
    Pid: 3811, comm: ax25ipd Not tainted 2.6.25 #3
    [] print_deadlock_bug+0xc7/0xd0
    [] check_deadlock+0x9a/0xb0
    [] validate_chain+0x1e2/0x310
    [] ? validate_chain+0xa5/0x310
    [] ? native_sched_clock+0x88/0xc0
    [] __lock_acquire+0x1a1/0x750
    [] lock_acquire+0x81/0xa0
    [] ? rose_get_neigh+0x1a/0xa0 [rose]
    [] _spin_lock_bh+0x33/0x60
    [] ? rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_route_frame+0x464/0x620 [rose]
    [] ? _read_unlock+0x1d/0x20
    [] ? rose_route_frame+0x0/0x620 [rose]
    [] ax25_rx_iframe+0x66/0x3b0 [ax25]
    [] ? ax25_start_t3timer+0x1f/0x40 [ax25]
    [] ax25_std_frame_in+0x7fb/0x890 [ax25]
    [] ? _spin_unlock_bh+0x25/0x30
    [] ax25_kiss_rcv+0x2c6/0x800 [ax25]
    [] ? sock_def_readable+0x59/0x80
    [] ? __lock_release+0x47/0x70
    [] ? sock_def_readable+0x59/0x80
    [] ? _read_unlock+0x1d/0x20
    [] ? sock_def_readable+0x59/0x80
    [] ? sock_queue_rcv_skb+0x13a/0x1d0
    [] ? sock_queue_rcv_skb+0x45/0x1d0
    [] ? ax25_kiss_rcv+0x0/0x800 [ax25]
    [] netif_receive_skb+0x255/0x2f0
    [] ? netif_receive_skb+0x100/0x2f0
    [] process_backlog+0x7c/0xf0
    [] net_rx_action+0x16c/0x230
    [] ? net_rx_action+0x96/0x230
    [] __do_softirq+0x93/0x120
    [] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] do_softirq+0x57/0x60
    [] local_bh_enable_ip+0xa5/0xe0
    [] _spin_unlock_bh+0x25/0x30
    [] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] pty_write+0x47/0x60
    [] write_chan+0x1b0/0x220
    [] ? tty_write_lock+0x1c/0x50
    [] ? default_wake_function+0x0/0x10
    [] tty_write+0x12a/0x1c0
    [] ? write_chan+0x0/0x220
    [] vfs_write+0x96/0x130
    [] ? tty_write+0x0/0x1c0
    [] sys_write+0x3d/0x70
    [] sysenter_past_esp+0x5f/0xa5
    =======================
    BUG: soft lockup - CPU#0 stuck for 61s! [ax25ipd:3811]

    Pid: 3811, comm: ax25ipd Not tainted (2.6.25 #3)
    EIP: 0060:[] EFLAGS: 00000246 CPU: 0
    EIP is at native_read_tsc+0xb/0x20
    EAX: b404aa2c EBX: b404a9c9 ECX: 017f1000 EDX: 0000076b
    ESI: 00000001 EDI: 00000000 EBP: ecc83afc ESP: ecc83afc
    DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    CR0: 8005003b CR2: b7f5f000 CR3: 2cd8e000 CR4: 000006f0
    DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    DR6: ffff0ff0 DR7: 00000400
    [] delay_tsc+0x17/0x30
    [] __delay+0x9/0x10
    [] __spin_lock_debug+0x76/0xf0
    [] ? spin_bug+0x18/0x100
    [] ? __lock_contended+0xa3/0x110
    [] _raw_spin_lock+0x68/0x90
    [] _spin_lock_bh+0x4f/0x60
    [] ? rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_get_neigh+0x1a/0xa0 [rose]
    [] rose_route_frame+0x464/0x620 [rose]
    [] ? _read_unlock+0x1d/0x20
    [] ? rose_route_frame+0x0/0x620 [rose]
    [] ax25_rx_iframe+0x66/0x3b0 [ax25]
    [] ? ax25_start_t3timer+0x1f/0x40 [ax25]
    [] ax25_std_frame_in+0x7fb/0x890 [ax25]
    [] ? _spin_unlock_bh+0x25/0x30
    [] ax25_kiss_rcv+0x2c6/0x800 [ax25]
    [] ? sock_def_readable+0x59/0x80
    [] ? __lock_release+0x47/0x70
    [] ? sock_def_readable+0x59/0x80
    [] ? _read_unlock+0x1d/0x20
    [] ? sock_def_readable+0x59/0x80
    [] ? sock_queue_rcv_skb+0x13a/0x1d0
    [] ? sock_queue_rcv_skb+0x45/0x1d0
    [] ? ax25_kiss_rcv+0x0/0x800 [ax25]
    [] netif_receive_skb+0x255/0x2f0
    [] ? netif_receive_skb+0x100/0x2f0
    [] process_backlog+0x7c/0xf0
    [] net_rx_action+0x16c/0x230
    [] ? net_rx_action+0x96/0x230
    [] __do_softirq+0x93/0x120
    [] ? mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] do_softirq+0x57/0x60
    [] local_bh_enable_ip+0xa5/0xe0
    [] _spin_unlock_bh+0x25/0x30
    [] mkiss_receive_buf+0x33a/0x3f0 [mkiss]
    [] pty_write+0x47/0x60
    [] write_chan+0x1b0/0x220
    [] ? tty_write_lock+0x1c/0x50
    [] ? default_wake_function+0x0/0x10
    [] tty_write+0x12a/0x1c0
    [] ? write_chan+0x0/0x220
    [] vfs_write+0x96/0x130
    [] ? tty_write+0x0/0x1c0
    [] sys_write+0x3d/0x70
    [] sysenter_past_esp+0x5f/0xa5
    =======================

    Since rose_route_frame() does not use rose_node_list we can safely
    remove rose_node_list_lock spin lock here and let it be free for
    rose_get_neigh().

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

20 Apr, 2008

1 commit

  • ================================================
    [ BUG: lock held when returning to user space! ]
    ------------------------------------------------
    xfbbd/3683 is leaving the kernel with locks still held!
    1 lock held by xfbbd/3683:
    #0: (sk_lock-AF_ROSE){--..}, at: [] rose_connect+0x73/0x420 [rose]

    INFO: task xfbbd:3683 blocked for more than 120 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    xfbbd D 00000246 0 3683 3669
    c6965ee0 00000092 c02c5c40 00000246 c0f6b5f0 c0f6b5c0 c0f6b5f0 c0f6b5c0
    c0f6b614 c6965f18 c024b74b ffffffff c06ba070 00000000 00000000 00000001
    c6ab07c0 c012d450 c0f6b634 c0f6b634 c7b5bf10 c0d6004c c7b5bf10 c6965f40
    Call Trace:
    [] lock_sock_nested+0x6b/0xd0
    [] ? autoremove_wake_function+0x0/0x40
    [] sock_fasync+0x41/0x150
    [] sock_close+0x19/0x40
    [] __fput+0xb4/0x170
    [] fput+0x18/0x20
    [] filp_close+0x3e/0x70
    [] sys_close+0x69/0xb0
    [] sysenter_past_esp+0x5f/0xa5
    =======================
    INFO: lockdep is turned off.

    Signed-off-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Bernard Pidoux
     

03 Apr, 2008

1 commit


02 Apr, 2008

1 commit

  • rose_release() doesn't release sockets properly, e.g. it skips
    sock_orphan(), so OOPSes are triggered in sock_def_write_space(),
    which was observed especially while ROSE skbs were kfreed from
    ax25_frames_acked(). There is also sock_hold() and lock_sock() added -
    similarly to ax25_release(). Thanks to Bernard Pidoux for substantial
    help in debugging this problem.

    Signed-off-by: Jarek Poplawski
    Reported-and-tested-by: Bernard Pidoux
    Signed-off-by: David S. Miller

    Jarek Poplawski
     

26 Mar, 2008

2 commits


29 Jan, 2008

3 commits

  • CHECK net/rose/af_rose.c
    net/rose/af_rose.c:125:11: warning: expensive signed divide
    net/rose/af_rose.c:976:46: warning: expensive signed divide
    net/rose/af_rose.c:1379:13: warning: context imbalance in 'rose_info_start' - wrong count at exit
    net/rose/af_rose.c:1406:13: warning: context imbalance in 'rose_info_stop' - unexpected unlock
    CHECK net/rose/rose_in.c
    net/rose/rose_in.c:185:25: warning: expensive signed divide
    CHECK net/rose/rose_route.c
    net/rose/rose_route.c:997:46: warning: expensive signed divide
    net/rose/rose_route.c:1070:13: warning: context imbalance in 'rose_node_start' - wrong count at exit
    net/rose/rose_route.c:1093:13: warning: context imbalance in 'rose_node_stop' - unexpected unlock
    net/rose/rose_route.c:1146:13: warning: context imbalance in 'rose_neigh_start' - wrong count at exit
    net/rose/rose_route.c:1169:13: warning: context imbalance in 'rose_neigh_stop' - unexpected unlock
    net/rose/rose_route.c:1229:13: warning: context imbalance in 'rose_route_start' - wrong count at exit
    net/rose/rose_route.c:1252:13: warning: context imbalance in 'rose_route_stop' - unexpected unlock

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This patch includes many places, that only required
    replacing the ctl_table-s with appropriate ctl_paths
    and call register_sysctl_paths().

    Nothing special was done with them.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     
  • 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: Pavel Emelyanov
    Acked-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

05 Dec, 2007

1 commit


01 Nov, 2007

1 commit

  • Finally, the zero_it argument can be completely removed from
    the callers and from the function prototype.

    Besides, fix the checkpatch.pl warnings about using the
    assignments inside if-s.

    This patch is rather big, and it is a part of the previous one.
    I splitted it wishing to make the patches more readable. Hope
    this particular split helped.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     

11 Oct, 2007

5 commits

  • Since hardware header operations are part of the protocol class
    not the device instance, make them into a separate object and
    save memory.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • 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: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • 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: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • 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: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • 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: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

08 Oct, 2007

1 commit

  • Commit a3d384029aa304f8f3f5355d35f0ae274454f7cd aka
    "[AX.25]: Fix unchecked rose_add_loopback_neigh uses"
    transformed rose_loopback_neigh var into statically allocated one.
    However, on unload it will be kfree's which can't work.

    Steps to reproduce:

    modprobe rose
    rmmod rose

    BUG: unable to handle kernel NULL pointer dereference at virtual address 00000008
    printing eip:
    c014c664
    *pde = 00000000
    Oops: 0000 [#1]
    PREEMPT DEBUG_PAGEALLOC
    Modules linked in: rose ax25 fan ufs loop usbhid rtc snd_intel8x0 snd_ac97_codec ehci_hcd ac97_bus uhci_hcd thermal usbcore button processor evdev sr_mod cdrom
    CPU: 0
    EIP: 0060:[] Not tainted VLI
    EFLAGS: 00210086 (2.6.23-rc9 #3)
    EIP is at kfree+0x48/0xa1
    eax: 00000556 ebx: c1734aa0 ecx: f6a5e000 edx: f7082000
    esi: 00000000 edi: f9a55d20 ebp: 00200287 esp: f6a5ef28
    ds: 007b es: 007b fs: 0000 gs: 0033 ss: 0068
    Process rmmod (pid: 1823, ti=f6a5e000 task=f7082000 task.ti=f6a5e000)
    Stack: f9a55d20 f9a5200c 00000000 00000000 00000000 f6a5e000 f9a5200c f9a55a00
    00000000 bf818cf0 f9a51f3f f9a55a00 00000000 c0132c60 65736f72 00000000
    f69f9630 f69f9528 c014244a f6a4e900 00200246 f7082000 c01025e6 00000000
    Call Trace:
    [] rose_rt_free+0x1d/0x49 [rose]
    [] rose_rt_free+0x1d/0x49 [rose]
    [] rose_exit+0x4c/0xd5 [rose]
    [] sys_delete_module+0x15e/0x186
    [] remove_vma+0x40/0x45
    [] sysenter_past_esp+0x8f/0x99
    [] trace_hardirqs_on+0x118/0x13b
    [] sysenter_past_esp+0x5f/0x99
    =======================
    Code: 05 03 1d 80 db 5b c0 8b 03 25 00 40 02 00 3d 00 40 02 00 75 03 8b 5b 0c 8b 73 10 8b 44 24 18 89 44 24 04 9c 5d fa e8 77 df fd ff 56 08 89 f8 e8 84 f4 fd ff e8 bd 32 06 00 3b 5c 86 60 75 0f
    EIP: [] kfree+0x48/0xa1 SS:ESP 0068:f6a5ef28

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

19 Jul, 2007

1 commit


11 Jul, 2007

1 commit


04 May, 2007

1 commit

  • Cleanup of dev_base list use, with the aim to simplify making device
    list per-namespace. In almost every occasion, use of dev_base variable
    and dev->next pointer could be easily replaced by for_each_netdev
    loop. A few most complicated places were converted to using
    first_netdev()/next_netdev().

    Signed-off-by: Pavel Emelianov
    Acked-by: Kirill Korotaev
    Signed-off-by: David S. Miller

    Pavel Emelianov
     

26 Apr, 2007

6 commits


13 Mar, 2007

2 commits


15 Feb, 2007

3 commits

  • The semantic effect of insert_at_head is that it would allow new registered
    sysctl entries to override existing sysctl entries of the same name. Which is
    pain for caching and the proc interface never implemented.

    I have done an audit and discovered that none of the current users of
    register_sysctl care as (excpet for directories) they do not register
    duplicate sysctl entries.

    So this patch simply removes the support for overriding existing entries in
    the sys_sysctl interface since no one uses it or cares and it makes future
    enhancments harder.

    Signed-off-by: Eric W. Biederman
    Acked-by: Ralf Baechle
    Acked-by: Martin Schwidefsky
    Cc: Russell King
    Cc: David Howells
    Cc: "Luck, Tony"
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Andi Kleen
    Cc: Jens Axboe
    Cc: Corey Minyard
    Cc: Neil Brown
    Cc: "John W. Linville"
    Cc: James Bottomley
    Cc: Jan Kara
    Cc: Trond Myklebust
    Cc: Mark Fasheh
    Cc: David Chinner
    Cc: "David S. Miller"
    Cc: Patrick McHardy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • The sysctl numbers used are unique so setting the insert_at_head flag serves
    no semantic purpose.

    Signed-off-by: Eric W. Biederman
    Acked-by: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

11 Feb, 2007

1 commit


18 Dec, 2006

6 commits