11 Oct, 2007

6 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 modifies every packet receive function
    registered with dev_add_pack() to drop packets if they
    are not from the initial network namespace.

    This should ensure that the various network stacks do
    not receive packets in a anything but the initial network
    namespace until the code has been converted and is ready
    for them.

    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
     

15 Aug, 2007

1 commit

  • commit 8d5cf596d10d740b69b5f4bbdb54b85abf75810d started to add statically
    allocated ax25_protocol's to list. However kfree() was still in place waiting
    for unsuspecting ones on module removal.

    Steps to reproduce:

    modprobe netrom
    rmmod netrom

    P.S.: code would benefit greatly from list_add/list_del usage

    kernel BUG at mm/slab.c:592!
    invalid opcode: 0000 [1] PREEMPT SMP
    CPU 0
    Modules linked in: netrom ax25 af_packet usbcore rtc_cmos rtc_core rtc_lib
    Pid: 4477, comm: rmmod Not tainted 2.6.23-rc3-bloat #2
    RIP: 0010:[] [] kfree+0x1c6/0x260
    RSP: 0000:ffff810079a05e48 EFLAGS: 00010046
    RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff81000000c000
    RDX: ffff81007e552458 RSI: 0000000000000000 RDI: 000000000000805d
    RBP: ffff810079a05e88 R08: 0000000000000001 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8805d080
    R13: ffffffff8805d080 R14: 0000000000000000 R15: 0000000000000282
    FS: 00002b73fc98aae0(0000) GS:ffffffff805dc000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 000000000053f3b8 CR3: 0000000079ff2000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process rmmod (pid: 4477, threadinfo ffff810079a04000, task ffff8100775aa480)
    Stack: ffff810079a05e68 0000000000000246 ffffffff8804eca0 0000000000000000
    ffffffff8805d080 00000000000000cf 0000000000000000 0000000000000880
    ffff810079a05eb8 ffffffff8803ec90 ffff810079a05eb8 0000000000000000
    Call Trace:
    [] :ax25:ax25_protocol_release+0xa0/0xb0
    [] :netrom:nr_exit+0x6b/0xf0
    [] sys_delete_module+0x170/0x1f0
    [] trace_hardirqs_on+0xd5/0x170
    [] trace_hardirqs_on_thunk+0x35/0x37
    [] system_call+0x7e/0x83

    Code: 0f 0b eb fe 66 66 90 66 66 90 48 8b 52 10 48 8b 02 25 00 40
    RIP [] kfree+0x1c6/0x260
    RSP
    Kernel panic - not syncing: Fatal exception

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

    Alexey Dobriyan
     

19 Jul, 2007

1 commit


11 Jul, 2007

1 commit


10 May, 2007

1 commit


09 May, 2007

1 commit


26 Apr, 2007

13 commits


26 Mar, 2007

1 commit

  • o The AX.25 Howto is unmaintained since several years. I've replaced it
    with a wiki at http://www.linux-ax25.org which provides more uptodate
    information.
    o Change default for AX25_DAMA_SLAVE to Y. AX25_DAMA_SLAVE only compiles
    in support for DAMA but doesn't activate it. I hope this gets Linux
    distributions to ship their AX.25 kernels with AX25_DAMA_SLAVE enabled.
    The price for this would be very small.
    o Delete historic changelog from comments, that's what SCM systems are
    meant to do.
    o ---help--- in Kconfig looks so yellingly eye insulting. Use just help.
    o Rewrite the commented out piece of old Linux 2.4 configuration language
    to Kconfig for consistency.
    o Fixup dependencies.

    Signed-off-by: Ralf Baechle
    Signed-off-by: David S. Miller

    Ralf Baechle
     

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
     
  • 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

4 commits


12 Dec, 2006

1 commit


09 Dec, 2006

2 commits


03 Dec, 2006

1 commit

  • Code diff stats:

    [acme@newtoy net-2.6.20]$ codiff /tmp/ax25.ko.before /tmp/ax25.ko.after
    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ax25/ax25_out.c:
    ax25_send_frame | -8
    1 function changed, 8 bytes removed

    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ax25/ax25_route.c:
    ax25_rt_autobind | -15
    1 function changed, 15 bytes removed

    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ax25/af_ax25.c:
    ax25_make_new | -33
    1 function changed, 33 bytes removed

    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ax25/sysctl_net_ax25.c:
    ax25_register_sysctl | -21
    1 function changed, 21 bytes removed

    /tmp/ax25.ko.after:
    4 functions changed, 77 bytes removed
    [acme@newtoy net-2.6.20]$

    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

22 Jul, 2006

1 commit


13 Jul, 2006

1 commit