1. 29 4月, 2008 1 次提交
    • P
      sysctl: merge equal proc_sys_read and proc_sys_write · 7708bfb1
      Pavel Emelyanov 提交于
      Many (most of) sysctls do not have a per-container sense.  E.g.
      kernel.print_fatal_signals, vm.panic_on_oom, net.core.netdev_budget and so on
      and so forth.  Besides, tuning then from inside a container is not even
      secure.  On the other hand, hiding them completely from the container's tasks
      sometimes causes user-space to stop working.
      
      When developing net sysctl, the common practice was to duplicate a table and
      drop the write bits in table->mode, but this approach was not very elegant,
      lead to excessive memory consumption and was not suitable in general.
      
      Here's the alternative solution.  To facilitate the per-container sysctls
      ctl_table_root-s were introduced.  Each root contains a list of
      ctl_table_header-s that are visible to different namespaces.  The idea of this
      set is to add the permissions() callback on the ctl_table_root to allow ctl
      root limit permissions to the same ctl_table-s.
      
      The main user of this functionality is the net-namespaces code, but later this
      will (should) be used by more and more namespaces, containers and control
      groups.
      
      Actually, this idea's core is in a single hunk in the third patch.  First two
      patches are cleanups for sysctl code, while the third one mostly extends the
      arguments set of some sysctl functions.
      
      This patch:
      
      These ->read and ->write callbacks act in a very similar way, so merge these
      paths to reduce the number of places to patch later and shrink the .text size
      (a bit).
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Acked-by: N"David S. Miller" <davem@davemloft.net>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Alexey Dobriyan <adobriyan@sw.ru>
      Cc: Denis V. Lunev <den@openvz.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7708bfb1
  2. 15 2月, 2008 1 次提交
    • J
      Embed a struct path into struct nameidata instead of nd->{dentry,mnt} · 4ac91378
      Jan Blunck 提交于
      This is the central patch of a cleanup series. In most cases there is no good
      reason why someone would want to use a dentry for itself. This series reflects
      that fact and embeds a struct path into nameidata.
      
      Together with the other patches of this series
      - it enforced the correct order of getting/releasing the reference count on
        <dentry,vfsmount> pairs
      - it prepares the VFS for stacking support since it is essential to have a
        struct path in every place where the stack can be traversed
      - it reduces the overall code size:
      
      without patch series:
         text    data     bss     dec     hex filename
      5321639  858418  715768 6895825  6938d1 vmlinux
      
      with patch series:
         text    data     bss     dec     hex filename
      5320026  858418  715768 6894212  693284 vmlinux
      
      This patch:
      
      Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: fix cifs]
      [akpm@linux-foundation.org: fix smack]
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Signed-off-by: NAndreas Gruenbacher <agruen@suse.de>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Casey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4ac91378
  3. 09 2月, 2008 1 次提交
  4. 26 10月, 2007 1 次提交
  5. 09 5月, 2007 1 次提交
  6. 15 2月, 2007 2 次提交
    • E
      [PATCH] sysctl: hide the sysctl proc inodes from selinux · 86a71dbd
      Eric W. Biederman 提交于
      Since the security checks are applied on each read and write of a sysctl file,
      just like they are applied when calling sys_sysctl, they are redundant on the
      standard VFS constructs.  Since it is difficult to compute the security labels
      on the standard VFS constructs we just mark the sysctl inodes in proc private
      so selinux won't even bother with them.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      86a71dbd
    • E
      [PATCH] sysctl: reimplement the sysctl proc support · 77b14db5
      Eric W. Biederman 提交于
      With this change the sysctl inodes can be cached and nothing needs to be done
      when removing a sysctl table.
      
      For a cost of 2K code we will save about 4K of static tables (when we remove
      de from ctl_table) and 70K in proc_dir_entries that we will not allocate, or
      about half that on a 32bit arch.
      
      The speed feels about the same, even though we can now cache the sysctl
      dentries :(
      
      We get the core advantage that we don't need to have a 1 to 1 mapping between
      ctl table entries and proc files.  Making it possible to have /proc/sys vary
      depending on the namespace you are in.  The currently merged namespaces don't
      have an issue here but the network namespace under /proc/sys/net needs to have
      different directories depending on which network adapters are visible.  By
      simply being a cache different directories being visible depending on who you
      are is trivial to implement.
      
      [akpm@osdl.org: fix uninitialised var]
      [akpm@osdl.org: fix ARM build]
      [bunk@stusta.de: make things static]
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      77b14db5