26 May, 2010

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (63 commits)
    drivers/net/usb/asix.c: Fix pointer cast.
    be2net: Bug fix to avoid disabling bottom half during firmware upgrade.
    proc_dointvec: write a single value
    hso: add support for new products
    Phonet: fix potential use-after-free in pep_sock_close()
    ath9k: remove VEOL support for ad-hoc
    ath9k: change beacon allocation to prefer the first beacon slot
    sock.h: fix kernel-doc warning
    cls_cgroup: Fix build error when built-in
    macvlan: do proper cleanup in macvlan_common_newlink() V2
    be2net: Bug fix in init code in probe
    net/dccp: expansion of error code size
    ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
    wireless: fix sta_info.h kernel-doc warnings
    wireless: fix mac80211.h kernel-doc warnings
    iwlwifi: testing the wrong variable in iwl_add_bssid_station()
    ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs()
    ath9k_htc: dereferencing before check in hif_usb_tx_cb()
    rt2x00: Fix rt2800usb TX descriptor writing.
    rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions.
    ...

    Linus Torvalds
     
  • sk_common_release() might destroy our last reference to the socket.
    So an extra temporary reference is needed during cleanup.

    Signed-off-by: Rémi Denis-Courmont
    Signed-off-by: David S. Miller

    Rémi Denis-Courmont
     
  • David S. Miller
     

25 May, 2010

5 commits


24 May, 2010

