<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git, branch v3.12.70</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.70</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.70'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-01-27T16:15:03Z</updated>
<entry>
<title>Linux 3.12.70</title>
<updated>2017-01-27T16:15:03Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2017-01-27T10:52:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d7f41d3b297086cd8a263eb3c8b5dd97b7e70a32'/>
<id>urn:sha1:d7f41d3b297086cd8a263eb3c8b5dd97b7e70a32</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tmpfs: clear S_ISGID when setting posix ACLs</title>
<updated>2017-01-27T16:15:02Z</updated>
<author>
<name>Gu Zheng</name>
<email>guzheng1@huawei.com</email>
</author>
<published>2017-01-09T01:34:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b0369e53c851f8cd87afd059d360a4f646840c8c'/>
<id>urn:sha1:b0369e53c851f8cd87afd059d360a4f646840c8c</id>
<content type='text'>
commit 497de07d89c1410d76a15bec2bb41f24a2a89f31 upstream.

This change was missed the tmpfs modification in In CVE-2016-7097
commit 073931017b49 ("posix_acl: Clear SGID bit when setting
file permissions")
It can test by xfstest generic/375, which failed to clear
setgid bit in the following test case on tmpfs:

  touch $testfile
  chown 100:100 $testfile
  chmod 2755 $testfile
  _runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx $testfile

Signed-off-by: Gu Zheng &lt;guzheng1@huawei.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>ocfs2: fix BUG_ON() in ocfs2_ci_checkpointed()</title>
<updated>2017-01-27T16:15:02Z</updated>
<author>
<name>Tariq Saeed</name>
<email>tariq.x.saeed@oracle.com</email>
</author>
<published>2015-09-04T22:44:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ded56d6d88168cb8cb46a50456929fb5f8aae600'/>
<id>urn:sha1:ded56d6d88168cb8cb46a50456929fb5f8aae600</id>
<content type='text'>
commit 3d46a44a0c01b15d385ccaae24b56f619613c256 upstream.

PID: 614    TASK: ffff882a739da580  CPU: 3   COMMAND: "ocfs2dc"
  #0 [ffff882ecc3759b0] machine_kexec at ffffffff8103b35d
  #1 [ffff882ecc375a20] crash_kexec at ffffffff810b95b5
  #2 [ffff882ecc375af0] oops_end at ffffffff815091d8
  #3 [ffff882ecc375b20] die at ffffffff8101868b
  #4 [ffff882ecc375b50] do_trap at ffffffff81508bb0
  #5 [ffff882ecc375ba0] do_invalid_op at ffffffff810165e5
  #6 [ffff882ecc375c40] invalid_op at ffffffff815116fb
     [exception RIP: ocfs2_ci_checkpointed+208]
     RIP: ffffffffa0a7e940  RSP: ffff882ecc375cf0  RFLAGS: 00010002
     RAX: 0000000000000001  RBX: 000000000000654b  RCX: ffff8812dc83f1f8
     RDX: 00000000000017d9  RSI: ffff8812dc83f1f8  RDI: ffffffffa0b2c318
     RBP: ffff882ecc375d20   R8: ffff882ef6ecfa60   R9: ffff88301f272200
     R10: 0000000000000000  R11: 0000000000000000  R12: ffffffffffffffff
     R13: ffff8812dc83f4f0  R14: 0000000000000000  R15: ffff8812dc83f1f8
     ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
  #7 [ffff882ecc375d28] ocfs2_check_meta_downconvert at ffffffffa0a7edbd [ocfs2]
  #8 [ffff882ecc375d38] ocfs2_unblock_lock at ffffffffa0a84af8 [ocfs2]
  #9 [ffff882ecc375dc8] ocfs2_process_blocked_lock at ffffffffa0a85285 [ocfs2]
assert is tripped because the tran is not checkpointed and the lock level is PR.

Some time ago, chmod command had been executed. As result, the following call
chain left the inode cluster lock in PR state, latter on causing the assert.
system_call_fastpath
  -&gt; my_chmod
   -&gt; sys_chmod
    -&gt; sys_fchmodat
     -&gt; notify_change
      -&gt; ocfs2_setattr
       -&gt; posix_acl_chmod
        -&gt; ocfs2_iop_set_acl
         -&gt; ocfs2_set_acl
          -&gt; ocfs2_acl_set_mode
Here is how.
1119 int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1120 {
1247         ocfs2_inode_unlock(inode, 1); &lt;&lt;&lt; WRONG thing to do.
..
1258         if (!status &amp;&amp; attr-&gt;ia_valid &amp; ATTR_MODE) {
1259                 status =  posix_acl_chmod(inode, inode-&gt;i_mode);

519 posix_acl_chmod(struct inode *inode, umode_t mode)
520 {
..
539         ret = inode-&gt;i_op-&gt;set_acl(inode, acl, ACL_TYPE_ACCESS);

287 int ocfs2_iop_set_acl(struct inode *inode, struct posix_acl *acl, ...
288 {
289         return ocfs2_set_acl(NULL, inode, NULL, type, acl, NULL, NULL);

224 int ocfs2_set_acl(handle_t *handle,
225                          struct inode *inode, ...
231 {
..
252                                 ret = ocfs2_acl_set_mode(inode, di_bh,
253                                                          handle, mode);

168 static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head ...
170 {
183         if (handle == NULL) {
                    &gt;&gt;&gt; BUG: inode lock not held in ex at this point &lt;&lt;&lt;
184                 handle = ocfs2_start_trans(OCFS2_SB(inode-&gt;i_sb),
185                                            OCFS2_INODE_UPDATE_CREDITS);

ocfs2_setattr.#1247 we unlock and at #1259 call posix_acl_chmod. When we reach
ocfs2_acl_set_mode.#181 and do trans, the inode cluster lock is not held in EX
mode (it should be). How this could have happended?

We are the lock master, were holding lock EX and have released it in
ocfs2_setattr.#1247.  Note that there are no holders of this lock at
this point.  Another node needs the lock in PR, and we downconvert from
EX to PR.  So the inode lock is PR when do the trans in
ocfs2_acl_set_mode.#184.  The trans stays in core (not flushed to disc).
Now another node want the lock in EX, downconvert thread gets kicked
(the one that tripped assert abovt), finds an unflushed trans but the
lock is not EX (it is PR).  If the lock was at EX, it would have flushed
the trans ocfs2_ci_checkpointed -&gt; ocfs2_start_checkpoint before
downconverting (to NULL) for the request.

ocfs2_setattr must not drop inode lock ex in this code path.  If it
does, takes it again before the trans, say in ocfs2_set_acl, another
cluster node can get in between, execute another setattr, overwriting
the one in progress on this node, resulting in a mode acl size combo
that is a mix of the two.

Orabug: 20189959
Signed-off-by: Tariq Saeed &lt;tariq.x.saeed@oracle.com&gt;
Reviewed-by: Mark Fasheh &lt;mfasheh@suse.de&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Joseph Qi &lt;joseph.qi@huawei.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: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>bnx2x: Correct ringparam estimate when DOWN</title>
<updated>2017-01-27T16:15:01Z</updated>
<author>
<name>Mintz, Yuval</name>
<email>Yuval.Mintz@cavium.com</email>
</author>
<published>2016-12-04T13:30:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=05dc5c8fcbd236d4100777fe8534b290c87d644b'/>
<id>urn:sha1:05dc5c8fcbd236d4100777fe8534b290c87d644b</id>
<content type='text'>
commit 65870fa77fd7f83d7be4ed924d47ed9e3831f434 upstream.

Until interface is up [and assuming ringparams weren't explicitly
configured] when queried for the size of its rings bnx2x would
claim they're the maximal size by default.
That is incorrect as by default the maximal number of buffers would
be equally divided between the various rx rings.

This prevents the user from actually setting the number of elements
on each rx ring to be of maximal size prior to transitioning the
interface into up state.

To fix this, make a rough estimation about the number of buffers.
It wouldn't always be accurate, but it would be much better than
current estimation and would allow users to increase number of
buffers during early initialization of the interface.

Reported-by: Seymour, Shane &lt;shane.seymour@hpe.com&gt;
Signed-off-by: Yuval Mintz &lt;Yuval.Mintz@cavium.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>serial: 8250_pci: Detach low-level driver during PCI error recovery</title>
<updated>2017-01-27T16:15:00Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
<email>krisman@linux.vnet.ibm.com</email>
</author>
<published>2016-11-28T21:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b6580bd986df184845960c3abe490ed378ee1216'/>
<id>urn:sha1:b6580bd986df184845960c3abe490ed378ee1216</id>
<content type='text'>
commit f209fa03fc9d131b3108c2e4936181eabab87416 upstream.

During a PCI error recovery, like the ones provoked by EEH in the ppc64
platform, all IO to the device must be blocked while the recovery is
completed.  Current 8250_pci implementation only suspends the port
instead of detaching it, which doesn't prevent incoming accesses like
TIOCMGET and TIOCMSET calls from reaching the device.  Those end up
racing with the EEH recovery, crashing it.  Similar races were also
observed when opening the device and when shutting it down during
recovery.

This patch implements a more robust IO blockage for the 8250_pci
recovery by unregistering the port at the beginning of the procedure and
re-adding it afterwards.  Since the port is detached from the uart
layer, we can be sure that no request will make through to the device
during recovery.  This is similar to the solution used by the JSM serial
driver.

I thank Peter Hurley &lt;peter@hurleysoftware.com&gt; for valuable input on
this one over one year ago.

Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>x86/apic: Order irq_enter/exit() calls correctly vs. ack_APIC_irq()</title>
<updated>2017-01-27T16:15:00Z</updated>
<author>
<name>Wanpeng Li</name>
<email>wanpeng.li@hotmail.com</email>
</author>
<published>2016-09-18T11:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a2b17a74c58b0a6ac4c7bd1c1c64f00eaadadfce'/>
<id>urn:sha1:a2b17a74c58b0a6ac4c7bd1c1c64f00eaadadfce</id>
<content type='text'>
commit b0f48706a176b71a6e54f399d7404bbeeaa7cfab upstream.

===============================
[ INFO: suspicious RCU usage. ]
4.8.0-rc6+ #5 Not tainted
-------------------------------
./arch/x86/include/asm/msr-trace.h:47 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from idle CPU!
rcu_scheduler_active = 1, debug_locks = 0
RCU used illegally from extended quiescent state!
no locks held by swapper/2/0.

stack backtrace:
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.8.0-rc6+ #5
Hardware name: Dell Inc. OptiPlex 7020/0F5C5X, BIOS A03 01/08/2015
 0000000000000000 ffff8d1bd6003f10 ffffffff94446949 ffff8d1bd4a68000
 0000000000000001 ffff8d1bd6003f40 ffffffff940e9247 ffff8d1bbdfcf3d0
 000000000000080b 0000000000000000 0000000000000000 ffff8d1bd6003f70
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff94446949&gt;] dump_stack+0x99/0xd0
 [&lt;ffffffff940e9247&gt;] lockdep_rcu_suspicious+0xe7/0x120
 [&lt;ffffffff9448e0d5&gt;] do_trace_write_msr+0x135/0x140
 [&lt;ffffffff9406e750&gt;] native_write_msr+0x20/0x30
 [&lt;ffffffff9406503d&gt;] native_apic_msr_eoi_write+0x1d/0x30
 [&lt;ffffffff9405b17e&gt;] smp_trace_call_function_interrupt+0x1e/0x270
 [&lt;ffffffff948cb1d6&gt;] trace_call_function_interrupt+0x96/0xa0
 &lt;EOI&gt;  [&lt;ffffffff947200f4&gt;] ? cpuidle_enter_state+0xe4/0x360
 [&lt;ffffffff947200df&gt;] ? cpuidle_enter_state+0xcf/0x360
 [&lt;ffffffff947203a7&gt;] cpuidle_enter+0x17/0x20
 [&lt;ffffffff940df008&gt;] cpu_startup_entry+0x338/0x4d0
 [&lt;ffffffff9405bfc4&gt;] start_secondary+0x154/0x180

This can be reproduced readily by running ftrace test case of kselftest.

Move the irq_enter() call before ack_APIC_irq(), because irq_enter() tells
the RCU susbstems to end the extended quiescent state, so that the
following trace call in ack_APIC_irq() works correctly. The same applies to
exiting_ack_irq() which calls ack_APIC_irq() after irq_exit().

[ tglx: Massaged changelog ]

Signed-off-by: Wanpeng Li &lt;wanpeng.li@hotmail.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Wanpeng Li &lt;wanpeng.li@hotmail.com&gt;
Link: http://lkml.kernel.org/r/1474198491-3738-1-git-send-email-wanpeng.li@hotmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>move the call of __d_drop(anon) into __d_materialise_unique(dentry, anon)</title>
<updated>2017-01-27T16:14:59Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-09-11T22:55:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=75e8aab4ba77c566a538bd85b0324ae71cc5a5ed'/>
<id>urn:sha1:75e8aab4ba77c566a538bd85b0324ae71cc5a5ed</id>
<content type='text'>
commit 6f18493e541c690169c3b1479d47d95f624161cf upstream.

and lock the right list there

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>fuse: do not use iocb after it may have been freed</title>
<updated>2017-01-27T16:14:58Z</updated>
<author>
<name>Robert Doebbelin</name>
<email>robert@quobyte.com</email>
</author>
<published>2016-03-07T08:50:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=77eed17655f6176a74b70005a337127838057235'/>
<id>urn:sha1:77eed17655f6176a74b70005a337127838057235</id>
<content type='text'>
commit 7cabc61e01a0a8b663bd2b4c982aa53048218734 upstream.

There's a race in fuse_direct_IO(), whereby is_sync_kiocb() is called on an
iocb that could have been freed if async io has already completed.  The fix
in this case is simple and obvious: cache the result before starting io.

It was discovered by KASan:

Kernel: ==================================================================
Kernel: BUG: KASan: use after free in fuse_direct_IO+0xb1a/0xcc0 at addr ffff88036c414390

Signed-off-by: Robert Doebbelin &lt;robert@quobyte.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Fixes: bcba24ccdc82 ("fuse: enable asynchronous processing direct IO")
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>sg: Fix double-free when drives detach during SG_IO</title>
<updated>2017-01-27T16:14:58Z</updated>
<author>
<name>Calvin Owens</name>
<email>calvinowens@fb.com</email>
</author>
<published>2015-10-30T23:57:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=969541196ff043df0bde0c4beae9d83185ea3d81'/>
<id>urn:sha1:969541196ff043df0bde0c4beae9d83185ea3d81</id>
<content type='text'>
commit f3951a3709ff50990bf3e188c27d346792103432 upstream.

In sg_common_write(), we free the block request and return -ENODEV if
the device is detached in the middle of the SG_IO ioctl().

Unfortunately, sg_finish_rem_req() also tries to free srp-&gt;rq, so we
end up freeing rq-&gt;cmd in the already free rq object, and then free
the object itself out from under the current user.

This ends up corrupting random memory via the list_head on the rq
object. The most common crash trace I saw is this:

  ------------[ cut here ]------------
  kernel BUG at block/blk-core.c:1420!
  Call Trace:
  [&lt;ffffffff81281eab&gt;] blk_put_request+0x5b/0x80
  [&lt;ffffffffa0069e5b&gt;] sg_finish_rem_req+0x6b/0x120 [sg]
  [&lt;ffffffffa006bcb9&gt;] sg_common_write.isra.14+0x459/0x5a0 [sg]
  [&lt;ffffffff8125b328&gt;] ? selinux_file_alloc_security+0x48/0x70
  [&lt;ffffffffa006bf95&gt;] sg_new_write.isra.17+0x195/0x2d0 [sg]
  [&lt;ffffffffa006cef4&gt;] sg_ioctl+0x644/0xdb0 [sg]
  [&lt;ffffffff81170f80&gt;] do_vfs_ioctl+0x90/0x520
  [&lt;ffffffff81258967&gt;] ? file_has_perm+0x97/0xb0
  [&lt;ffffffff811714a1&gt;] SyS_ioctl+0x91/0xb0
  [&lt;ffffffff81602afb&gt;] tracesys+0xdd/0xe2
    RIP [&lt;ffffffff81281e04&gt;] __blk_put_request+0x154/0x1a0

The solution is straightforward: just set srp-&gt;rq to NULL in the
failure branch so that sg_finish_rem_req() doesn't attempt to re-free
it.

Additionally, since sg_rq_end_io() will never be called on the object
when this happens, we need to free memory backing -&gt;cmd if it isn't
embedded in the object itself.

KASAN was extremely helpful in finding the root cause of this bug.

Signed-off-by: Calvin Owens &lt;calvinowens@fb.com&gt;
Acked-by: Douglas Gilbert &lt;dgilbert@interlog.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Acked-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>xc2028: Fix use-after-free bug properly</title>
<updated>2017-01-27T16:14:57Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2016-11-17T09:49:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f093600f6a9fd00fa76ad05b8276d4f56c4add78'/>
<id>urn:sha1:f093600f6a9fd00fa76ad05b8276d4f56c4add78</id>
<content type='text'>
commit 22a1e7783e173ab3d86018eb590107d68df46c11 upstream.

The commit 8dfbcc4351a0 ("[media] xc2028: avoid use after free") tried
to address the reported use-after-free by clearing the reference.

However, it's clearing the wrong pointer; it sets NULL to
priv-&gt;ctrl.fname, but it's anyway overwritten by the next line
memcpy(&amp;priv-&gt;ctrl, p, sizeof(priv-&gt;ctrl)).

OTOH, the actual code accessing the freed string is the strcmp() call
with priv-&gt;fname:
	if (!firmware_name[0] &amp;&amp; p-&gt;fname &amp;&amp;
	    priv-&gt;fname &amp;&amp; strcmp(p-&gt;fname, priv-&gt;fname))
		free_firmware(priv);

where priv-&gt;fname points to the previous file name, and this was
already freed by kfree().

For fixing the bug properly, this patch does the following:

- Keep the copy of firmware file name in only priv-&gt;fname,
  priv-&gt;ctrl.fname isn't changed;
- The allocation is done only when the firmware gets loaded;
- The kfree() is called in free_firmware() commonly

Fixes: commit 8dfbcc4351a0 ('[media] xc2028: avoid use after free')
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
</feed>
