<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs, branch v3.10.76</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>dcache: Fix locking bugs in backported "deal with deadlock in d_walk()"</title>
<updated>2015-04-29T08:34:02+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2015-02-11T03:16:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c190d250d8db5620218d5d56999580ed8488ec24'/>
<id>c190d250d8db5620218d5d56999580ed8488ec24</id>
<content type='text'>
commit 20defcec264ceab2630356fb9d397f3d237b5e6d upstream in 3.2-stable

Steven Rostedt reported:
&gt; Porting -rt to the latest 3.2 stable tree I triggered this bug:
&gt;
&gt; =====================================
&gt; [ BUG: bad unlock balance detected! ]
&gt; -------------------------------------
&gt; rm/1638 is trying to release lock (rcu_read_lock) at:
&gt; [&lt;c04fde6c&gt;] rcu_read_unlock+0x0/0x23
&gt; but there are no more locks to release!
&gt;
&gt; other info that might help us debug this:
&gt; 2 locks held by rm/1638:
&gt;  #0:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9/1){+.+.+.}, at: [&lt;c04f93eb&gt;] do_rmdir+0x5f/0xd2
&gt;  #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;c04f9329&gt;] vfs_rmdir+0x49/0xac
&gt;
&gt; stack backtrace:
&gt; Pid: 1638, comm: rm Not tainted 3.2.66-test-rt96+ #2
&gt; Call Trace:
&gt;  [&lt;c083f390&gt;] ? printk+0x1d/0x1f
&gt;  [&lt;c0463cdf&gt;] print_unlock_inbalance_bug+0xc3/0xcd
&gt;  [&lt;c04653a8&gt;] lock_release_non_nested+0x98/0x1ec
&gt;  [&lt;c046228d&gt;] ? trace_hardirqs_off_caller+0x18/0x90
&gt;  [&lt;c0456f1c&gt;] ? local_clock+0x2d/0x50
&gt;  [&lt;c04fde6c&gt;] ? d_hash+0x2f/0x2f
&gt;  [&lt;c04fde6c&gt;] ? d_hash+0x2f/0x2f
&gt;  [&lt;c046568e&gt;] lock_release+0x192/0x1ad
&gt;  [&lt;c04fde83&gt;] rcu_read_unlock+0x17/0x23
&gt;  [&lt;c04ff344&gt;] shrink_dcache_parent+0x227/0x270
&gt;  [&lt;c04f9348&gt;] vfs_rmdir+0x68/0xac
&gt;  [&lt;c04f9424&gt;] do_rmdir+0x98/0xd2
&gt;  [&lt;c04f03ad&gt;] ? fput+0x1a3/0x1ab
&gt;  [&lt;c084dd42&gt;] ? sysenter_exit+0xf/0x1a
&gt;  [&lt;c0465b58&gt;] ? trace_hardirqs_on_caller+0x118/0x149
&gt;  [&lt;c04fa3e0&gt;] sys_unlinkat+0x2b/0x35
&gt;  [&lt;c084dd13&gt;] sysenter_do_call+0x12/0x12
&gt;
&gt;
&gt;
&gt;
&gt; There's a path to calling rcu_read_unlock() without calling
&gt; rcu_read_lock() in have_submounts().
&gt;
&gt; 	goto positive;
&gt;
&gt; positive:
&gt; 	if (!locked &amp;&amp; read_seqretry(&amp;rename_lock, seq))
&gt; 		goto rename_retry;
&gt;
&gt; rename_retry:
&gt; 	rcu_read_unlock();
&gt;
&gt; in the above path, rcu_read_lock() is never done before calling
&gt; rcu_read_unlock();

I reviewed locking contexts in all three functions that I changed when
backporting "deal with deadlock in d_walk()".  It's actually worse
than this:

- We don't hold this_parent-&gt;d_lock at the 'positive' label in
  have_submounts(), but it is unlocked after 'rename_retry'.
- There is an rcu_read_unlock() after the 'out' label in
  select_parent(), but it's not held at the 'goto out'.

Fix all three lock imbalances.

Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Tested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 20defcec264ceab2630356fb9d397f3d237b5e6d upstream in 3.2-stable

