<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs, branch v3.4.72</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs?h=v3.4.72</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs?h=v3.4.72'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-12-04T18:50:30Z</updated>
<entry>
<title>ext4: avoid bh leak in retry path of ext4_expand_extra_isize_ea()</title>
<updated>2013-12-04T18:50:30Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-11-01T03:00:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dc51161bf8064f63470ee718843a1b4fd75d0bb5'/>
<id>urn:sha1:dc51161bf8064f63470ee718843a1b4fd75d0bb5</id>
<content type='text'>
commit dcb9917ba041866686fe152850364826c4622a36 upstream.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>devpts: plug the memory leak in kill_sb</title>
<updated>2013-12-04T18:50:14Z</updated>
<author>
<name>Ilija Hadzic</name>
<email>ihadzic@research.bell-labs.com</email>
</author>
<published>2013-11-12T23:11:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=510e627f364a15db3b0848de1429d15f1473b95e'/>
<id>urn:sha1:510e627f364a15db3b0848de1429d15f1473b95e</id>
<content type='text'>
commit 66da0e1f9034140ae2f571ef96e254a25083906c upstream.

When devpts is unmounted, there may be a no-longer-used IDR tree hanging
off the superblock we are about to kill.  This needs to be cleaned up
before destroying the SB.

The leak is usually not a big deal because unmounting devpts is typically
done when shutting down the whole machine.  However, shutting down an LXC
container instead of a physical machine exposes the problem (the garbage
is detectable with kmemleak).

Signed-off-by: Ilija Hadzic &lt;ihadzic@research.bell-labs.com&gt;
Cc: Sukadev Bhattiprolu &lt;sukadev@linux.vnet.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>configfs: fix race between dentry put and lookup</title>
<updated>2013-11-29T18:50:37Z</updated>
<author>
<name>Junxiao Bi</name>
<email>junxiao.bi@oracle.com</email>
</author>
<published>2013-11-21T22:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b4db55f32a9b0172a24fb52143f10609708c17ff'/>
<id>urn:sha1:b4db55f32a9b0172a24fb52143f10609708c17ff</id>
<content type='text'>
commit 76ae281f6307331aa063288edb6422ae99f435f0 upstream.

A race window in configfs, it starts from one dentry is UNHASHED and end
before configfs_d_iput is called.  In this window, if a lookup happen,
since the original dentry was UNHASHED, so a new dentry will be
allocated, and then in configfs_attach_attr(), sd-&gt;s_dentry will be
updated to the new dentry.  Then in configfs_d_iput(),
BUG_ON(sd-&gt;s_dentry != dentry) will be triggered and system panic.

sys_open:                     sys_close:
 ...                           fput
                                dput
                                 dentry_kill
                                  __d_drop &lt;--- dentry unhashed here,
                                           but sd-&gt;dentry still point
                                           to this dentry.

 lookup_real
  configfs_lookup
   configfs_attach_attr---&gt; update sd-&gt;s_dentry
                            to new allocated dentry here.

                                   d_kill
                                     configfs_d_iput &lt;--- BUG_ON(sd-&gt;s_dentry != dentry)
                                                     triggered here.

To fix it, change configfs_d_iput to not update sd-&gt;s_dentry if
sd-&gt;s_count &gt; 2, that means there are another dentry is using the sd
beside the one that is going to be put.  Use configfs_dirent_lock in
configfs_attach_attr to sync with configfs_d_iput.

With the following steps, you can reproduce the bug.

1. enable ocfs2, this will mount configfs at /sys/kernel/config and
   fill configure in it.

2. run the following script.
	while [ 1 ]; do cat /sys/kernel/config/cluster/$your_cluster_name/idle_timeout_ms &gt; /dev/null; done &amp;
	while [ 1 ]; do cat /sys/kernel/config/cluster/$your_cluster_name/idle_timeout_ms &gt; /dev/null; done &amp;

Signed-off-by: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: make sure to balance get/put_write_access</title>
<updated>2013-11-29T18:50:35Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2013-11-18T13:07:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=107bb3cc6b12d800f9949f5ecae808caae38a9f5'/>
<id>urn:sha1:107bb3cc6b12d800f9949f5ecae808caae38a9f5</id>
<content type='text'>
commit 987da4791052fa298b7cfcde4dea9f6f2bbc786b upstream.

