04 Feb, 2013

1 commit


30 Jan, 2013

1 commit

  • The return value of pktgen_add_device() is not checked, so
    even if we fail to add some device, for example, non-exist one,
    we still see "OK:...". This patch fixes it.

    After this patch, I got:

    # echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0
    -bash: echo: write error: No such device
    # cat /proc/net/pktgen/kpktgend_0
    Running:
    Stopped:
    Result: ERROR: can not add device non-exist
    # echo "add_device eth0" > /proc/net/pktgen/kpktgend_0
    # cat /proc/net/pktgen/kpktgend_0
    Running:
    Stopped: eth0
    Result: OK: add_device=eth0

    (Candidate for -stable)

    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

23 Jan, 2013

1 commit

  • Commit 6a328d8c6f03501657ad580f6f98bf9a42583ff7 changed the update
    logic for the socket but it does not update the SCM_RIGHTS update
    as well. This patch is based on the net_prio fix commit

    48a87cc26c13b68f6cce4e9d769fcb17a6b3e4b8

    net: netprio: fd passed in SCM_RIGHTS datagram not set correctly

    A socket fd passed in a SCM_RIGHTS datagram was not getting
    updated with the new tasks cgrp prioidx. This leaves IO on
    the socket tagged with the old tasks priority.

    To fix this add a check in the scm recvmsg path to update the
    sock cgrp prioidx with the new tasks value.

    Let's apply the same fix for net_cls.

    Signed-off-by: Daniel Wagner
    Reported-by: Li Zefan
    Cc: "David S. Miller"
    Cc: "Eric W. Biederman"
    Cc: Al Viro
    Cc: John Fastabend
    Cc: Neil Horman
    Cc: netdev@vger.kernel.org
    Cc: cgroups@vger.kernel.org
    Signed-off-by: David S. Miller

    Daniel Wagner
     

21 Jan, 2013

2 commits

  • commit 9ca1b22d6d2 (net: splice: avoid high order page splitting)
    forgot that skb->head could need a copy into several page frags.

    This could be the case for loopback traffic mostly.

    Also remove now useless skb argument from linear_to_page()
    and __splice_segment() prototypes.

    Signed-off-by: Eric Dumazet
    Cc: Willy Tarreau
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • splice() can handle pages of any order, but network code tries hard to
    split them in PAGE_SIZE units. Not quite successfully anyway, as
    __splice_segment() assumed poff < PAGE_SIZE. This is true for
    the skb->data part, not necessarily for the fragments.

    This patch removes this logic to give the pages as they are in the skb.

    Signed-off-by: Eric Dumazet
    Cc: Willy Tarreau
    Signed-off-by: David S. Miller

    Eric Dumazet
     

15 Jan, 2013

1 commit

  • spin_is_locked() on a non !SMP build is kind of useless.

    BUG_ON(!spin_is_locked(xx)) is guaranteed to crash.

    Just remove this check in reqsk_fastopen_remove() as
    the callers do hold the socket lock.

    Reported-by: Ketan Kulkarni
    Signed-off-by: Eric Dumazet
    Cc: Jerry Chu
    Cc: Yuchung Cheng
    Cc: Dave Taht
    Acked-by: H.K. Jerry Chu
    Signed-off-by: David S. Miller

    Eric Dumazet
     

12 Jan, 2013

1 commit

  • Since:

    commit 2c60db037034d27f8c636403355d52872da92f81
    Author: Eric Dumazet
    Date: Sun Sep 16 09:17:26 2012 +0000

    net: provide a default dev->ethtool_ops

    wireless core does not correctly assign ethtool_ops.

    After alloc_netdev*() call, some cfg80211 drivers provide they own
    ethtool_ops, but some do not. For them, wireless core provide generic
    cfg80211_ethtool_ops, which is assigned in NETDEV_REGISTER notify call:

    if (!dev->ethtool_ops)
    dev->ethtool_ops = &cfg80211_ethtool_ops;

    But after Eric's commit, dev->ethtool_ops is no longer NULL (on cfg80211
    drivers without custom ethtool_ops), but points to &default_ethtool_ops.

    In order to fix the problem, provide function which will overwrite
    default_ethtool_ops and use it by wireless core.

    Signed-off-by: Stanislaw Gruszka
    Acked-by: Johannes Berg
    Acked-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Stanislaw Gruszka
     

