1. 30 11月, 2007 1 次提交
    • A
      proc: fix NULL ->i_fop oops · c2319540
      Alexey Dobriyan 提交于
      proc_kill_inodes() can clear ->i_fop in the middle of vfs_readdir resulting in
      NULL dereference during "file->f_op->readdir(file, buf, filler)".
      
      The solution is to remove proc_kill_inodes() completely:
      
      a) we don't have tricky modules implementing their tricky readdir hooks which
         could keeping this revoke from hell.
      
      b) In a situation when module is gone but PDE still alive, standard
         readdir will return only "." and "..", because pde->next was cleared by
         remove_proc_entry().
      
      c) the race proc_kill_inode() destined to prevent is not completely
         fixed, just race window made smaller, because vfs_readdir() is run
         without sb_lock held and without file_list_lock held.  Effectively,
         ->i_fop is cleared at random moment, which can't fix properly anything.
      
      BUG: unable to handle kernel NULL pointer dereference at virtual address 00000018
      printing eip: c1061205 *pdpt = 0000000005b22001 *pde = 0000000000000000
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: foo af_packet ipv6 cpufreq_ondemand loop serio_raw sr_mod k8temp cdrom hwmon amd_rng
      Pid: 2033, comm: find Not tainted (2.6.24-rc1-b1d08ac0 #2)
      EIP: 0060:[<c1061205>] EFLAGS: 00010246 CPU: 0
      EIP is at vfs_readdir+0x47/0x74
      EAX: c6b6a780 EBX: 00000000 ECX: c1061040 EDX: c5decf94
      ESI: c6b6a780 EDI: fffffffe EBP: c9797c54 ESP: c5decf78
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      Process find (pid: 2033, ti=c5dec000 task=c64bba90 task.ti=c5dec000)
      Stack: c5decf94 c1061040 fffffff7 0805ffbc 00000000 c6b6a780 c1061295 0805ffbc
             00000000 00000400 00000000 00000004 0805ffbc 4588eff4 c5dec000 c10026ba
             00000004 0805ffbc 00000400 0805ffbc 4588eff4 bfdc6c70 000000dc 0000007b
      Call Trace:
       [<c1061040>] filldir64+0x0/0xc5
       [<c1061295>] sys_getdents64+0x63/0xa5
       [<c10026ba>] sysenter_past_esp+0x5f/0x85
       =======================
      Code: 49 83 78 18 00 74 43 8d 6b 74 bf fe ff ff ff 89 e8 e8 b8 c0 12 00 f6 83 2c 01 00 00 10 75 22 8b 5e 10 8b 4c 24 04 89 f0 8b 14 24 <ff> 53 18 f6 46 1a 04 89 c7 75 0b 8b 56 0c 8b 46 08 e8 c8 66 00
      EIP: [<c1061205>] vfs_readdir+0x47/0x74 SS:ESP 0068:c5decf78
      
      hch: "Nice, getting rid of this is a very good step formwards.
            Unfortunately we have another copy of this junk in
            security/selinux/selinuxfs.c:sel_remove_entries() which would need the
            same treatment."
      Signed-off-by: NAlexey Dobriyan <adobriyan@sw.ru>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: James Morris <jmorris@namei.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c2319540
  2. 15 11月, 2007 1 次提交
  3. 11 10月, 2007 1 次提交
    • E
      [NET]: Make /proc/net per network namespace · 457c4cbc
      Eric W. Biederman 提交于
      This patch makes /proc/net per network namespace.  It modifies the global
      variables proc_net and proc_net_stat to be per network namespace.
      The proc_net file helpers are modified to take a network namespace argument,
      and all of their callers are fixed to pass &init_net for that argument.
      This ensures that all of the /proc/net files are only visible and
      usable in the initial network namespace until the code behind them
      has been updated to be handle multiple network namespaces.
      
      Making /proc/net per namespace is necessary as at least some files
      in /proc/net depend upon the set of network devices which is per
      network namespace, and even more files in /proc/net have contents
      that are relevant to a single network namespace.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      457c4cbc
  4. 09 5月, 2007 1 次提交
    • K
      proc: maps protection · 5096add8
      Kees Cook 提交于
      The /proc/pid/ "maps", "smaps", and "numa_maps" files contain sensitive
      information about the memory location and usage of processes.  Issues:
      
      - maps should not be world-readable, especially if programs expect any
        kind of ASLR protection from local attackers.
      - maps cannot just be 0400 because "-D_FORTIFY_SOURCE=2 -O2" makes glibc
        check the maps when %n is in a *printf call, and a setuid(getuid())
        process wouldn't be able to read its own maps file.  (For reference
        see http://lkml.org/lkml/2006/1/22/150)
      - a system-wide toggle is needed to allow prior behavior in the case of
        non-root applications that depend on access to the maps contents.
      
      This change implements a check using "ptrace_may_attach" before allowing
      access to read the maps contents.  To control this protection, the new knob
      /proc/sys/kernel/maps_protect has been added, with corresponding updates to
      the procfs documentation.
      
      [akpm@linux-foundation.org: build fixes]
      [akpm@linux-foundation.org: New sysctl numbers are old hat]
      Signed-off-by: NKees Cook <kees@outflux.net>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5096add8
  5. 03 4月, 2007 1 次提交
  6. 15 2月, 2007 1 次提交
    • 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
  7. 13 2月, 2007 1 次提交
  8. 27 9月, 2006 1 次提交
  9. 27 6月, 2006 4 次提交
  10. 29 3月, 2006 1 次提交
  11. 09 1月, 2006 1 次提交
  12. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4