1. 06 11月, 2014 1 次提交
  2. 09 10月, 2014 1 次提交
  3. 09 8月, 2014 1 次提交
    • A
      proc: add and remove /proc entry create checks · dbcdb504
      Alexey Dobriyan 提交于
      * remove proc_create(NULL, ...) check, let it oops
      
      * warn about proc_create("", ...) and proc_create("very very long name", ...)
        proc code keeps length as u8, no 256+ name length possible
      
      * warn about proc_create("123", ...)
        /proc/$PID and /proc/misc namespaces are separate things,
        but dumb module might create funky a-la $PID entry.
      
      * remove post mortem strchr('/') check
        Triggering it implies either strchr() is buggy or memory corruption.
        It should be VFS check anyway.
      
      In reality, none of these checks will ever trigger,
      it is preparation for the next patch.
      
      Based on patch from Al Viro.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dbcdb504
  4. 08 4月, 2014 1 次提交
    • A
      proc: show mnt_id in /proc/pid/fdinfo · 49d063cb
      Andrey Vagin 提交于
      Currently we don't have a way how to determing from which mount point
      file has been opened.  This information is required for proper dumping
      and restoring file descriptos due to presence of mount namespaces.  It's
      possible, that two file descriptors are opened using the same paths, but
      one fd references mount point from one namespace while the other fd --
      from other namespace.
      
      $ ls -l /proc/1/fd/1
      lrwx------ 1 root root 64 Mar 19 23:54 /proc/1/fd/1 -> /dev/null
      
      $ cat /proc/1/fdinfo/1
      pos:	0
      flags:	0100002
      mnt_id:	16
      
      $ cat /proc/1/mountinfo | grep ^16
      16 32 0:4 / /dev rw,nosuid shared:2 - devtmpfs devtmpfs rw,size=1013356k,nr_inodes=253339,mode=755
      Signed-off-by: NAndrey Vagin <avagin@openvz.org>
      Acked-by: NPavel Emelyanov <xemul@parallels.com>
      Acked-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Cc: Rob Landley <rob@landley.net>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Oleg Nesterov <oleg@redhat.com>
      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>
      49d063cb
  5. 12 9月, 2013 1 次提交
    • O
      proc: make proc_fd_permission() thread-friendly · 96d0df79
      Oleg Nesterov 提交于
      proc_fd_permission() says "process can still access /proc/self/fd after it
      has executed a setuid()", but the "task_pid() = proc_pid() check only
      helps if the task is group leader, /proc/self points to
      /proc/<leader-pid>.
      
      Change this check to use task_tgid() so that the whole thread group can
      access its /proc/self/fd or /proc/<tid-of-sub-thread>/fd.
      
      Notes:
      	- CLONE_THREAD does not require CLONE_FILES so task->files
      	  can differ, but I don't think this can lead to any security
      	  problem. And this matches same_thread_group() in
      	  __ptrace_may_access().
      
      	- /proc/self should probably point to /proc/<thread-tid>, but
      	  it is too late to change the rules. Perhaps it makes sense
      	  to add /proc/thread though.
      
      Test-case:
      
      	void *tfunc(void *arg)
      	{
      		assert(opendir("/proc/self/fd"));
      		return NULL;
      	}
      
      	int main(void)
      	{
      		pthread_t t;
      		pthread_create(&t, NULL, tfunc, NULL);
      		pthread_join(t, NULL);
      		return 0;
      	}
      
      fails if, say, this executable is not readable and suid_dumpable = 0.
      Signed-off-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96d0df79
  6. 25 8月, 2013 1 次提交
  7. 29 6月, 2013 2 次提交
  8. 18 12月, 2012 1 次提交
    • C
      procfs: add ability to plug in auxiliary fdinfo providers · 55985dd7
      Cyrill Gorcunov 提交于
      This patch brings ability to print out auxiliary data associated with
      file in procfs interface /proc/pid/fdinfo/fd.
      
      In particular further patches make eventfd, evenpoll, signalfd and
      fsnotify to print additional information complete enough to restore
      these objects after checkpoint.
      
      To simplify the code we add show_fdinfo callback inside struct
      file_operations (as Al and Pavel are proposing).
      Signed-off-by: NCyrill Gorcunov <gorcunov@openvz.org>
      Acked-by: NPavel Emelyanov <xemul@parallels.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Andrey Vagin <avagin@openvz.org>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: James Bottomley <jbottomley@parallels.com>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: Matthew Helsley <matt.helsley@gmail.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      55985dd7
  9. 27 9月, 2012 3 次提交