Steven Rostedt reported:
&gt; Porting -rt to the latest 3.2 stable tree I triggered this bug:
&gt;
&gt; =====================================
&gt; [ BUG: bad unlock balance detected! ]
&gt; -------------------------------------
&gt; rm/1638 is trying to release lock (rcu_read_lock) at:
&gt; [&lt;c04fde6c&gt;] rcu_read_unlock+0x0/0x23
&gt; but there are no more locks to release!
&gt;
&gt; other info that might help us debug this:
&gt; 2 locks held by rm/1638:
&gt;  #0:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9/1){+.+.+.}, at: [&lt;c04f93eb&gt;] do_rmdir+0x5f/0xd2
&gt;  #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#9){+.+.+.}, at: [&lt;c04f9329&gt;] vfs_rmdir+0x49/0xac
&gt;
&gt; stack backtrace:
&gt; Pid: 1638, comm: rm Not tainted 3.2.66-test-rt96+ #2
&gt; Call Trace:
&gt;  [&lt;c083f390&gt;] ? printk+0x1d/0x1f
&gt;  [&lt;c0463cdf&gt;] print_unlock_inbalance_bug+0xc3/0xcd
&gt;  [&lt;c04653a8&gt;] lock_release_non_nested+0x98/0x1ec
&gt;  [&lt;c046228d&gt;] ? trace_hardirqs_off_caller+0x18/0x90
&gt;  [&lt;c0456f1c&gt;] ? local_clock+0x2d/0x50
&gt;  [&lt;c04fde6c&gt;] ? d_hash+0x2f/0x2f
&gt;  [&lt;c04fde6c&gt;] ? d_hash+0x2f/0x2f
&gt;  [&lt;c046568e&gt;] lock_release+0x192/0x1ad
&gt;  [&lt;c04fde83&gt;] rcu_read_unlock+0x17/0x23
&gt;  [&lt;c04ff344&gt;] shrink_dcache_parent+0x227/0x270
&gt;  [&lt;c04f9348&gt;] vfs_rmdir+0x68/0xac
&gt;  [&lt;c04f9424&gt;] do_rmdir+0x98/0xd2
&gt;  [&lt;c04f03ad&gt;] ? fput+0x1a3/0x1ab
&gt;  [&lt;c084dd42&gt;] ? sysenter_exit+0xf/0x1a
&gt;  [&lt;c0465b58&gt;] ? trace_hardirqs_on_caller+0x118/0x149
&gt;  [&lt;c04fa3e0&gt;] sys_unlinkat+0x2b/0x35
&gt;  [&lt;c084dd13&gt;] sysenter_do_call+0x12/0x12
&gt;
&gt;
&gt;
&gt;
&gt; There's a path to calling rcu_read_unlock() without calling
&gt; rcu_read_lock() in have_submounts().
&gt;
&gt; 	goto positive;
&gt;
&gt; positive:
&gt; 	if (!locked &amp;&amp; read_seqretry(&amp;rename_lock, seq))
&gt; 		goto rename_retry;
&gt;
&gt; rename_retry:
&gt; 	rcu_read_unlock();
&gt;
&gt; in the above path, rcu_read_lock() is never done before calling
&gt; rcu_read_unlock();

I reviewed locking contexts in all three functions that I changed when
backporting "deal with deadlock in d_walk()".  It's actually worse
than this:

- We don't hold this_parent-&gt;d_lock at the 'positive' label in
  have_submounts(), but it is unlocked after 'rename_retry'.
- There is an rcu_read_unlock() after the 'out' label in
  select_parent(), but it's not held at the 'goto out'.

Fix all three lock imbalances.

Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Tested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>deal with deadlock in d_walk()</title>
<updated>2015-04-29T08:34:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-10-26T23:31:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5f03ac13d87590b0ee879c77e68df63a3d9b3e07'/>
<id>5f03ac13d87590b0ee879c77e68df63a3d9b3e07</id>
<content type='text'>
commit ca5358ef75fc69fee5322a38a340f5739d997c10 upstream.

... by not hitting rename_retry for reasons other than rename having
happened.  In other words, do _not_ restart when finding that
between unlocking the child and locking the parent the former got
into __dentry_kill().  Skip the killed siblings instead...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[hujianyang: Backported to 3.10 refer to the work of Ben Hutchings in 3.2:
 - As we only have try_to_ascend() and not d_walk(), apply this
   change to all callers of try_to_ascend()
 - Adjust context to make __dentry_kill() apply to d_kill()]
Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ca5358ef75fc69fee5322a38a340f5739d997c10 upstream.

