1. 22 5月, 2010 5 次提交
    • E
      net: Expose all network devices in a namespaces in sysfs · a1b3f594
      Eric W. Biederman 提交于
      This reverts commit aaf8cdc3.
      
      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: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a1b3f594
    • E
      netlink: Implment netlink_broadcast_filtered · 910a7e90
      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: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      910a7e90
    • E
      net/sysfs: Fix the bitrot in network device kobject namespace support · d6523ddf
      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: NSerge E. Hallyn <serue@us.ibm.com>
      Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      
      d6523ddf
    • E
      netns: Teach network device kobjects which namespace they are in. · 608b4b95
      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: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      608b4b95
    • C
      sysfs: add struct file* to bin_attr callbacks · 2c3c8bea
      Chris Wright 提交于
      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: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2c3c8bea
  2. 19 5月, 2010 5 次提交
  3. 18 5月, 2010 24 次提交
  4. 17 5月, 2010 2 次提交
    • F
      sunrpc: Include missing smp_lock.h · 99df95a2
      Frederic Weisbecker 提交于
      Now that cache_ioctl_procfs() calls the bkl explicitly, we need to
      include the relevant header as well.
      
      This fixes the following build error:
      
      	net/sunrpc/cache.c: In function 'cache_ioctl_procfs':
      	net/sunrpc/cache.c:1355: error: implicit declaration of function 'lock_kernel'
      	net/sunrpc/cache.c:1359: error: implicit declaration of function 'unlock_kernel'
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      99df95a2
    • F
      procfs: Push down the bkl from ioctl · d79b6f4d
      Frederic Weisbecker 提交于
      Push down the bkl from procfs's ioctl main handler to its users.
      Only three procfs users implement an ioctl (non unlocked) handler.
      Turn them into unlocked_ioctl and push down the Devil inside.
      
      v2: PDE(inode)->data doesn't need to be under bkl
      v3: And don't forget to git-add the result
      v4: Use wrappers to pushdown instead of an invasive and error prone
          handlers surgery.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      d79b6f4d
  5. 16 5月, 2010 4 次提交