11 Feb, 2010

2 commits



09 Feb, 2010

2 commits

  • As noticed by Jon Masters , the conntrack hash
    size is global and not per namespace, but modifiable at runtime through
    /sys/module/nf_conntrack/hashsize. Changing the hash size will only
    resize the hash in the current namespace however, so other namespaces
    will use an invalid hash size. This can cause crashes when enlarging
    the hashsize, or false negative lookups when shrinking it.

    Move the hash size into the per-namespace data and only use the global
    hash size to initialize the per-namespace value when instanciating a
    new namespace. Additionally restrict hash resizing to init_net for
    now as other namespaces are not handled currently.

    Cc: stable@kernel.org
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • nf_conntrack_cachep is currently shared by all netns instances, but
    because of SLAB_DESTROY_BY_RCU special semantics, this is wrong.

    If we use a shared slab cache, one object can instantly flight between
    one hash table (netns ONE) to another one (netns TWO), and concurrent
    reader (doing a lookup in netns ONE, 'finding' an object of netns TWO)
    can be fooled without notice, because no RCU grace period has to be
    observed between object freeing and its reuse.

    We dont have this problem with UDP/TCP slab caches because TCP/UDP
    hashtables are global to the machine (and each object has a pointer to
    its netns).

    If we use per netns conntrack hash tables, we also *must* use per netns
    conntrack slab caches, to guarantee an object can not escape from one
    namespace to another one.

    Signed-off-by: Eric Dumazet
    [Patrick: added unique slab name allocation]
    Cc: stable@kernel.org
    Signed-off-by: Patrick McHardy

    Eric Dumazet
     

05 Feb, 2010

4 commits

  • This patch adds GSO/checksum offload to af_packet sockets using
    virtio_net_hdr. Based on Rusty's patch to add this support to tun.
    It allows GSO/checksum offload to be enabled when using raw socket
    backend with virtio_net.
    Adds PACKET_VNET_HDR socket option to prepend virtio_net_hdr in the
    receive path and process/skip virtio_net_hdr in the send path. This
    option is only allowed with SOCK_RAW sockets attached to ethernet
    type devices.

    v2 updates
    ----------
    Michael's Comments
    - Perform length check in packet_snd() when GSO is off even when
    vnet_hdr is present.
    - Check for SKB_GSO_FCOE type and return -EINVAL
    - don't allow tx/rx ring when vnet_hdr is enabled.
    Herbert's Comments
    - Removed ethernet specific code.
    - protocol value is assumed to be passed in by the caller.

    Signed-off-by: Sridhar Samudrala
    Signed-off-by: David S. Miller

    Sridhar Samudrala
     
  • Many drivers do this in them manually. Now they can use this function.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • This patch introduces the similar helpers as those already done for uc list.
    However multicast lists are no list_head lists but "mademanually". The three
    macros added by this patch will make the transition of mc_list to list_head
    smooth in two steps:

    1) convert all drivers to use these macros (with the original iterator of type
    "struct dev_mc_list")
    2) once all drivers are converted, convert list type and iterators to "struct
    netdev_hw_addr" in one patch.

    >From now on, drivers can (and should) use "netdev_for_each_mc_addr" to iterate
    over the addresses with iterator of type "struct netdev_hw_addr". Also macros
    "netdev_mc_count" and "netdev_mc_empty" to read list's length. This is the state
    which should be reached in all drivers.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • David S. Miller
     

04 Feb, 2010

5 commits

  • Ifdef out
    struct proto_ops::compat_ioctl
    struct proto_ops::compat_setsockopt
    struct proto_ops::compat_getsockopt
    to make structures smaller on COMPAT=n kernels.

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

    Alexey Dobriyan
     
  • In order to use macvlan with qemu and other tools that require
    a tap file descriptor, the macvtap driver adds a small backend
    with a character device with the same interface as the tun
    driver, with a minimum set of features.

    Macvtap interfaces are created in the same way as macvlan
    interfaces using ip link, but the netif is just used as a
    handle for configuration and accounting, while the data
    goes through the chardev. Each macvtap interface has its
    own character device, simplifying permission management
    significantly over the generic tun/tap driver.

    Cc: Patrick McHardy
    Cc: Stephen Hemminger
    Cc: David S. Miller"
    Cc: "Michael S. Tsirkin"
    Cc: Herbert Xu
    Cc: Or Gerlitz
    Cc: netdev@vger.kernel.org
    Cc: bridge@lists.linux-foundation.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • This makes it possible to hook into the macvlan driver
    from another kernel module. In particular, the goal is
    to extend it with the macvtap backend that provides
    a tun/tap compatible interface directly on the macvlan
    device.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • In the vlan and macvlan drivers, the start_xmit function forwards
    data to the dev_queue_xmit function for another device, which may
    potentially belong to a different namespace.

    To make sure that classification stays within a single namespace,
    this resets the potentially critical fields.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     
  • David S. Miller
     

03 Feb, 2010

2 commits

  • On Tue, Feb 02, 2010 at 02:57:14PM -0800, Greg KH (gregkh@suse.de) wrote:
    > > There are at least two ways to fix it: using a big cannon and a small
    > > one. The former way is to disable notification registration, since it is
    > > not used by anyone at all. Second way is to check whether calling
    > > process is root and its destination group is -1 (kind of priveledged
    > > one) before command is dispatched to workqueue.
    >
    > Well if no one is using it, removing it makes the most sense, right?
    >
    > No objection from me, care to make up a patch either way for this?

    Getting it is not used, let's drop support for notifications about
    (un)registered events from connector.
    Another option was to check credentials on receiving, but we can always
    restore it without bugs if needed, but genetlink has a wider code base
    and none complained, that userspace can not get notification when some
    other clients were (un)registered.

    Kudos for Sebastian Krahmer , who found a bug in the
    code.

    Signed-off-by: Evgeniy Polyakov
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Evgeniy Polyakov
     
  • There's currently no way for a virtio driver to ask for unused
    buffers, so it has to keep a list itself to reclaim them at shutdown.
    This is redundant, since virtio_ring stores that information. So
    add a new hook to do this.

    Signed-off-by: Shirley Ma
    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Shirley Ma
     