16 commits

  • * 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
    uml: Pushdown the bkl from harddog_kern ioctl
    sunrpc: Pushdown the bkl from sunrpc cache ioctl
    sunrpc: Pushdown the bkl from ioctl
    autofs4: Pushdown the bkl from ioctl
    uml: Convert to unlocked_ioctls to remove implicit BKL
    ncpfs: BKL ioctl pushdown
    coda: Clean-up whitespace problems in pioctl.c
    coda: BKL ioctl pushdown
    drivers: Push down BKL into various drivers
    isdn: Push down BKL into ioctl functions
    scsi: Push down BKL into ioctl functions
    dvb: Push down BKL into ioctl functions
    smbfs: Push down BKL into ioctl function
    coda/psdev: Remove BKL from ioctl function
    um/mmapper: Remove BKL usage
    sn_hwperf: Kill BKL usage
    hfsplus: Push down BKL into ioctl function

    Linus Torvalds
     
  • This reverts commit 03ceedea972a82d343fa5c2528b3952fa9e615d5, since it
    breaks resume from suspend-to-ram on Rafael's Acer Ferrari One.
    NetworkManager thinks everything is ok, but it can't connect to the AP
    to get an IP address after the resume.

    In fact, it even breaks resume for non-ath9k chipsets: reverting it also
    fixes Rafael's Toshiba Protege R500 with the iwlagn driver. As Johannes
    says:

    "Indeed, this patch needs to be reverted. That mac80211 change is wrong
    and completely unnecessary."

    Reported-and-requested-by: Rafael J. Wysocki
    Acked-by: Johannes Berg
    Cc: Daniel Yingqiang Ma
    Cc: John W. Linville
    Cc: David Miller
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
    9p: Optimize TCREATE by eliminating a redundant fid clone.
    9p: cleanup: remove unneeded assignment
    9p: Add mksock support
    fs/9p: Make sure we properly instantiate dentry.
    9p: add 9P2000.L rename operation
    9p: add 9P2000.L statfs operation
    9p: VFS switches for 9p2000.L: VFS switches
    9p: VFS switches for 9p2000.L: protocol and client changes

    Linus Torvalds
     
  • This patch makes tun update its socket classid every time we
    inject a packet into the network stack. This is so that any
    updates made by the admin to the process writing packets to
    tun is effected.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Up until now cls_cgroup has relied on fetching the classid out of
    the current executing thread. This runs into trouble when a packet
    processing is delayed in which case it may execute out of another
    thread's context.

    Furthermore, even when a packet is not delayed we may fail to
    classify it if soft IRQs have been disabled, because this scenario
    is indistinguishable from one where a packet unrelated to the
    current thread is processed by a real soft IRQ.

    In fact, the current semantics is inherently broken, as a single
    skb may be constructed out of the writes of two different tasks.
    A different manifestation of this problem is when the TCP stack
    transmits in response of an incoming ACK. This is currently
    unclassified.

    As we already have a concept of packet ownership for accounting
    purposes in the skb->sk pointer, this is a natural place to store
    the classid in a persistent manner.

    This patch adds the cls_cgroup classid in struct sock, filling up
    an existing hole on 64-bit :)

    The value is set at socket creation time. So all sockets created
    via socket(2) automatically gains the ID of the thread creating it.
    Whenever another process touches the socket by either reading or
    writing to it, we will change the socket classid to that of the
    process if it has a valid (non-zero) classid.

    For sockets created on inbound connections through accept(2), we
    inherit the classid of the original listening socket through
    sk_clone, possibly preceding the actual accept(2) call.

    In order to minimise risks, I have not made this the authoritative
    classid. For now it is only used as a backup when we execute
    with soft IRQs disabled. Once we're completely happy with its
    semantics we can use it as the sole classid.

    Footnote: I have rearranged the error path on cls_group module
    creation. If we didn't do this, then there is a window where
    someone could create a tc rule using cls_group before the cgroup
    subsystem has been registered.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Fixed handling when skb don't fit in user buffer,
    instead of returning -EMSGSIZE, the buffer is truncated (just
    as unix seqpakcet does).

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • Splint found missing spin_unlock.
    Corrected this an some other trivial split warnings.

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • Discovered bug when testing async connect.
    While connecting poll should not return POLLHUP,
    but POLLOUT when connected.
    Also fixed the sysfs flow-control-counters.

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • Discovered bugs when injecting slab allocation failures.
    Add checks on all memory allocation.

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • Discovered bug when running high number of parallel connect requests.
    Replace buggy home brewed list with linux/list.h.

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • Discovered bug when testing on 64bit architecture.
    Fixed by using long to store result from wait_event_interruptible_timeout.

    Signed-off-by: Sjur Braendeland
    Signed-off-by: David S. Miller

    Sjur Braendeland
     
  • the commit:

    commit d90310243fd750240755e217c5faa13e24f41536
    Author: Octavian Purdila
    Date: Wed Nov 18 02:36:59 2009 +0000

    net: device name allocation cleanups

    introduced a bug when there is a hash collision making impossible
    to rename a device with eth%d. This bug is very hard to reproduce
    and appears rarely.

    The problem is coming from we don't pass a temporary buffer to
    __dev_alloc_name but 'dev->name' which is modified by the function.

    A detailed explanation is here:

    http://marc.info/?l=linux-netdev&m=127417784011987&w=2

    Changelog:
    V2 : replaced strings comparison by pointers comparison

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Octavian Purdila
    Signed-off-by: David S. Miller

    Daniel Lezcano
     
  • Commit c02db8c6290bb992442fec1407643c94cc414375:

    Author: Chris Wright
    Date: Sun May 16 01:05:45 2010 -0700
    Subject: rtnetlink: make SR-IOV VF interface symmetric

    adds broken error handling to do_setlink() in net/core/rtnetlink.c. The
    problem is the following chunk of code:

    if (tb[IFLA_VFINFO_LIST]) {
    struct nlattr *attr;
    int rem;
    nla_for_each_nested(attr, tb[IFLA_VFINFO_LIST], rem) {
    if (nla_type(attr) != IFLA_VF_INFO)
    ----> goto errout;
    err = do_setvfinfo(dev, attr);
    if (err < 0)
    goto errout;
    modified = 1;
    }
    }

    which can get to errout without setting err, resulting in the following error:

    net/core/rtnetlink.c: In function 'do_setlink':
    net/core/rtnetlink.c:904: warning: 'err' may be used uninitialized in this function

    Change the code to return -EINVAL in this case. Note that this might not be
    the appropriate error though.

    Signed-off-by: David Howells
    cc: Chris Wright
    cc: David S. Miller
    Acked-by: Chris Wright
    Signed-off-by: David S. Miller

    David Howells
     
  • There is already a submenu entry that is always displayed, so there is
    no need to also show a dedicated CAIF comment.

    Drop dead commented code while we're here, and change the submenu text
    to better match the style everyone else is using.

    Signed-off-by: Mike Frysinger
    Signed-off-by: David S. Miller

    Mike Frysinger
     
  • Ben Pfaff reported a kernel oops and provided a test program to
    reproduce it.

    https://kerneltrap.org/mailarchive/linux-netdev/2010/5/21/6277805

    tc_fill_qdisc() should not be called for builtin qdisc, or it
    dereference a NULL pointer to get device ifindex.

    Fix is to always use tc_qdisc_dump_ignore() before calling
    tc_fill_qdisc().

    Reported-by: Ben Pfaff
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Check for NULL pointer after kzalloc

    Signed-off-by: Denis Kirjanov
    Signed-off-by: David S. Miller

    Denis Kirjanov
     