22 Dec, 2012

2 commits

  • CONFIG_HOTPLUG is always enabled now, so remove the unused code that was
    trying to be compiled out when this option was disabled, in the
    networking core.

    Cc: Bill Pemberton
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: David S. Miller

    Greg KH
     
  • Using a seqlock for devnet_rename_seq is not a good idea,
    as device_rename() can sleep.

    As we hold RTNL, we dont need a protection for writers,
    and only need a seqcount so that readers can catch a change done
    by a writer.

    Bug added in commit c91f6df2db4972d3 (sockopt: Change getsockopt() of
    SO_BINDTODEVICE to return an interface name)

    Reported-by: Dave Jones
    Signed-off-by: Eric Dumazet
    Cc: Brian Haley
    Signed-off-by: David S. Miller

    Eric Dumazet
     

19 Dec, 2012

1 commit

  • Pull (again) user namespace infrastructure changes from Eric Biederman:
    "Those bugs, those darn embarrasing bugs just want don't want to get
    fixed.

    Linus I just updated my mirror of your kernel.org tree and it appears
    you successfully pulled everything except the last 4 commits that fix
    those embarrasing bugs.

    When you get a chance can you please repull my branch"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    userns: Fix typo in description of the limitation of userns_install
    userns: Add a more complete capability subset test to commit_creds
    userns: Require CAP_SYS_ADMIN for most uses of setns.
    Fix cap_capable to only allow owners in the parent user namespace to have caps.

    Linus Torvalds
     

18 Dec, 2012

1 commit

  • Pull user namespace changes from Eric Biederman:
    "While small this set of changes is very significant with respect to
    containers in general and user namespaces in particular. The user
    space interface is now complete.

    This set of changes adds support for unprivileged users to create user
    namespaces and as a user namespace root to create other namespaces.
    The tyranny of supporting suid root preventing unprivileged users from
    using cool new kernel features is broken.

    This set of changes completes the work on setns, adding support for
    the pid, user, mount namespaces.

    This set of changes includes a bunch of basic pid namespace
    cleanups/simplifications. Of particular significance is the rework of
    the pid namespace cleanup so it no longer requires sending out
    tendrils into all kinds of unexpected cleanup paths for operation. At
    least one case of broken error handling is fixed by this cleanup.

    The files under /proc//ns/ have been converted from regular files
    to magic symlinks which prevents incorrect caching by the VFS,
    ensuring the files always refer to the namespace the process is
    currently using and ensuring that the ptrace_mayaccess permission
    checks are always applied.

    The files under /proc//ns/ have been given stable inode numbers
    so it is now possible to see if different processes share the same
    namespaces.

    Through the David Miller's net tree are changes to relax many of the
    permission checks in the networking stack to allowing the user
    namespace root to usefully use the networking stack. Similar changes
    for the mount namespace and the pid namespace are coming through my
    tree.

    Two small changes to add user namespace support were commited here adn
    in David Miller's -net tree so that I could complete the work on the
    /proc//ns/ files in this tree.

    Work remains to make it safe to build user namespaces and 9p, afs,
    ceph, cifs, coda, gfs2, ncpfs, nfs, nfsd, ocfs2, and xfs so the
    Kconfig guard remains in place preventing that user namespaces from
    being built when any of those filesystems are enabled.

    Future design work remains to allow root users outside of the initial
    user namespace to mount more than just /proc and /sys."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (38 commits)
    proc: Usable inode numbers for the namespace file descriptors.
    proc: Fix the namespace inode permission checks.
    proc: Generalize proc inode allocation
    userns: Allow unprivilged mounts of proc and sysfs
    userns: For /proc/self/{uid,gid}_map derive the lower userns from the struct file
    procfs: Print task uids and gids in the userns that opened the proc file
    userns: Implement unshare of the user namespace
    userns: Implent proc namespace operations
    userns: Kill task_user_ns
    userns: Make create_new_namespaces take a user_ns parameter
    userns: Allow unprivileged use of setns.
    userns: Allow unprivileged users to create new namespaces
    userns: Allow setting a userns mapping to your current uid.
    userns: Allow chown and setgid preservation
    userns: Allow unprivileged users to create user namespaces.
    userns: Ignore suid and sgid on binaries if the uid or gid can not be mapped
    userns: fix return value on mntns_install() failure
    vfs: Allow unprivileged manipulation of the mount namespace.
    vfs: Only support slave subtrees across different user namespaces
    vfs: Add a user namespace reference from struct mnt_namespace
    ...

    Linus Torvalds
     