Use a straight goto error label style in nfsd_setattr to make sure
we always do the put_write_access call after we got it earlier.

Note that the we have been failing to do that in the case
nfsd_break_lease() returns an error, a bug introduced into 2.6.38 with
6a76bebefe15d9a08864f824d7f8d5beaf37c997 "nfsd4: break lease on nfsd
setattr".

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: split up nfsd_setattr</title>
<updated>2013-11-29T18:50:35Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2013-11-18T13:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6ee4fd261478ff5eed6b83cb5a18421c01707ad3'/>
<id>urn:sha1:6ee4fd261478ff5eed6b83cb5a18421c01707ad3</id>
<content type='text'>
commit 818e5a22e907fbae75e9c1fd78233baec9fa64b6 upstream.

Split out two helpers to make the code more readable and easier to verify
for correctness.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>NFSv4: Fix a use-after-free situation in _nfs4_proc_getlk()</title>
<updated>2013-11-29T18:50:34Z</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2013-10-01T18:24:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1ac50b943ce53d5f8ce077240191fc50d0e84662'/>
<id>urn:sha1:1ac50b943ce53d5f8ce077240191fc50d0e84662</id>
<content type='text'>
commit a6f951ddbdfb7bd87d31a44f61abe202ed6ce57f upstream.

In nfs4_proc_getlk(), when some error causes a retry of the call to
_nfs4_proc_getlk(), we can end up with Oopses of the form

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000134
 IP: [&lt;ffffffff8165270e&gt;] _raw_spin_lock+0xe/0x30
&lt;snip&gt;
 Call Trace:
  [&lt;ffffffff812f287d&gt;] _atomic_dec_and_lock+0x4d/0x70
  [&lt;ffffffffa053c4f2&gt;] nfs4_put_lock_state+0x32/0xb0 [nfsv4]
  [&lt;ffffffffa053c585&gt;] nfs4_fl_release_lock+0x15/0x20 [nfsv4]
  [&lt;ffffffffa0522c06&gt;] _nfs4_proc_getlk.isra.40+0x146/0x170 [nfsv4]
  [&lt;ffffffffa052ad99&gt;] nfs4_proc_lock+0x399/0x5a0 [nfsv4]

The problem is that we don't clear the request-&gt;fl_ops after the first
try and so when we retry, nfs4_set_lock_state() exits early without
setting the lock stateid.
Regression introduced by commit 70cc6487a4e08b8698c0e2ec935fb48d10490162
(locks: make -&gt;lock release private data before returning in GETLK case)

Reported-by: Weston Andros Adamson &lt;dros@netapp.com&gt;
Reported-by: Jorge Mora &lt;mora@netapp.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>exec/ptrace: fix get_dumpable() incorrect tests</title>
<updated>2013-11-29T18:50:34Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2013-11-12T23:11:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c0d30628ff1b424f041d83fee37daea5f84eb0a2'/>
<id>urn:sha1:c0d30628ff1b424f041d83fee37daea5f84eb0a2</id>
<content type='text'>
commit d049f74f2dbe71354d43d393ac3a188947811348 upstream.

The get_dumpable() return value is not boolean.  Most users of the
function actually want to be testing for non-SUID_DUMP_USER(1) rather than
SUID_DUMP_DISABLE(0).  The SUID_DUMP_ROOT(2) is also considered a
protected state.  Almost all places did this correctly, excepting the two
places fixed in this patch.

Wrong logic:
    if (dumpable == SUID_DUMP_DISABLE) { /* be protective */ }
        or
    if (dumpable == 0) { /* be protective */ }
        or
    if (!dumpable) { /* be protective */ }

Correct logic:
    if (dumpable != SUID_DUMP_USER) { /* be protective */ }
        or
    if (dumpable != 1) { /* be protective */ }

Without this patch, if the system had set the sysctl fs/suid_dumpable=2, a
user was able to ptrace attach to processes that had dropped privileges to
that user.  (This may have been partially mitigated if Yama was enabled.)