... by not hitting rename_retry for reasons other than rename having
happened.  In other words, do _not_ restart when finding that
between unlocking the child and locking the parent the former got
into __dentry_kill().  Skip the killed siblings instead...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[hujianyang: Backported to 3.10 refer to the work of Ben Hutchings in 3.2:
 - As we only have try_to_ascend() and not d_walk(), apply this
   change to all callers of try_to_ascend()
 - Adjust context to make __dentry_kill() apply to d_kill()]
Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>move d_rcu from overlapping d_child to overlapping d_alias</title>
<updated>2015-04-29T08:34:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-10-26T23:19:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6637ecd306a94a03dd5b8e4e8d3f260d9877c5b0'/>
<id>6637ecd306a94a03dd5b8e4e8d3f260d9877c5b0</id>
<content type='text'>
commit 946e51f2bf37f1656916eb75bd0742ba33983c28 upstream.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[hujianyang: Backported to 3.10 refer to the work of Ben Hutchings in 3.2:
 - Apply name changes in all the different places we use d_alias and d_child
 - Move the WARN_ON() in __d_free() to d_free() as we don't have dentry_free()]
Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 946e51f2bf37f1656916eb75bd0742ba33983c28 upstream.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[hujianyang: Backported to 3.10 refer to the work of Ben Hutchings in 3.2:
 - Apply name changes in all the different places we use d_alias and d_child
 - Move the WARN_ON() in __d_free() to d_free() as we don't have dentry_free()]
Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>splice: Apply generic position and size checks to each write</title>
<updated>2015-04-29T08:33:57+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2015-01-29T02:50:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=13d32f27d15c5c53254ed88e3d2042c34de1bfaa'/>
<id>13d32f27d15c5c53254ed88e3d2042c34de1bfaa</id>
<content type='text'>
commit 894c6350eaad7e613ae267504014a456e00a3e2a from the 3.2-stable branch.

We need to check the position and size of file writes against various
limits, using generic_write_check().  This was not being done for
the splice write path.  It was fixed upstream by commit 8d0207652cbe
("-&gt;splice_write() via -&gt;write_iter()") but we can't apply that.

CVE-2014-7822

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[Ben fixed it in 3.2 stable, i ported it to 3.10 stable]
Signed-off-by: Zhang Zhen &lt;zhenzhang.zhang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 894c6350eaad7e613ae267504014a456e00a3e2a from the 3.2-stable branch.

We need to check the position and size of file writes against various
limits, using generic_write_check().  This was not being done for
the splice write path.  It was fixed upstream by commit 8d0207652cbe
("-&gt;splice_write() via -&gt;write_iter()") but we can't apply that.

CVE-2014-7822

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[Ben fixed it in 3.2 stable, i ported it to 3.10 stable]
Signed-off-by: Zhang Zhen &lt;zhenzhang.zhang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>jfs: fix readdir regression</title>
<updated>2015-04-29T08:33:57+00:00</updated>
<author>
<name>Dave Kleikamp</name>
<email>dave.kleikamp@oracle.com</email>
</author>
<published>2015-03-23T21:06:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ca630d975c5abb422ef7969494cacd91a1c125a'/>
<id>1ca630d975c5abb422ef7969494cacd91a1c125a</id>
<content type='text'>
Upstream commit 44512449, "jfs: fix readdir cookie incompatibility
with NFSv4", was backported incorrectly into the stable trees which
used the filldir callback (rather than dir_emit). The position is
being incorrectly passed to filldir for the . and .. entries.

The still-maintained stable trees that need to be fixed are 3.2.y,
3.4.y and 3.10.y.

https://bugzilla.kernel.org/show_bug.cgi?id=94741

Signed-off-by: Dave Kleikamp &lt;dave.kleikamp@oracle.com&gt;
Cc: jfs-discussion@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream commit 44512449, "jfs: fix readdir cookie incompatibility
with NFSv4", was backported incorrectly into the stable trees which
used the filldir callback (rather than dir_emit). The position is
being incorrectly passed to filldir for the . and .. entries.

The still-maintained stable trees that need to be fixed are 3.2.y,
3.4.y and 3.10.y.

https://bugzilla.kernel.org/show_bug.cgi?id=94741

Signed-off-by: Dave Kleikamp &lt;dave.kleikamp@oracle.com&gt;
Cc: jfs-discussion@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>remove extra definitions of U32_MAX</title>
<updated>2015-04-29T08:33:54+00:00</updated>
<author>
<name>Alex Elder</name>
<email>alex.elder@linaro.org</email>
</author>
<published>2014-01-23T23:54:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1554b19c4080476e4e5b678febd5fc7f2d102322'/>
<id>1554b19c4080476e4e5b678febd5fc7f2d102322</id>
<content type='text'>
commit 04f9b74e4d96d349de12fdd4e6626af4a9f75e09 upstream.

Now that the definition is centralized in &lt;linux/kernel.h&gt;, the
definitions of U32_MAX (and related) elsewhere in the kernel can be
removed.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Acked-by: Sage Weil &lt;sage@inktank.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 04f9b74e4d96d349de12fdd4e6626af4a9f75e09 upstream.

Now that the definition is centralized in &lt;linux/kernel.h&gt;, the
definitions of U32_MAX (and related) elsewhere in the kernel can be
removed.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Acked-by: Sage Weil &lt;sage@inktank.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&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;

</pre>
</div>
</content>
</entry>
<entry>
<title>conditionally define U32_MAX</title>
<updated>2015-04-29T08:33:54+00:00</updated>
<author>
<name>Alex Elder</name>
<email>alex.elder@linaro.org</email>
</author>
<published>2014-01-23T23:53:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b81036aa3558b934e2ea17e93e637f99796d88a0'/>
<id>b81036aa3558b934e2ea17e93e637f99796d88a0</id>
<content type='text'>
commit 77719536dc00f8fd8f5abe6dadbde5331c37f996 upstream.

The symbol U32_MAX is defined in several spots.  Change these
definitions to be conditional.  This is in preparation for the next
patch, which centralizes the definition in &lt;linux/kernel.h&gt;.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Cc: Sage Weil &lt;sage@inktank.com&gt;
Cc: David Miller &lt;davem@davemloft.net&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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 77719536dc00f8fd8f5abe6dadbde5331c37f996 upstream.

The symbol U32_MAX is defined in several spots.  Change these
definitions to be conditional.  This is in preparation for the next
patch, which centralizes the definition in &lt;linux/kernel.h&gt;.

Signed-off-by: Alex Elder &lt;elder@linaro.org&gt;
Cc: Sage Weil &lt;sage@inktank.com&gt;
Cc: David Miller &lt;davem@davemloft.net&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;

</pre>
</div>
</content>
</entry>
<entry>
<title>pagemap: do not leak physical addresses to non-privileged userspace</title>
<updated>2015-04-19T08:10:51+00:00</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2015-03-09T21:11:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e11b708502b0e249772e485585bec44be5fe8c70'/>
<id>e11b708502b0e249772e485585bec44be5fe8c70</id>
<content type='text'>
commit ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce upstream.

As pointed by recent post[1] on exploiting DRAM physical imperfection,
/proc/PID/pagemap exposes sensitive information which can be used to do
attacks.

This disallows anybody without CAP_SYS_ADMIN to read the pagemap.

[1] http://googleprojectzero.blogspot.com/2015/03/exploiting-dram-rowhammer-bug-to-gain.html

[ Eventually we might want to do anything more finegrained, but for now
  this is the simple model.   - Linus ]

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Acked-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Acked-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Mark Seaborn &lt;mseaborn@chromium.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: mancha security &lt;mancha1@zoho.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce upstream.

As pointed by recent post[1] on exploiting DRAM physical imperfection,
/proc/PID/pagemap exposes sensitive information which can be used to do
attacks.

This disallows anybody without CAP_SYS_ADMIN to read the pagemap.

[1] http://googleprojectzero.blogspot.com/2015/03/exploiting-dram-rowhammer-bug-to-gain.html

[ Eventually we might want to do anything more finegrained, but for now
  this is the simple model.   - Linus ]

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Acked-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Acked-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Mark Seaborn &lt;mseaborn@chromium.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: mancha security &lt;mancha1@zoho.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ocfs2: _really_ sync the right range</title>
<updated>2015-04-19T08:10:50+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2015-04-08T21:00:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f3326a5594dbb8faf47fb105740baa936d3445d1'/>
<id>f3326a5594dbb8faf47fb105740baa936d3445d1</id>
<content type='text'>
commit 64b4e2526d1cf6e6a4db6213d6e2b6e6ab59479a upstream.

"ocfs2 syncs the wrong range" had been broken; prior to it the
code was doing the wrong thing in case of O_APPEND, all right,
but _after_ it we were syncing the wrong range in 100% cases.
*ppos, aka iocb-&gt;ki_pos is incremented prior to that point,
so we are always doing sync on the area _after_ the one we'd
written to.

Spotted by Joseph Qi &lt;joseph.qi@huawei.com&gt; back in January;
unfortunately, I'd missed his mail back then ;-/

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 64b4e2526d1cf6e6a4db6213d6e2b6e6ab59479a upstream.

"ocfs2 syncs the wrong range" had been broken; prior to it the
code was doing the wrong thing in case of O_APPEND, all right,
but _after_ it we were syncing the wrong range in 100% cases.
*ppos, aka iocb-&gt;ki_pos is incremented prior to that point,
so we are always doing sync on the area _after_ the one we'd
written to.

Spotted by Joseph Qi &lt;joseph.qi@huawei.com&gt; back in January;
unfortunately, I'd missed his mail back then ;-/

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>cifs: fix use-after-free bug in find_writable_file</title>
<updated>2015-04-19T08:10:50+00:00</updated>
<author>
<name>David Disseldorp</name>
<email>ddiss@suse.de</email>
</author>
<published>2015-03-13T13:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=57cf01ac9ff841958cbed2b727c271ab420b0ffa'/>
<id>57cf01ac9ff841958cbed2b727c271ab420b0ffa</id>
<content type='text'>
commit e1e9bda22d7ddf88515e8fe401887e313922823e upstream.

Under intermittent network outages, find_writable_file() is susceptible
to the following race condition, which results in a user-after-free in
the cifs_writepages code-path:

Thread 1                                        Thread 2
========                                        ========

inv_file = NULL
refind = 0
spin_lock(&amp;cifs_file_list_lock)

// invalidHandle found on openFileList

inv_file = open_file
// inv_file-&gt;count currently 1

cifsFileInfo_get(inv_file)
// inv_file-&gt;count = 2

spin_unlock(&amp;cifs_file_list_lock);

cifs_reopen_file()                            cifs_close()
// fails (rc != 0)                            -&gt;cifsFileInfo_put()
                                       spin_lock(&amp;cifs_file_list_lock)
                                       // inv_file-&gt;count = 1
                                       spin_unlock(&amp;cifs_file_list_lock)

spin_lock(&amp;cifs_file_list_lock);
list_move_tail(&amp;inv_file-&gt;flist,
      &amp;cifs_inode-&gt;openFileList);
spin_unlock(&amp;cifs_file_list_lock);

cifsFileInfo_put(inv_file);
-&gt;spin_lock(&amp;cifs_file_list_lock)

  // inv_file-&gt;count = 0
  list_del(&amp;cifs_file-&gt;flist);
  // cleanup!!
  kfree(cifs_file);

  spin_unlock(&amp;cifs_file_list_lock);

spin_lock(&amp;cifs_file_list_lock);
++refind;
// refind = 1
goto refind_writable;

At this point we loop back through with an invalid inv_file pointer
and a refind value of 1. On second pass, inv_file is not overwritten on
openFileList traversal, and is subsequently dereferenced.

Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
Reviewed-by: Jeff Layton &lt;jlayton@samba.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e1e9bda22d7ddf88515e8fe401887e313922823e upstream.

Under intermittent network outages, find_writable_file() is susceptible
to the following race condition, which results in a user-after-free in
the cifs_writepages code-path:

Thread 1                                        Thread 2
========                                        ========

inv_file = NULL
refind = 0
spin_lock(&amp;cifs_file_list_lock)

// invalidHandle found on openFileList

inv_file = open_file
// inv_file-&gt;count currently 1

cifsFileInfo_get(inv_file)
// inv_file-&gt;count = 2

spin_unlock(&amp;cifs_file_list_lock);

cifs_reopen_file()                            cifs_close()
// fails (rc != 0)                            -&gt;cifsFileInfo_put()
                                       spin_lock(&amp;cifs_file_list_lock)
                                       // inv_file-&gt;count = 1
                                       spin_unlock(&amp;cifs_file_list_lock)

spin_lock(&amp;cifs_file_list_lock);
list_move_tail(&amp;inv_file-&gt;flist,
      &amp;cifs_inode-&gt;openFileList);
spin_unlock(&amp;cifs_file_list_lock);

cifsFileInfo_put(inv_file);
-&gt;spin_lock(&amp;cifs_file_list_lock)

  // inv_file-&gt;count = 0
  list_del(&amp;cifs_file-&gt;flist);
  // cleanup!!
  kfree(cifs_file);

  spin_unlock(&amp;cifs_file_list_lock);

spin_lock(&amp;cifs_file_list_lock);
++refind;
// refind = 1
goto refind_writable;

At this point we loop back through with an invalid inv_file pointer
and a refind value of 1. On second pass, inv_file is not overwritten on
openFileList traversal, and is subsequently dereferenced.

Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
Reviewed-by: Jeff Layton &lt;jlayton@samba.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