22 May, 2010

16 commits

  • Pushdown the bkl to cache_ioctl_pipefs.

    Signed-off-by: Frederic Weisbecker
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Nfs
    Cc: Thomas Gleixner
    Cc: John Kacur
    Cc: Arnd Bergmann

    Frederic Weisbecker
     
  • Pushdown the bkl to rpc_pipe_ioctl.

    Signed-off-by: Frederic Weisbecker
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: Nfs
    Cc: Thomas Gleixner
    Cc: John Kacur
    Cc: Arnd Bergmann

    Frederic Weisbecker
     
  • * 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (27 commits)
    drivers/char: Eliminate use after free
    virtio: console: Accept console size along with resize control message
    virtio: console: Store each console's size in the console structure
    virtio: console: Resize console port 0 on config intr only if multiport is off
    virtio: console: Add support for nonblocking write()s
    virtio: console: Rename wait_is_over() to will_read_block()
    virtio: console: Don't always create a port 0 if using multiport
    virtio: console: Use a control message to add ports
    virtio: console: Move code around for future patches
    virtio: console: Remove config work handler
    virtio: console: Don't call hvc_remove() on unplugging console ports
    virtio: console: Return -EPIPE to hvc_console if we lost the connection
    virtio: console: Let host know of port or device add failures
    virtio: console: Add a __send_control_msg() that can send messages without a valid port
    virtio: Revert "virtio: disable multiport console support."
    virtio: add_buf_gfp
    trans_virtio: use virtqueue_xxx wrappers
    virtio-rng: use virtqueue_xxx wrappers
    virtio_ring: remove a level of indirection
    virtio_net: use virtqueue_xxx wrappers
    ...

    Fix up conflicts in drivers/net/virtio_net.c due to new virtqueue_xxx
    wrappers changes conflicting with some other cleanups.

    Linus Torvalds
     
  • I made a V2 of this patch on top of my patches for VFS switches.
    All the changes were due to change in some offsets.

    rename - change name of file or directory

    size[4] Trename tag[2] fid[4] newdirfid[4] name[s]
    size[4] Rrename tag[2]

    The rename message is used to change the name of a file, possibly moving it
    to a new directory. The 9P wstat message can only rename a file within the
    same directory.

    Signed-off-by: Jim Garlick
    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • I made a V2 of this patch on top of my patches for VFS switches. The
    change was adding v9fs_statfs pointer to v9fs_super_ops_dotl
    instead of v9fs_super_ops.

    statfs - get file system statistics

    size[4] Tstatfs tag[2] fid[4]
    size[4] Rstatfs tag[2] type[4] bsize[4] blocks[8] bfree[8] bavail[8]
    files[8] ffree[8] fsid[8] namelen[4]

    The statfs message is used to request file system information returned
    by the statfs(2) system call, which is used by df(1) to report file
    system and disk space usage.

    Signed-off-by: Jim Garlick
    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • Prepare p9pdu_read/write functions to handle multiple protocols.

    Signed-off-by: Sripathi Kodi
    Signed-off-by: Eric Van Hensbergen

    Sripathi Kodi
     
  • Conflicts:
    fs/ext3/fsync.c

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • This patch adds F_GETPIPE_SZ and F_SETPIPE_SZ fcntl() actions for
    growing and shrinking the size of a pipe and adjusts pipe.c and splice.c
    (and relay and network splice) usage to work with these larger (or smaller)
    pipes.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Specifying a valid channel type will get
    goto out rather than continuing, due to
    missing braces. This affects both remain
    on channel and action frame TX commands.

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

    Johannes Berg
     
  • Since wdev can be NULL, check it before dereferencing it

    Signed-off-by: Felix Fietkau
    Signed-off-by: John W. Linville

    Felix Fietkau
     
  • signal_type is enum cfg80211_signal_type.

    This fixes the gcc warning:

    scan.c: In function `cfg80211_inform_bss':
    scan.c:518:6: warning: comparison between `enum cfg80211_signal_type' and `enum nl80211_bss'
    scan.c: In function `cfg80211_inform_bss_frame':
    scan.c:574:6: warning: comparison between `enum cfg80211_signal_type' and `enum nl80211_bss'

    Signed-off-by: Sujith
    Signed-off-by: John W. Linville

    Sujith
     
  • This reverts commit aaf8cdc34ddba08122f02217d9d684e2f9f5d575.

    Drivers like the ipw2100 call device_create_group when they
    are initialized and device_remove_group when they are shutdown.
    Moving them between namespaces deletes their sysfs groups early.

    In particular the following call chain results.
    netdev_unregister_kobject -> device_del -> kobject_del -> sysfs_remove_dir
    With sysfs_remove_dir recursively deleting all of it's subdirectories,
    and nothing adding them back.

    Ouch!

    Therefore we need to call something that ultimate calls sysfs_mv_dir
    as that sysfs function can move sysfs directories between namespaces
    without deleting their subdirectories or their contents. Allowing
    us to avoid placing extra boiler plate into every driver that does
    something interesting with sysfs.

    Currently the function that provides that capability is device_rename.
    That is the code works without nasty side effects as originally written.

    So remove the misguided fix for moving devices between namespaces. The
    bug in the kobject layer that inspired it has now been recognized and
    fixed.

    Signed-off-by: Eric W. Biederman
    Acked-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • When netlink sockets are used to convey data that is in a namespace
    we need a way to select a subset of the listening sockets to deliver
    the packet to. For the network namespace we have been doing this
    by only transmitting packets in the correct network namespace.

    For data belonging to other namespaces netlink_bradcast_filtered
    provides a mechanism that allows us to examine the destination
    socket and to decide if we should transmit the specified packet
    to it.

    Signed-off-by: Eric W. Biederman
    Acked-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • I had a couple of stupid bugs in:
    netns: Teach network device kobjects which namespace they are in.

    - I duplicated the Kconfig for the NET_NS
    - The build was broken when sysfs was not compiled in

    The sysfs breakage is because after I moved the operations
    for the sysfs to the kobject layer, to make things cleaner
    I forgot to move the ifdefs. Opps.

    I'm not quite certain how I got introduced a second NET_NS Kconfig,
    but it was probably a 3 way merge somewhere along the way that
    did not notice that the NET_NS Kconfig option had mvoed and thout
    that was a bug. It probably slipped in because it used to be the
    sysfs patches were the first patches in my network namespace patches.
    Some things just don't go like you would expect.

    Neither of these bugs actually affect anything in the common case
    but they should be fixed.

    Thanks to Serge for noticing they were present.

    Reported-by: Serge E. Hallyn
    Signed-off-by: Eric W. Biederman
    Acked-by: David S. Miller

    Eric W. Biederman
     
  • The problem. Network devices show up in sysfs and with the network
    namespace active multiple devices with the same name can show up in
    the same directory, ouch!

    To avoid that problem and allow existing applications in network namespaces
    to see the same interface that is currently presented in sysfs, this
    patch enables the tagging directory support in sysfs.

    By using the network namespace pointers as tags to separate out the
    the sysfs directory entries we ensure that we don't have conflicts
    in the directories and applications only see a limited set of
    the network devices.

    Signed-off-by: Eric W. Biederman
    Acked-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric W. Biederman
     
  • This allows bin_attr->read,write,mmap callbacks to check file specific data
    (such as inode owner) as part of any privilege validation.

    Signed-off-by: Chris Wright
    Signed-off-by: Greg Kroah-Hartman

    Chris Wright