The macros have been moved into the file that declares get/set_dumpable(),
which means things like the ia64 code can see them too.

CVE-2013-2929

Reported-by: Vasily Kulikov &lt;segoon@openwall.com&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: "Luck, Tony" &lt;tony.luck@intel.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>exec: do not abuse -&gt;cred_guard_mutex in threadgroup_lock()</title>
<updated>2013-11-29T18:50:33Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-04-30T22:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=df4011e050b4e80165a317424e6b3367dfa7697c'/>
<id>urn:sha1:df4011e050b4e80165a317424e6b3367dfa7697c</id>
<content type='text'>
commit e56fb2874015370e3b7f8d85051f6dce26051df9 upstream.

threadgroup_lock() takes signal-&gt;cred_guard_mutex to ensure that
thread_group_leader() is stable.  This doesn't look nice, the scope of
this lock in do_execve() is huge.

And as Dave pointed out this can lead to deadlock, we have the
following dependencies:

	do_execve:		cred_guard_mutex -&gt; i_mutex
	cgroup_mount:		i_mutex -&gt; cgroup_mutex
	attach_task_by_pid:	cgroup_mutex -&gt; cred_guard_mutex

Change de_thread() to take threadgroup_change_begin() around the
switch-the-leader code and change threadgroup_lock() to avoid
-&gt;cred_guard_mutex.

Note that de_thread() can't sleep with -&gt;group_rwsem held, this can
obviously deadlock with the exiting leader if the writer is active, so it
does threadgroup_change_end() before schedule().

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
[ zhj: adjust context ]
Signed-off-by: Zhao Hongjiang &lt;zhaohongjiang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Nest rename_lock inside vfsmount_lock</title>
<updated>2013-11-29T18:50:33Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-26T22:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1a9a8c2c61437bc8ab745c96af936196f4684495'/>
<id>urn:sha1:1a9a8c2c61437bc8ab745c96af936196f4684495</id>
<content type='text'>
commit 7ea600b5314529f9d1b9d6d3c41cb26fce6a7a4a upstream.

... lest we get livelocks between path_is_under() and d_path() and friends.

The thing is, wrt fairness lglocks are more similar to rwsems than to rwlocks;
it is possible to have thread B spin on attempt to take lock shared while thread
A is already holding it shared, if B is on lower-numbered CPU than A and there's
a thread C spinning on attempt to take the same lock exclusive.

As the result, we need consistent ordering between vfsmount_lock (lglock) and
rename_lock (seq_lock), even though everything that takes both is going to take
vfsmount_lock only shared.

Spotted-by: Brad Spengler &lt;spender@grsecurity.net&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
[ zhj: backport to 3.4:
  - Adjust context
  - s/&amp;vfsmount_lock/vfsmount_lock/]
Signed-off-by: Zhao Hongjiang &lt;zhaohongjiang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SUNRPC handle EKEYEXPIRED in call_refreshresult</title>
<updated>2013-11-29T18:50:32Z</updated>
<author>
<name>Andy Adamson</name>
<email>andros@netapp.com</email>
</author>
<published>2012-11-27T15:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=14384c7346f4d6480503b825a474006a654d50e2'/>
<id>urn:sha1:14384c7346f4d6480503b825a474006a654d50e2</id>
<content type='text'>
commit eb96d5c97b0825d542e9c4ba5e0a22b519355166 upstream.

Currently, when an RPCSEC_GSS context has expired or is non-existent
and the users (Kerberos) credentials have also expired or are non-existent,
the client receives the -EKEYEXPIRED error and tries to refresh the context
forever.  If an application is performing I/O, or other work against the share,
the application hangs, and the user is not prompted to refresh/establish their
credentials. This can result in a denial of service for other users.

Users are expected to manage their Kerberos credential lifetimes to mitigate
this issue.

Move the -EKEYEXPIRED handling into the RPC layer. Try tk_cred_retry number
of times to refresh the gss_context, and then return -EACCES to the application.

Signed-off-by: Andy Adamson &lt;andros@netapp.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - Drop change to nfs4_handle_reclaim_lease_error()]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