02 Feb, 2010

3 commits

  • Almost all igmp functions accessing inet->mc_list are protected by
    rtnl_lock(), but there is one exception which is ip_mc_sf_allow(),
    so there is a chance of either ip_mc_drop_socket or ip_mc_leave_group
    remove an entry while ip_mc_sf_allow is running causing a crash.

    Signed-off-by: Flavio Leitner
    Signed-off-by: David S. Miller

    Flavio Leitner
     
  • When an injected frame gets buffered for a powersave STA or filtered
    and retransmitted, mac80211 attempts to parse the radiotap header
    again, which doesn't work because it's gone at that point.
    This patch adds a new flag for checking the availability of a radiotap
    header, so that it only attempts to parse it once, reusing the tx info
    on the next call to ieee80211_tx().
    This fixes severe issues with rekeying in AP mode.

    Signed-off-by: Felix Fietkau
    Cc: stable@kernel.org
    Signed-off-by: John W. Linville

    Felix Fietkau
     
  • This adds a new regulatory hint to be used when we know all
    devices have been disconnected and idle. This can happen
    when we suspend, for instance. When we disconnect we can
    no longer assume the same regulatory rules learned from
    a country IE or beacon hints are applicable so restore
    regulatory settings to an initial state.

    Since driver hints are cached on the wiphy that called
    the hint, those hints are not reproduced onto cfg80211
    as the wiphy will respect its own wiphy->regd regardless.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

29 Jan, 2010

1 commit

  • This adds an additional queuing strategy, called pfifo_head_drop,
    to remove the oldest skb in the case of an overflow within the queue -
    the head element - instead of the last skb (tail). To remove the oldest
    skb in congested situations is useful for sensor network environments
    where newer packets reflect the superior information.

    Reviewed-by: Florian Westphal
    Acked-by: Patrick McHardy
    Signed-off-by: Hagen Paul Pfeifer
    Signed-off-by: David S. Miller

    Hagen Paul Pfeifer
     

28 Jan, 2010

2 commits


27 Jan, 2010

2 commits

  • Because DTIM information is required for powersave
    but is only conveyed in beacons, wait for a beacon
    before enabling powersave, and change the way the
    information is conveyed to the driver accordingly.

    mwl8k doesn't currently seem to implement PS but
    requires the DTIM period in a different way; after
    talking to Lennert we agreed to just have mwl8k do
    the parsing itself in the finalize_join work.

    Signed-off-by: Johannes Berg
    Acked-by: Lennert Buytenhek
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • This new function (previously a static function
    called just "find_ie" can be used to find a
    specific IE in a buffer of IEs.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

26 Jan, 2010

2 commits


25 Jan, 2010

1 commit

  • GC is non-existent in netns, so after you hit GC threshold, no new
    dst entries will be created until someone triggers cleanup in init_net.

    Make xfrm4_dst_ops and xfrm6_dst_ops per-netns.
    This is not done in a generic way, because it woule waste
    (AF_MAX - 2) * sizeof(struct dst_ops) bytes per-netns.

    Reorder GC threshold initialization so it'd be done before registering
    XFRM policies.

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

    Alexey Dobriyan
     

24 Jan, 2010

1 commit


23 Jan, 2010

8 commits


22 Jan, 2010

2 commits


21 Jan, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
    USB: isp1362: fix build failure on ARM systems via irq_flags cleanup
    USB: isp1362: better 64bit printf warning fixes
    USB: fix usbstorage for 2770:915d delivers no FAT
    USB: Fix level of isp1760 Reloading ptd error message
    USB: FHCI: avoid NULL pointer dereference
    USB: Fix duplicate sysfs problem after device reset.
    USB: add speed values for USB 3.0 and wireless controllers
    USB: add missing delay during remote wakeup
    USB: EHCI & UHCI: fix race between root-hub suspend and port resume
    USB: EHCI: fix handling of unusual interrupt intervals
    USB: Don't use GFP_KERNEL while we cannot reset a storage device
    USB: fix bitmask merge error
    usb: serial: fix memory leak in generic driver
    USB: serial: fix USB serial fix kfifo_len locking

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
    fs/bio.c: fix shadows sparse warning
    drbd: The kernel code is now equivalent to out of tree release 8.3.7
    drbd: Allow online resizing of DRBD devices while peer not reachable (needs to be explicitly forced)
    drbd: Don't go into StandAlone mode when authentification failes because of network error
    drivers/block/drbd/drbd_receiver.c: correct NULL test
    cfq-iosched: Respect ioprio_class when preempting
    genhd: overlapping variable definition
    block: removed unused as_io_context
    DM: Fix device mapper topology stacking
    block: bdev_stack_limits wrapper
    block: Fix discard alignment calculation and printing
    block: Correct handling of bottom device misaligment
    drbd: check on CONFIG_LBDAF, not LBD
    drivers/block/drbd: Correct NULL test
    drbd: Silenced an assert that could triggered after changing write ordering method
    drbd: Kconfig fix
    drbd: Fix for a race between IO and a detach operation [Bugz 262]
    drbd: Use drbd_crypto_is_hash() instead of an open coded check

    Linus Torvalds