15 Dec, 2012

1 commit

  • Andy Lutomirski found a nasty little bug in
    the permissions of setns. With unprivileged user namespaces it
    became possible to create new namespaces without privilege.

    However the setns calls were relaxed to only require CAP_SYS_ADMIN in
    the user nameapce of the targed namespace.

    Which made the following nasty sequence possible.

    pid = clone(CLONE_NEWUSER | CLONE_NEWNS);
    if (pid == 0) { /* child */
    system("mount --bind /home/me/passwd /etc/passwd");
    }
    else if (pid != 0) { /* parent */
    char path[PATH_MAX];
    snprintf(path, sizeof(path), "/proc/%u/ns/mnt");
    fd = open(path, O_RDONLY);
    setns(fd, 0);
    system("su -");
    }

    Prevent this possibility by requiring CAP_SYS_ADMIN
    in the current user namespace when joing all but the user namespace.

    Acked-by: Serge Hallyn
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

13 Dec, 2012

2 commits

  • Pull networking changes from David Miller:

    1) Allow to dump, monitor, and change the bridge multicast database
    using netlink. From Cong Wang.

    2) RFC 5961 TCP blind data injection attack mitigation, from Eric
    Dumazet.

    3) Networking user namespace support from Eric W. Biederman.

    4) tuntap/virtio-net multiqueue support by Jason Wang.

    5) Support for checksum offload of encapsulated packets (basically,
    tunneled traffic can still be checksummed by HW). From Joseph
    Gasparakis.

    6) Allow BPF filter access to VLAN tags, from Eric Dumazet and
    Daniel Borkmann.

    7) Bridge port parameters over netlink and BPDU blocking support
    from Stephen Hemminger.

    8) Improve data access patterns during inet socket demux by rearranging
    socket layout, from Eric Dumazet.

    9) TIPC protocol updates and cleanups from Ying Xue, Paul Gortmaker, and
    Jon Maloy.

    10) Update TCP socket hash sizing to be more in line with current day
    realities. The existing heurstics were choosen a decade ago.
    From Eric Dumazet.

    11) Fix races, queue bloat, and excessive wakeups in ATM and
    associated drivers, from Krzysztof Mazur and David Woodhouse.

    12) Support DOVE (Distributed Overlay Virtual Ethernet) extensions
    in VXLAN driver, from David Stevens.

    13) Add "oops_only" mode to netconsole, from Amerigo Wang.

    14) Support set and query of VEB/VEPA bridge mode via PF_BRIDGE, also
    allow DCB netlink to work on namespaces other than the initial
    namespace. From John Fastabend.

    15) Support PTP in the Tigon3 driver, from Matt Carlson.

    16) tun/vhost zero copy fixes and improvements, plus turn it on
    by default, from Michael S. Tsirkin.

    17) Support per-association statistics in SCTP, from Michele
    Baldessari.

    And many, many, driver updates, cleanups, and improvements. Too
    numerous to mention individually.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits)
    net/mlx4_en: Add support for destination MAC in steering rules
    net/mlx4_en: Use generic etherdevice.h functions.
    net: ethtool: Add destination MAC address to flow steering API
    bridge: add support of adding and deleting mdb entries
    bridge: notify mdb changes via netlink
    ndisc: Unexport ndisc_{build,send}_skb().
    uapi: add missing netconf.h to export list
    pkt_sched: avoid requeues if possible
    solos-pci: fix double-free of TX skb in DMA mode
    bnx2: Fix accidental reversions.
    bna: Driver Version Updated to 3.1.2.1
    bna: Firmware update
    bna: Add RX State
    bna: Rx Page Based Allocation
    bna: TX Intr Coalescing Fix
    bna: Tx and Rx Optimizations
    bna: Code Cleanup and Enhancements
    ath9k: check pdata variable before dereferencing it
    ath5k: RX timestamp is reported at end of frame
    ath9k_htc: RX timestamp is reported at end of frame
    ...

    Linus Torvalds
     
  • Pull cgroup changes from Tejun Heo:
    "A lot of activities on cgroup side. The big changes are focused on
    making cgroup hierarchy handling saner.

    - cgroup_rmdir() had peculiar semantics - it allowed cgroup
    destruction to be vetoed by individual controllers and tried to
    drain refcnt synchronously. The vetoing never worked properly and
    caused good deal of contortions in cgroup. memcg was the last
    reamining user. Michal Hocko removed the usage and cgroup_rmdir()
    path has been simplified significantly. This was done in a
    separate branch so that the memcg people can base further memcg
    changes on top.

    - The above allowed cleaning up cgroup lifecycle management and
    implementation of generic cgroup iterators which are used to
    improve hierarchy support.

    - cgroup_freezer updated to allow migration in and out of a frozen
    cgroup and handle hierarchy. If a cgroup is frozen, all descendant
    cgroups are frozen.

    - netcls_cgroup and netprio_cgroup updated to handle hierarchy
    properly.

    - Various fixes and cleanups.

    - Two merge commits. One to pull in memcg and rmdir cleanups (needed
    to build iterators). The other pulled in cgroup/for-3.7-fixes for
    device_cgroup fixes so that further device_cgroup patches can be
    stacked on top."

    Fixed up a trivial conflict in mm/memcontrol.c as per Tejun (due to
    commit bea8c150a7 ("memcg: fix hotplugged memory zone oops") in master
    touching code close to commit 2ef37d3fe4 ("memcg: Simplify
    mem_cgroup_force_empty_list error handling") in for-3.8)

    * 'for-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (65 commits)
    cgroup: update Documentation/cgroups/00-INDEX
    cgroup_rm_file: don't delete the uncreated files
    cgroup: remove subsystem files when remounting cgroup
    cgroup: use cgroup_addrm_files() in cgroup_clear_directory()
    cgroup: warn about broken hierarchies only after css_online
    cgroup: list_del_init() on removed events
    cgroup: fix lockdep warning for event_control
    cgroup: move list add after list head initilization
    netprio_cgroup: allow nesting and inherit config on cgroup creation
    netprio_cgroup: implement netprio[_set]_prio() helpers
    netprio_cgroup: use cgroup->id instead of cgroup_netprio_state->prioidx
    netprio_cgroup: reimplement priomap expansion
    netprio_cgroup: shorten variable names in extend_netdev_table()
    netprio_cgroup: simplify write_priomap()
    netcls_cgroup: move config inheritance to ->css_online() and remove .broken_hierarchy marking
    cgroup: remove obsolete guarantee from cgroup_task_migrate.
    cgroup: add cgroup->id
    cgroup, cpuset: remove cgroup_subsys->post_clone()
    cgroup: s/CGRP_CLONE_CHILDREN/CGRP_CPUSET_CLONE_CHILDREN/
    cgroup: rename ->create/post_create/pre_destroy/destroy() to ->css_alloc/online/offline/free()
    ...

    Linus Torvalds
     

12 Dec, 2012

3 commits


11 Dec, 2012

1 commit


09 Dec, 2012

2 commits

  • This change allows the VXLAN to enable Tx checksum offloading even on
    devices that do not support encapsulated checksum offloads. The
    advantage to this is that it allows for the lower device to change due
    to routing table changes without impacting features on the VXLAN itself.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • This patch adds support in the kernel for offloading in the NIC Tx and Rx
    checksumming for encapsulated packets (such as VXLAN and IP GRE).

    For Tx encapsulation offload, the driver will need to set the right bits
    in netdev->hw_enc_features. The protocol driver will have to set the
    skb->encapsulation bit and populate the inner headers, so the NIC driver will
    use those inner headers to calculate the csum in hardware.

    For Rx encapsulation offload, the driver will need to set again the
    skb->encapsulation flag and the skb->ip_csum to CHECKSUM_UNNECESSARY.
    In that case the protocol driver should push the decapsulated packet up
    to the stack, again with CHECKSUM_UNNECESSARY. In ether case, the protocol
    driver should set the skb->encapsulation flag back to zero. Finally the
    protocol driver should have NETIF_F_RXCSUM flag set in its features.

    Signed-off-by: Joseph Gasparakis
    Signed-off-by: Peter P Waskiewicz Jr
    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Joseph Gasparakis
     

08 Dec, 2012

2 commits

  • commit 2e71a6f8084e (net: gro: selective flush of packets) added
    a bug for skbs using frag_list. This part of the GRO stack is rarely
    used, as it needs skb not using a page fragment for their skb->head.

    Most drivers do use a page fragment, but some of them use GFP_KERNEL
    allocations for the initial fill of their RX ring buffer.

    napi_gro_flush() overwrite skb->prev that was used for these skb to
    point to the last skb in frag_list.

    Fix this using a separate field in struct napi_gro_cb to point to the
    last fragment.

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

    Eric Dumazet
     
  • Do the same thing as in set mac. Call notifiers every time.

    Signed-off-by: Jiri Pirko
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Jiri Pirko
     

06 Dec, 2012

2 commits

  • net/core/neighbour.c:65:12: warning: 'zero' defined but not used [-Wunused-variable]
    net/core/neighbour.c:66:12: warning: 'unres_qlen_max' defined but not used [-Wunused-variable]

    These variables are only used when CONFIG_SYSCTL is defined,
    so move them under #ifdef CONFIG_SYSCTL.

    Reported-by: Fengguang Wu
    Signed-off-by: Cong Wang
    Acked-by: Shan Wei
    Signed-off-by: David S. Miller

    Cong Wang
     
  • unres_qlen_bytes and unres_qlen are int type.
    But multiple relation(unres_qlen_bytes = unres_qlen * SKB_TRUESIZE(ETH_FRAME_LEN))
    will cause type overflow when seting unres_qlen. e.g.

    $ echo 1027506 > /proc/sys/net/ipv4/neigh/eth1/unres_qlen
    $ cat /proc/sys/net/ipv4/neigh/eth1/unres_qlen
    1182657265
    $ cat /proc/sys/net/ipv4/neigh/eth1/unres_qlen_bytes
    -2147479756

    The gutted value is not that we setting。
    But user/administrator don't know this is caused by int type overflow.

    what's more, it is meaningless and even dangerous that unres_qlen_bytes is set
    with negative number. Because, for unresolved neighbour address, kernel will cache packets
    without limit in __neigh_event_send()(e.g. (u32)-1 = 2GB).

    Signed-off-by: Shan Wei
    Signed-off-by: David S. Miller

    Shan Wei
     

05 Dec, 2012

1 commit

  • When a new nic is created in namespace ns1, the kernel sends a KOBJ_ADD uevent
    to ns1. When the nic is moved to ns2, we only send a KOBJ_MOVE to ns2, and
    nothing to ns1.

    This patch changes that behavior so that when moving a nic from ns1 to ns2, we
    send a KOBJ_REMOVED to ns1 and KOBJ_ADD to ns2. (The KOBJ_MOVE is still
    sent to ns2).

    The effects of this can be seen when starting and stopping containers in
    an upstart based host. Lxc will create a pair of veth nics, the kernel
    sends KOBJ_ADD, and upstart starts network-instance jobs for each. When
    one nic is moved to the container, because no KOBJ_REMOVED event is
    received, the network-instance job for that veth never goes away. This
    was reported at https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1065589
    With this patch the networ-instance jobs properly go away.

    The other oddness solved here is that if a nic is passed into a running
    upstart-based container, without this patch no network-instance job is
    started in the container. But when the container creates a new nic
    itself (ip link add new type veth) then network-interface jobs are
    created. With this patch, behavior comes in line with a regular host.

    v2: also send KOBJ_ADD to new netns. There will then be a
    _MOVE event from the device_rename() call, but that should
    be innocuous.

    Signed-off-by: Serge Hallyn
    Acked-by: "Eric W. Biederman"
    Acked-by: Daniel Lezcano
    Signed-off-by: David S. Miller

    Serge Hallyn
     

01 Dec, 2012

1 commit

  • This patch removes an unused parameter (src_net) from rtnl_create_link()
    method and from the method single invocation, in veth.
    This parameter was used in the past when calling
    ops->get_tx_queues(src_net, tb) in rtnl_create_link().
    The get_tx_queues() member of rtnl_link_ops was replaced by two methods,
    get_num_tx_queues() and get_num_rx_queues(), which do not get any
    parameter. This was done in commit d40156aa5ecbd51fed932ed4813df82b56e5ff4d by
    Jiri Pirko ("rtnl: allow to specify different num for rx and tx queue count").

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     

30 Nov, 2012

1 commit

  • This patch changes three methods to be static and removes their
    EXPORT_SYMBOLs in core/dev.c and their external declaration in
    netdevice.h. The methods, dev_gro_receive(), napi_frags_finish() and
    napi_skb_finish(), which are in the GRO rx path, are not used
    outside core/dev.c.

    Signed-off-by: Rami Rosen
    Signed-off-by: David S. Miller

    Rami Rosen
     

27 Nov, 2012

1 commit

  • Instead of having the getsockopt() of SO_BINDTODEVICE return an index, which
    will then require another call like if_indextoname() to get the actual interface
    name, have it return the name directly.

    This also matches the existing man page description on socket(7) which mentions
    the argument being an interface name.

    If the value has not been set, zero is returned and optlen will be set to zero
    to indicate there is no interface name present.

    Added a seqlock to protect this code path, and dev_ifname(), from someone
    changing the device name via dev_change_name().

    v2: Added seqlock protection while copying device name.

    v3: Fixed word wrap in patch.

    Signed-off-by: Brian Haley
    Signed-off-by: David S. Miller

    Brian Haley
     

26 Nov, 2012

1 commit


22 Nov, 2012

7 commits

  • Inherit netprio configuration from ->css_online(), allow nesting and
    remove .broken_hierarchy marking. This makes netprio_cgroup's
    behavior match netcls_cgroup's.

    Note that this patch changes userland-visible behavior. Nesting is
    allowed and the first level cgroups below the root cgroup behave
    differently - they inherit priorities from the root cgroup on creation
    instead of starting with 0. This is unfortunate but not doing so is
    much crazier.

    Signed-off-by: Tejun Heo
    Tested-and-Acked-by: Daniel Wagner
    Acked-by: David S. Miller

    Tejun Heo
     
  • Introduce two helpers - netprio_prio() and netprio_set_prio() - which
    hide the details of priomap access and expansion. This will help
    implementing hierarchy support.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Horman
    Tested-and-Acked-by: Daniel Wagner
    Acked-by: David S. Miller

    Tejun Heo
     
  • With priomap expansion no longer depending on knowing max id
    allocated, netprio_cgroup can use cgroup->id insted of cs->prioidx.
    Drop prioidx alloc/free logic and convert all uses to cgroup->id.

    * In cgrp_css_alloc(), parent->id test is moved above @cs allocation
    to simplify error path.

    * In cgrp_css_free(), @cs assignment is made initialization.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Horman
    Tested-and-Acked-by: Daniel Wagner
    Acked-by: David S. Miller

    Tejun Heo
     
  • netprio kept track of the highest prioidx allocated and resized
    priomaps accordingly when necessary. This makes it necessary to keep
    track of prioidx allocation and may end up resizing on every new
    prioidx.

    Update extend_netdev_table() such that it takes @target_idx which the
    priomap should be able to accomodate. If the priomap is large enough,
    nothing happens; otherwise, the size is doubled until @target_idx can
    be accomodated.

    This makes max_prioidx and write_update_netdev_table() unnecessary.
    write_priomap() now calls extend_netdev_table() directly.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Horman
    Tested-and-Acked-by: Daniel Wagner
    Acked-by: David S. Miller

    Tejun Heo
     
  • The function is about to go through a rewrite. In preparation,
    shorten the variable names so that we don't repeat "priomap" so often.

    This patch is cosmetic.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Horman
    Tested-and-Acked-by: Daniel Wagner
    Acked-by: David S. Miller

    Tejun Heo
     
  • sscanf() doesn't bite.

    Signed-off-by: Tejun Heo
    Acked-by: Neil Horman
    Tested-and-Acked-by: Daniel Wagner
    Acked-by: David S. Miller

    Tejun Heo
     
  • …wireless into for-davem

    John W. Linville says:

    ====================
    This is a batch of fixes intended for 3.7...

    Included are two pulls. Regarding the mac80211 tree, Johannes says:

    "Please pull my mac80211.git tree (see below) to get two more fixes for
    3.7. Both fix regressions introduced *before* this cycle that weren't
    noticed until now, one for IBSS not cleaning up properly and the other
    to add back the "wireless" sysfs directory for Fedora's startup scripts."

    Regarding the iwlwifi tree, Johannes says:

    "Please also pull my iwlwifi.git tree, I have two fixes: one to remove a
    spurious warning that can actually trigger in legitimate situations, and
    the other to fix a regression from when monitor mode was changed to use
    the "sniffer" firmware mode."

    Also included is an nfc tree pull. Samuel says:

    "We mostly have pn533 fixes here, 2 memory leaks and an early unlocking fix.
    Moreover, we also have an LLCP adapter linked list insertion fix."

    On top of that, a few more bits... Albert Pool adds a USB ID
    to rtlwifi. Bing Zhao provides two mwifiex fixes -- one to fix
    a system hang during a command timeout, and the other to properly
    report a suspend error to the MMC core. Finally, Sujith Manoharan
    fixes a thinko that would trigger an ath9k hang during device reset.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    John W. Linville
     

21 Nov, 2012

1 commit


20 Nov, 2012

3 commits

  • Assign a unique proc inode to each namespace, and use that
    inode number to ensure we only allocate at most one proc
    inode for every namespace in proc.

    A single proc inode per namespace allows userspace to test
    to see if two processes are in the same namespace.

    This has been a long requested feature and only blocked because
    a naive implementation would put the id in a global space and
    would ultimately require having a namespace for the names of
    namespaces, making migration and certain virtualization tricks
    impossible.

    We still don't have per superblock inode numbers for proc, which
    appears necessary for application unaware checkpoint/restart and
    migrations (if the application is using namespace file descriptors)
    but that is now allowd by the design if it becomes important.

    I have preallocated the ipc and uts initial proc inode numbers so
    their structures can be statically initialized.

    Signed-off-by: Eric W. Biederman

    Eric W. Biederman
     
  • - Push the permission check from the core setns syscall into
    the setns install methods where the user namespace of the
    target namespace can be determined, and used in a ns_capable
    call.

    Acked-by: Serge Hallyn
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • The wireless and wext includes in net-sysfs.c aren't
    needed, so remove them.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg