<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc, branch v3.9</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/proc?h=v3.9</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/proc?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-12T12:18:43Z</updated>
<entry>
<title>kthread: Prevent unpark race which puts threads on the wrong cpu</title>
<updated>2013-04-12T12:18:43Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-04-09T07:33:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f2530dc71cf0822f90bb63ea4600caaef33a66bb'/>
<id>urn:sha1:f2530dc71cf0822f90bb63ea4600caaef33a66bb</id>
<content type='text'>
The smpboot threads rely on the park/unpark mechanism which binds per
cpu threads on a particular core. Though the functionality is racy:

CPU0	       	 	CPU1  	     	    CPU2
unpark(T)				    wake_up_process(T)
  clear(SHOULD_PARK)	T runs
			leave parkme() due to !SHOULD_PARK  
  bind_to(CPU2)		BUG_ON(wrong CPU)						    

We cannot let the tasks move themself to the target CPU as one of
those tasks is actually the migration thread itself, which requires
that it starts running on the target cpu right away.

The solution to this problem is to prevent wakeups in park mode which
are not from unpark(). That way we can guarantee that the association
of the task to the target cpu is working correctly.

Add a new task state (TASK_PARKED) which prevents other wakeups and
use this state explicitly for the unpark wakeup.

Peter noticed: Also, since the task state is visible to userspace and
all the parked tasks are still in the PID space, its a good hint in ps
and friends that these tasks aren't really there for the moment.

The migration thread has another related issue.

CPU0	      	     	 CPU1
Bring up CPU2
create_thread(T)
park(T)
 wait_for_completion()
			 parkme()
			 complete()
sched_set_stop_task()
			 schedule(TASK_PARKED)

The sched_set_stop_task() call is issued while the task is on the
runqueue of CPU1 and that confuses the hell out of the stop_task class
on that cpu. So we need the same synchronizaion before
sched_set_stop_task().

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Reported-and-tested-by: Dave Hansen &lt;dave@sr71.net&gt;
Reported-and-tested-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: Peter Ziljstra &lt;peterz@infradead.org&gt;
Cc: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Cc: dhillf@gmail.com
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1304091635430.21884@ionos
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2013-04-09T19:22:49Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-04-09T19:22:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e8f2b548de7ae65e17ee911e54712a3f26f69c60'/>
<id>urn:sha1:e8f2b548de7ae65e17ee911e54712a3f26f69c60</id>
<content type='text'>
Pull vfs fixes from Al Viro:
 "A nasty bug in fs/namespace.c caught by Andrey + a couple of less
  serious unpleasantness - ecryptfs misc device playing hopeless games
  with try_module_get() and palinfo procfs support being...  not quite
  correctly done, to be polite."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  mnt: release locks on error path in do_loopback
  palinfo fixes
  procfs: add proc_remove_subtree()
  ecryptfs: close rmmod race
</content>
</entry>
<entry>
<title>procfs: add proc_remove_subtree()</title>
<updated>2013-04-09T18:09:17Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-31T00:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8ce584c7416d8a85a6f3edc17d1cddefe331e87e'/>
<id>urn:sha1:8ce584c7416d8a85a6f3edc17d1cddefe331e87e</id>
<content type='text'>
just what it sounds like; do that only to procfs subtrees you've
created - doing that to something shared with another driver is
not only antisocial, but might cause interesting races with
proc_create() and its ilk.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace</title>
<updated>2013-03-28T20:43:46Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-03-28T20:43:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2c3de1c2d7d68c6ba4c1ecd82c68285f34d9609e'/>
<id>urn:sha1:2c3de1c2d7d68c6ba4c1ecd82c68285f34d9609e</id>
<content type='text'>
Pull userns fixes from Eric W Biederman:
 "The bulk of the changes are fixing the worst consequences of the user
  namespace design oversight in not considering what happens when one
  namespace starts off as a clone of another namespace, as happens with
  the mount namespace.

  The rest of the changes are just plain bug fixes.

  Many thanks to Andy Lutomirski for pointing out many of these issues."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  userns: Restrict when proc and sysfs can be mounted
  ipc: Restrict mounting the mqueue filesystem
  vfs: Carefully propogate mounts across user namespaces
  vfs: Add a mount flag to lock read only bind mounts
  userns:  Don't allow creation if the user is chrooted
  yama:  Better permission check for ptraceme
  pid: Handle the exit of a multi-threaded init.
  scm: Require CAP_SYS_ADMIN over the current pidns to spoof pids.
</content>
</entry>
<entry>
<title>userns: Restrict when proc and sysfs can be mounted</title>
<updated>2013-03-27T14:50:08Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2013-03-24T21:28:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=87a8ebd637dafc255070f503909a053cf0d98d3f'/>
<id>urn:sha1:87a8ebd637dafc255070f503909a053cf0d98d3f</id>
<content type='text'>
Only allow unprivileged mounts of proc and sysfs if they are already
mounted when the user namespace is created.

proc and sysfs are interesting because they have content that is
per namespace, and so fresh mounts are needed when new namespaces
are created while at the same time proc and sysfs have content that
is shared between every instance.

Respect the policy of who may see the shared content of proc and sysfs
by only allowing new mounts if there was an existing mount at the time
the user namespace was created.

In practice there are only two interesting cases: proc and sysfs are
mounted at their usual places, proc and sysfs are not mounted at all
(some form of mount namespace jail).

Cc: stable@vger.kernel.org
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>vfs,proc: guarantee unique inodes in /proc</title>
<updated>2013-03-22T18:44:04Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-03-22T18:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51f0885e5415b4cc6535e9cdcc5145bfbc134353'/>
<id>urn:sha1:51f0885e5415b4cc6535e9cdcc5145bfbc134353</id>
<content type='text'>
Dave Jones found another /proc issue with his Trinity tool: thanks to
the namespace model, we can have multiple /proc dentries that point to
the same inode, aliasing directories in /proc/&lt;pid&gt;/net/ for example.

This ends up being a total disaster, because it acts like hardlinked
directories, and causes locking problems.  We rely on the topological
sort of the inodes pointed to by dentries, and if we have aliased
directories, that odering becomes unreliable.

In short: don't do this.  Multiple dentries with the same (directory)
inode is just a bad idea, and the namespace code should never have
exposed things this way.  But we're kind of stuck with it.

This solves things by just always allocating a new inode during /proc
dentry lookup, instead of using "iget_locked()" to look up existing
inodes by superblock and number.  That actually simplies the code a bit,
at the cost of potentially doing more inode [de]allocations.

That said, the inode lookup wasn't free either (and did a lot of locking
of inodes), so it is probably not that noticeable.  We could easily keep
the old lookup model for non-directory entries, but rather than try to
be excessively clever this just implements the minimal and simplest
workaround for the problem.

Reported-and-tested-by: Dave Jones &lt;davej@redhat.com&gt;
Analyzed-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: Use nd_jump_link in proc_ns_follow_link</title>
<updated>2013-03-09T08:14:45Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2013-03-09T08:14:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db04dc679bcc780ad6907943afe24a30de974a1b'/>
<id>urn:sha1:db04dc679bcc780ad6907943afe24a30de974a1b</id>
<content type='text'>
Update proc_ns_follow_link to use nd_jump_link instead of just
manually updating nd.path.dentry.

This fixes the BUG_ON(nd-&gt;inode != parent-&gt;d_inode) reported by Dave
Jones and reproduced trivially with mkdir /proc/self/ns/uts/a.

Sigh it looks like the VFS change to require use of nd_jump_link
happend while proc_ns_follow_link was baking and since the common case
of proc_ns_follow_link continued to work without problems the need for
making this change was overlooked.

Cc: stable@vger.kernel.org
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
</content>
</entry>
<entry>
<title>fs/proc/vmcore.c: put if tests in the top of the while loop to reduce duplication</title>
<updated>2013-02-28T03:10:11Z</updated>
<author>
<name>Zhang Yanfei</name>
<email>zhangyanfei@cn.fujitsu.com</email>
</author>
<published>2013-02-28T01:03:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c2c1b089b44b783bd50fae4bccaa6f367f92e492'/>
<id>urn:sha1:c2c1b089b44b783bd50fae4bccaa6f367f92e492</id>
<content type='text'>
In read_vmcore() two `if' tests are duplicated.  Change the position of
them could reduce the duplication.  This change does not affect the
behaviour of the function.

[akpm@linux-foundation.org: avoid `if (foo = bar)' thing, use min_t()]
[akpm@linux-foundation.org: s/max_t/min_t/]
Signed-off-by: Zhang Yanfei &lt;zhangyanfei@cn.fujitsu.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/proc: clean up printks</title>
<updated>2013-02-28T03:10:11Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2013-02-28T01:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=87ebdc00eeb474615496d5f10eed46709e25c707'/>
<id>urn:sha1:87ebdc00eeb474615496d5f10eed46709e25c707</id>
<content type='text'>
- use pr_foo() throughout

- remove a couple of duplicated KERN_WARNINGs, via WARN(KERN_WARNING "...")

- nuke a few warnings which I've never seen happen, ever.

Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>coredump: remove redundant defines for dumpable states</title>
<updated>2013-02-28T03:10:11Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2013-02-28T01:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e579d2c259be42b6f29458327e5153b22414b031'/>
<id>urn:sha1:e579d2c259be42b6f29458327e5153b22414b031</id>
<content type='text'>
The existing SUID_DUMP_* defines duplicate the newer SUID_DUMPABLE_*
defines introduced in 54b501992dd2 ("coredump: warn about unsafe
suid_dumpable / core_pattern combo").  Remove the new ones, and use the
prior values instead.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reported-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Doug Ledford &lt;dledford@redhat.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: James Morris &lt;james.l.morris@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
