All of lore.kernel.org
 help / color / mirror / Atom feed
* [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal
@ 2015-11-16  4:03 Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] l2tp: protect tunnel->del_work by ref_count Sasha Levin
                   ` (57 more replies)
  0 siblings, 58 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Jan Kara, Theodore Ts'o, Sasha Levin

From: Jan Kara <jack@suse.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 841df7df196237ea63233f0f9eaa41db53afd70f ]

Commit 6f6a6fda2945 "jbd2: fix ocfs2 corrupt when updating journal
superblock fails" changed jbd2_cleanup_journal_tail() to return EIO
when the journal is aborted. That makes logic in
jbd2_log_do_checkpoint() bail out which is fine, except that
jbd2_journal_destroy() expects jbd2_log_do_checkpoint() to always make
a progress in cleaning the journal. Without it jbd2_journal_destroy()
just loops in an infinite loop.

Fix jbd2_journal_destroy() to cleanup journal checkpoint lists of
jbd2_log_do_checkpoint() fails with error.

Reported-by: Eryu Guan <guaneryu@gmail.com>
Tested-by: Eryu Guan <guaneryu@gmail.com>
Fixes: 6f6a6fda294506dfe0e3e0a253bb2d2923f28f0a
Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 fs/jbd2/checkpoint.c | 39 +++++++++++++++++++++++++++++++++------
 fs/jbd2/commit.c     |  2 +-
 fs/jbd2/journal.c    | 11 ++++++++++-
 include/linux/jbd2.h |  3 ++-
 4 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index 4227dc4..8c44654 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -417,12 +417,12 @@ int jbd2_cleanup_journal_tail(journal_t *journal)
  * journal_clean_one_cp_list
  *
  * Find all the written-back checkpoint buffers in the given list and
- * release them.
+ * release them. If 'destroy' is set, clean all buffers unconditionally.
  *
  * Called with j_list_lock held.
  * Returns 1 if we freed the transaction, 0 otherwise.
  */
-static int journal_clean_one_cp_list(struct journal_head *jh)
+static int journal_clean_one_cp_list(struct journal_head *jh, bool destroy)
 {
 	struct journal_head *last_jh;
 	struct journal_head *next_jh = jh;
@@ -436,7 +436,10 @@ static int journal_clean_one_cp_list(struct journal_head *jh)
 	do {
 		jh = next_jh;
 		next_jh = jh->b_cpnext;
-		ret = __try_to_free_cp_buf(jh);
+		if (!destroy)
+			ret = __try_to_free_cp_buf(jh);
+		else
+			ret = __jbd2_journal_remove_checkpoint(jh) + 1;
 		if (!ret)
 			return freed;
 		if (ret == 2)
@@ -459,10 +462,11 @@ static int journal_clean_one_cp_list(struct journal_head *jh)
  * journal_clean_checkpoint_list
  *
  * Find all the written-back checkpoint buffers in the journal and release them.
+ * If 'destroy' is set, release all buffers unconditionally.
  *
  * Called with j_list_lock held.
  */
-void __jbd2_journal_clean_checkpoint_list(journal_t *journal)
+void __jbd2_journal_clean_checkpoint_list(journal_t *journal, bool destroy)
 {
 	transaction_t *transaction, *last_transaction, *next_transaction;
 	int ret;
@@ -476,7 +480,8 @@ void __jbd2_journal_clean_checkpoint_list(journal_t *journal)
 	do {
 		transaction = next_transaction;
 		next_transaction = transaction->t_cpnext;
-		ret = journal_clean_one_cp_list(transaction->t_checkpoint_list);
+		ret = journal_clean_one_cp_list(transaction->t_checkpoint_list,
+						destroy);
 		/*
 		 * This function only frees up some memory if possible so we
 		 * dont have an obligation to finish processing. Bail out if
@@ -492,7 +497,7 @@ void __jbd2_journal_clean_checkpoint_list(journal_t *journal)
 		 * we can possibly see not yet submitted buffers on io_list
 		 */
 		ret = journal_clean_one_cp_list(transaction->
-				t_checkpoint_io_list);
+				t_checkpoint_io_list, destroy);
 		if (need_resched())
 			return;
 		/*
@@ -506,6 +511,28 @@ void __jbd2_journal_clean_checkpoint_list(journal_t *journal)
 }
 
 /*
+ * Remove buffers from all checkpoint lists as journal is aborted and we just
+ * need to free memory
+ */
+void jbd2_journal_destroy_checkpoint(journal_t *journal)
+{
+	/*
+	 * We loop because __jbd2_journal_clean_checkpoint_list() may abort
+	 * early due to a need of rescheduling.
+	 */
+	while (1) {
+		spin_lock(&journal->j_list_lock);
+		if (!journal->j_checkpoint_transactions) {
+			spin_unlock(&journal->j_list_lock);
+			break;
+		}
+		__jbd2_journal_clean_checkpoint_list(journal, true);
+		spin_unlock(&journal->j_list_lock);
+		cond_resched();
+	}
+}
+
+/*
  * journal_remove_checkpoint: called after a buffer has been committed
  * to disk (either by being write-back flushed to disk, or being
  * committed to the log).
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index b73e021..362e5f6 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -510,7 +510,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 	 * frees some memory
 	 */
 	spin_lock(&journal->j_list_lock);
-	__jbd2_journal_clean_checkpoint_list(journal);
+	__jbd2_journal_clean_checkpoint_list(journal, false);
 	spin_unlock(&journal->j_list_lock);
 
 	jbd_debug(3, "JBD2: commit phase 1\n");
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index be6f717..2540324 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1708,8 +1708,17 @@ int jbd2_journal_destroy(journal_t *journal)
 	while (journal->j_checkpoint_transactions != NULL) {
 		spin_unlock(&journal->j_list_lock);
 		mutex_lock(&journal->j_checkpoint_mutex);
-		jbd2_log_do_checkpoint(journal);
+		err = jbd2_log_do_checkpoint(journal);
 		mutex_unlock(&journal->j_checkpoint_mutex);
+		/*
+		 * If checkpointing failed, just free the buffers to avoid
+		 * looping forever
+		 */
+		if (err) {
+			jbd2_journal_destroy_checkpoint(journal);
+			spin_lock(&journal->j_list_lock);
+			break;
+		}
 		spin_lock(&journal->j_list_lock);
 	}
 
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index dadb421..4caf8ac 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1042,8 +1042,9 @@ void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block);
 extern void jbd2_journal_commit_transaction(journal_t *);
 
 /* Checkpoint list management */
-void __jbd2_journal_clean_checkpoint_list(journal_t *journal);
+void __jbd2_journal_clean_checkpoint_list(journal_t *journal, bool destroy);
 int __jbd2_journal_remove_checkpoint(struct journal_head *);
+void jbd2_journal_destroy_checkpoint(journal_t *journal);
 void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *);
 
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] l2tp: protect tunnel->del_work by ref_count
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] af_unix: Convert the unix_sk macro to an inline function for type safety Sasha Levin
                   ` (56 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Alexander Couzens, David S. Miller, Sasha Levin

From: Alexander Couzens <lynxis@fe80.eu>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 06a15f51cf3618e32a73871ee6a547ef7fd902b5 ]

There is a small chance that tunnel_free() is called before tunnel->del_work scheduled
resulting in a zero pointer dereference.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Acked-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/l2tp/l2tp_core.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 895348e4..508154a 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1319,7 +1319,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
 	tunnel = container_of(work, struct l2tp_tunnel, del_work);
 	sk = l2tp_tunnel_sock_lookup(tunnel);
 	if (!sk)
-		return;
+		goto out;
 
 	sock = sk->sk_socket;
 
@@ -1340,6 +1340,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
 	}
 
 	l2tp_tunnel_sock_put(sk);
+out:
+	l2tp_tunnel_dec_refcount(tunnel);
 }
 
 /* Create a socket for the tunnel, if one isn't set up by
@@ -1639,8 +1641,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);
  */
 int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
 {
+	l2tp_tunnel_inc_refcount(tunnel);
 	l2tp_tunnel_closeall(tunnel);
-	return (false == queue_work(l2tp_wq, &tunnel->del_work));
+	if (false == queue_work(l2tp_wq, &tunnel->del_work)) {
+		l2tp_tunnel_dec_refcount(tunnel);
+		return 1;
+	}
+	return 0;
 }
 EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] af_unix: Convert the unix_sk macro to an inline function for type safety
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] l2tp: protect tunnel->del_work by ref_count Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Sasha Levin
                   ` (55 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Aaron Conole, David S. Miller, Sasha Levin

From: Aaron Conole <aconole@bytheb.org>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 4613012db1d911f80897f9446a49de817b2c4c47 ]

As suggested by Eric Dumazet this change replaces the
#define with a static inline function to enjoy
complaints by the compiler when misusing the API.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 include/net/af_unix.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index a175ba4..dfe4ddf 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -64,7 +64,11 @@ struct unix_sock {
 #define UNIX_GC_MAYBE_CYCLE	1
 	struct socket_wq	peer_wq;
 };
-#define unix_sk(__sk) ((struct unix_sock *)__sk)
+
+static inline struct unix_sock *unix_sk(struct sock *sk)
+{
+	return (struct unix_sock *)sk;
+}
 
 #define peer_wait peer_wq.wait
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] l2tp: protect tunnel->del_work by ref_count Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] af_unix: Convert the unix_sk macro to an inline function for type safety Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] net/unix: fix logic about sk_peek_offset Sasha Levin
                   ` (54 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Aaron Conole, David S. Miller, Sasha Levin

From: Aaron Conole <aconole@bytheb.org>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 9f389e35674f5b086edd70ed524ca0f287259725 ]

AF_UNIX sockets now return multiple skbs from recv() when MSG_PEEK flag
is set.

This is referenced in kernel bugzilla #12323 @
https://bugzilla.kernel.org/show_bug.cgi?id=12323

As described both in the BZ and lkml thread @
http://lkml.org/lkml/2008/1/8/444 calling recv() with MSG_PEEK on an
AF_UNIX socket only reads a single skb, where the desired effect is
to return as much skb data has been queued, until hitting the recv
buffer size (whichever comes first).

The modified MSG_PEEK path will now move to the next skb in the tree
and jump to the again: label, rather than following the natural loop
structure. This requires duplicating some of the loop head actions.

This was tested using the python socketpair python code attached to
the bugzilla issue.

Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/unix/af_unix.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 8232118..30a705e 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2070,8 +2070,20 @@ again:
 			if (UNIXCB(skb).fp)
 				siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
 
-			sk_peek_offset_fwd(sk, chunk);
+			if (skip) {
+				sk_peek_offset_fwd(sk, chunk);
+				skip -= chunk;
+			}
+
+			if (UNIXCB(skb).fp)
+				break;
 
+			last = skb;
+			unix_state_lock(sk);
+			skb = skb_peek_next(skb, &sk->sk_receive_queue);
+			if (skb)
+				goto again;
+			unix_state_unlock(sk);
 			break;
 		}
 	} while (size);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] net/unix: fix logic about sk_peek_offset
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (2 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] skbuff: Fix skb checksum flag on skb pull Sasha Levin
                   ` (53 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Andrey Vagin, David S. Miller, Eric Dumazet, Aaron Conole, Sasha Levin

From: Andrey Vagin <avagin@openvz.org>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit e9193d60d363e4dff75ff6d43a48f22be26d59c7 ]

Now send with MSG_PEEK can return data from multiple SKBs.

Unfortunately we take into account the peek offset for each skb,
that is wrong. We need to apply the peek offset only once.

In addition, the peek offset should be used only if MSG_PEEK is set.

Cc: "David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING
Cc: Eric Dumazet <edumazet@google.com> (commit_signer:1/14=7%)
Cc: Aaron Conole <aconole@bytheb.org>
Fixes: 9f389e35674f ("af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag")
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Tested-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/unix/af_unix.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 30a705e..2ae4a59 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1962,6 +1962,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
 		goto out;
 	}
 
+	if (flags & MSG_PEEK)
+		skip = sk_peek_offset(sk, flags);
+	else
+		skip = 0;
+
 	do {
 		int chunk;
 		struct sk_buff *skb, *last;
@@ -2008,7 +2013,6 @@ again:
 			break;
 		}
 
-		skip = sk_peek_offset(sk, flags);
 		while (skip >= unix_skb_len(skb)) {
 			skip -= unix_skb_len(skb);
 			last = skb;
@@ -2070,14 +2074,12 @@ again:
 			if (UNIXCB(skb).fp)
 				siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp);
 
-			if (skip) {
-				sk_peek_offset_fwd(sk, chunk);
-				skip -= chunk;
-			}
+			sk_peek_offset_fwd(sk, chunk);
 
 			if (UNIXCB(skb).fp)
 				break;
 
+			skip = 0;
 			last = skb;
 			unix_state_lock(sk);
 			skb = skb_peek_next(skb, &sk->sk_receive_queue);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] skbuff: Fix skb checksum flag on skb pull
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (3 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] net/unix: fix logic about sk_peek_offset Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] skbuff: Fix skb checksum partial check Sasha Levin
                   ` (52 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Pravin B Shelar, David S. Miller, Sasha Levin

From: Pravin B Shelar <pshelar@nicira.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 6ae459bdaaeebc632b16e54dcbabb490c6931d61 ]

VXLAN device can receive skb with checksum partial. But the checksum
offset could be in outer header which is pulled on receive. This results
in negative checksum offset for the skb. Such skb can cause the assert
failure in skb_checksum_help(). Following patch fixes the bug by setting
checksum-none while pulling outer header.

Following is the kernel panic msg from old kernel hitting the bug.

------------[ cut here ]------------
kernel BUG at net/core/dev.c:1906!
RIP: 0010:[<ffffffff81518034>] skb_checksum_help+0x144/0x150
Call Trace:
<IRQ>
[<ffffffffa0164c28>] queue_userspace_packet+0x408/0x470 [openvswitch]
[<ffffffffa016614d>] ovs_dp_upcall+0x5d/0x60 [openvswitch]
[<ffffffffa0166236>] ovs_dp_process_packet_with_key+0xe6/0x100 [openvswitch]
[<ffffffffa016629b>] ovs_dp_process_received_packet+0x4b/0x80 [openvswitch]
[<ffffffffa016c51a>] ovs_vport_receive+0x2a/0x30 [openvswitch]
[<ffffffffa0171383>] vxlan_rcv+0x53/0x60 [openvswitch]
[<ffffffffa01734cb>] vxlan_udp_encap_recv+0x8b/0xf0 [openvswitch]
[<ffffffff8157addc>] udp_queue_rcv_skb+0x2dc/0x3b0
[<ffffffff8157b56f>] __udp4_lib_rcv+0x1cf/0x6c0
[<ffffffff8157ba7a>] udp_rcv+0x1a/0x20
[<ffffffff8154fdbd>] ip_local_deliver_finish+0xdd/0x280
[<ffffffff81550128>] ip_local_deliver+0x88/0x90
[<ffffffff8154fa7d>] ip_rcv_finish+0x10d/0x370
[<ffffffff81550365>] ip_rcv+0x235/0x300
[<ffffffff8151ba1d>] __netif_receive_skb+0x55d/0x620
[<ffffffff8151c360>] netif_receive_skb+0x80/0x90
[<ffffffff81459935>] virtnet_poll+0x555/0x6f0
[<ffffffff8151cd04>] net_rx_action+0x134/0x290
[<ffffffff810683d8>] __do_softirq+0xa8/0x210
[<ffffffff8162fe6c>] call_softirq+0x1c/0x30
[<ffffffff810161a5>] do_softirq+0x65/0xa0
[<ffffffff810687be>] irq_exit+0x8e/0xb0
[<ffffffff81630733>] do_IRQ+0x63/0xe0
[<ffffffff81625f2e>] common_interrupt+0x6e/0x6e

Reported-by: Anupam Chanda <achanda@vmware.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 include/linux/skbuff.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 522d837..603b5da 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2549,6 +2549,9 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
 {
 	if (skb->ip_summed == CHECKSUM_COMPLETE)
 		skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
+	else if (skb->ip_summed == CHECKSUM_PARTIAL &&
+		 skb_checksum_start_offset(skb) <= len)
+		skb->ip_summed = CHECKSUM_NONE;
 }
 
 unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] skbuff: Fix skb checksum partial check.
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (4 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] skbuff: Fix skb checksum flag on skb pull Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] net: add pfmemalloc check in sk_add_backlog() Sasha Levin
                   ` (51 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Pravin B Shelar, David S. Miller, Sasha Levin

From: Pravin B Shelar <pshelar@nicira.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 31b33dfb0a144469dd805514c9e63f4993729a48 ]

Earlier patch 6ae459bda tried to detect void ckecksum partial
skb by comparing pull length to checksum offset. But it does
not work for all cases since checksum-offset depends on
updates to skb->data.

Following patch fixes it by validating checksum start offset
after skb-data pointer is updated. Negative value of checksum
offset start means there is no need to checksum.

Fixes: 6ae459bda ("skbuff: Fix skb checksum flag on skb pull")
Reported-by: Andrew Vagin <avagin@odin.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 include/linux/skbuff.h | 2 +-
 net/core/skbuff.c      | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 603b5da..3b57c67 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2550,7 +2550,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
 	if (skb->ip_summed == CHECKSUM_COMPLETE)
 		skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
 	else if (skb->ip_summed == CHECKSUM_PARTIAL &&
-		 skb_checksum_start_offset(skb) <= len)
+		 skb_checksum_start_offset(skb) < 0)
 		skb->ip_summed = CHECKSUM_NONE;
 }
 
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 72400a1..ea0bcc4 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2881,11 +2881,12 @@ EXPORT_SYMBOL(skb_append_datato_frags);
  */
 unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
 {
+	unsigned char *data = skb->data;
+
 	BUG_ON(len > skb->len);
-	skb->len -= len;
-	BUG_ON(skb->len < skb->data_len);
-	skb_postpull_rcsum(skb, skb->data, len);
-	return skb->data += len;
+	__skb_pull(skb, len);
+	skb_postpull_rcsum(skb, data, len);
+	return skb->data;
 }
 EXPORT_SYMBOL_GPL(skb_pull_rcsum);
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] net: add pfmemalloc check in sk_add_backlog()
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (5 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] skbuff: Fix skb checksum partial check Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ppp: don't override sk->sk_state in pppoe_flush_dev() Sasha Levin
                   ` (50 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Eric Dumazet, David S. Miller, Sasha Levin

From: Eric Dumazet <edumazet@google.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit c7c49b8fde26b74277188bdc6c9dca38db6fa35b ]

Greg reported crashes hitting the following check in __sk_backlog_rcv()

	BUG_ON(!sock_flag(sk, SOCK_MEMALLOC));

The pfmemalloc bit is currently checked in sk_filter().

This works correctly for TCP, because sk_filter() is ran in
tcp_v[46]_rcv() before hitting the prequeue or backlog checks.

For UDP or other protocols, this does not work, because the sk_filter()
is ran from sock_queue_rcv_skb(), which might be called _after_ backlog
queuing if socket is owned by user by the time packet is processed by
softirq handler.

Fixes: b4b9e35585089 ("netvm: set PF_MEMALLOC as appropriate during SKB processing")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Greg Thelen <gthelen@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 include/net/sock.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/net/sock.h b/include/net/sock.h
index 4406dbe..a098ce3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -819,6 +819,14 @@ static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *s
 	if (sk_rcvqueues_full(sk, limit))
 		return -ENOBUFS;
 
+	/*
+	 * If the skb was allocated from pfmemalloc reserves, only
+	 * allow SOCK_MEMALLOC sockets to use it as this socket is
+	 * helping free memory
+	 */
+	if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC))
+		return -ENOMEM;
+
 	__sk_add_backlog(sk, skb);
 	sk->sk_backlog.len += skb->truesize;
 	return 0;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] ppp: don't override sk->sk_state in pppoe_flush_dev()
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (6 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] net: add pfmemalloc check in sk_add_backlog() Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Sasha Levin
                   ` (49 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Guillaume Nault, David S. Miller, Sasha Levin

From: Guillaume Nault <g.nault@alphalink.fr>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit e6740165b8f7f06d8caee0fceab3fb9d790a6fed ]

Since commit 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release"),
pppoe_release() calls dev_put(po->pppoe_dev) if sk is in the
PPPOX_ZOMBIE state. But pppoe_flush_dev() can set sk->sk_state to
PPPOX_ZOMBIE _and_ reset po->pppoe_dev to NULL. This leads to the
following oops:

[  570.140800] BUG: unable to handle kernel NULL pointer dereference at 00000000000004e0
[  570.142931] IP: [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe]
[  570.144601] PGD 3d119067 PUD 3dbc1067 PMD 0
[  570.144601] Oops: 0000 [#1] SMP
[  570.144601] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel udp_tunnel pppoe pppox ppp_generic slhc loop crc32c_intel ghash_clmulni_intel jitterentropy_rng sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper acpi_cpufreq evdev serio_raw processor button ext4 crc16 mbcache jbd2 virtio_net virtio_blk virtio_pci virtio_ring virtio
[  570.144601] CPU: 1 PID: 15738 Comm: ppp-apitest Not tainted 4.2.0 #1
[  570.144601] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[  570.144601] task: ffff88003d30d600 ti: ffff880036b60000 task.ti: ffff880036b60000
[  570.144601] RIP: 0010:[<ffffffffa018c701>]  [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe]
[  570.144601] RSP: 0018:ffff880036b63e08  EFLAGS: 00010202
[  570.144601] RAX: 0000000000000000 RBX: ffff880034340000 RCX: 0000000000000206
[  570.144601] RDX: 0000000000000006 RSI: ffff88003d30dd20 RDI: ffff88003d30dd20
[  570.144601] RBP: ffff880036b63e28 R08: 0000000000000001 R09: 0000000000000000
[  570.144601] R10: 00007ffee9b50420 R11: ffff880034340078 R12: ffff8800387ec780
[  570.144601] R13: ffff8800387ec7b0 R14: ffff88003e222aa0 R15: ffff8800387ec7b0
[  570.144601] FS:  00007f5672f48700(0000) GS:ffff88003fc80000(0000) knlGS:0000000000000000
[  570.144601] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  570.144601] CR2: 00000000000004e0 CR3: 0000000037f7e000 CR4: 00000000000406a0
[  570.144601] Stack:
[  570.144601]  ffffffffa018f240 ffff8800387ec780 ffffffffa018f240 ffff8800387ec7b0
[  570.144601]  ffff880036b63e48 ffffffff812caabe ffff880039e4e000 0000000000000008
[  570.144601]  ffff880036b63e58 ffffffff812cabad ffff880036b63ea8 ffffffff811347f5
[  570.144601] Call Trace:
[  570.144601]  [<ffffffff812caabe>] sock_release+0x1a/0x75
[  570.144601]  [<ffffffff812cabad>] sock_close+0xd/0x11
[  570.144601]  [<ffffffff811347f5>] __fput+0xff/0x1a5
[  570.144601]  [<ffffffff811348cb>] ____fput+0x9/0xb
[  570.144601]  [<ffffffff81056682>] task_work_run+0x66/0x90
[  570.144601]  [<ffffffff8100189e>] prepare_exit_to_usermode+0x8c/0xa7
[  570.144601]  [<ffffffff81001a26>] syscall_return_slowpath+0x16d/0x19b
[  570.144601]  [<ffffffff813babb1>] int_ret_from_sys_call+0x25/0x9f
[  570.144601] Code: 48 8b 83 c8 01 00 00 a8 01 74 12 48 89 df e8 8b 27 14 e1 b8 f7 ff ff ff e9 b7 00 00 00 8a 43 12 a8 0b 74 1c 48 8b 83 a8 04 00 00 <48> 8b 80 e0 04 00 00 65 ff 08 48 c7 83 a8 04 00 00 00 00 00 00
[  570.144601] RIP  [<ffffffffa018c701>] pppoe_release+0x50/0x101 [pppoe]
[  570.144601]  RSP <ffff880036b63e08>
[  570.144601] CR2: 00000000000004e0
[  570.200518] ---[ end trace 46956baf17349563 ]---

pppoe_flush_dev() has no reason to override sk->sk_state with
PPPOX_ZOMBIE. pppox_unbind_sock() already sets sk->sk_state to
PPPOX_DEAD, which is the correct state given that sk is unbound and
po->pppoe_dev is NULL.

Fixes: 2b018d57ff18 ("pppoe: drop PPPOX_ZOMBIEs in pppoe_release")
Tested-by: Oleksii Berezhniak <core@irc.lg.ua>
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/ppp/pppoe.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index 6c9c16d..f606b5b 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -313,7 +313,6 @@ static void pppoe_flush_dev(struct net_device *dev)
 			if (po->pppoe_dev == dev &&
 			    sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) {
 				pppox_unbind_sock(sk);
-				sk->sk_state = PPPOX_ZOMBIE;
 				sk->sk_state_change(sk);
 				po->pppoe_dev = NULL;
 				dev_put(dev);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (7 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ppp: don't override sk->sk_state in pppoe_flush_dev() Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] crypto: sparc - initialize blkcipher.ivsize Sasha Levin
                   ` (48 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Joe Perches, David S. Miller, Sasha Levin

From: Joe Perches <joe@perches.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 077cb37fcf6f00a45f375161200b5ee0cd4e937b ]

It seems that kernel memory can leak into userspace by a
kmalloc, ethtool_get_strings, then copy_to_user sequence.

Avoid this by using kcalloc to zero fill the copied buffer.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/core/ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 06dfb29..14bb158 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1257,7 +1257,7 @@ static int ethtool_get_strings(struct net_device *dev, void __user *useraddr)
 
 	gstrings.len = ret;
 
-	data = kmalloc(gstrings.len * ETH_GSTRING_LEN, GFP_USER);
+	data = kcalloc(gstrings.len, ETH_GSTRING_LEN, GFP_USER);
 	if (!data)
 		return -ENOMEM;
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] crypto: sparc - initialize blkcipher.ivsize
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (8 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] crypto: ahash - ensure statesize is non-zero Sasha Levin
                   ` (47 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Dave Kleikamp, Herbert Xu, Sasha Levin

From: Dave Kleikamp <dave.kleikamp@oracle.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit a66d7f724a96d6fd279bfbd2ee488def6b081bea ]

Some of the crypto algorithms write to the initialization vector,
but no space has been allocated for it. This clobbers adjacent memory.

Cc: stable@vger.kernel.org
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 arch/sparc/crypto/aes_glue.c      | 2 ++
 arch/sparc/crypto/camellia_glue.c | 1 +
 arch/sparc/crypto/des_glue.c      | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c
index 7054087..ef08705 100644
--- a/arch/sparc/crypto/aes_glue.c
+++ b/arch/sparc/crypto/aes_glue.c
@@ -433,6 +433,7 @@ static struct crypto_alg algs[] = { {
 		.blkcipher = {
 			.min_keysize	= AES_MIN_KEY_SIZE,
 			.max_keysize	= AES_MAX_KEY_SIZE,
+			.ivsize		= AES_BLOCK_SIZE,
 			.setkey		= aes_set_key,
 			.encrypt	= cbc_encrypt,
 			.decrypt	= cbc_decrypt,
@@ -452,6 +453,7 @@ static struct crypto_alg algs[] = { {
 		.blkcipher = {
 			.min_keysize	= AES_MIN_KEY_SIZE,
 			.max_keysize	= AES_MAX_KEY_SIZE,
+			.ivsize		= AES_BLOCK_SIZE,
 			.setkey		= aes_set_key,
 			.encrypt	= ctr_crypt,
 			.decrypt	= ctr_crypt,
diff --git a/arch/sparc/crypto/camellia_glue.c b/arch/sparc/crypto/camellia_glue.c
index 641f55c..eb87d6d 100644
--- a/arch/sparc/crypto/camellia_glue.c
+++ b/arch/sparc/crypto/camellia_glue.c
@@ -274,6 +274,7 @@ static struct crypto_alg algs[] = { {
 		.blkcipher = {
 			.min_keysize	= CAMELLIA_MIN_KEY_SIZE,
 			.max_keysize	= CAMELLIA_MAX_KEY_SIZE,
+			.ivsize		= CAMELLIA_BLOCK_SIZE,
 			.setkey		= camellia_set_key,
 			.encrypt	= cbc_encrypt,
 			.decrypt	= cbc_decrypt,
diff --git a/arch/sparc/crypto/des_glue.c b/arch/sparc/crypto/des_glue.c
index d115009..1359bfc 100644
--- a/arch/sparc/crypto/des_glue.c
+++ b/arch/sparc/crypto/des_glue.c
@@ -429,6 +429,7 @@ static struct crypto_alg algs[] = { {
 		.blkcipher = {
 			.min_keysize	= DES_KEY_SIZE,
 			.max_keysize	= DES_KEY_SIZE,
+			.ivsize		= DES_BLOCK_SIZE,
 			.setkey		= des_set_key,
 			.encrypt	= cbc_encrypt,
 			.decrypt	= cbc_decrypt,
@@ -485,6 +486,7 @@ static struct crypto_alg algs[] = { {
 		.blkcipher = {
 			.min_keysize	= DES3_EDE_KEY_SIZE,
 			.max_keysize	= DES3_EDE_KEY_SIZE,
+			.ivsize		= DES3_EDE_BLOCK_SIZE,
 			.setkey		= des3_ede_set_key,
 			.encrypt	= cbc3_encrypt,
 			.decrypt	= cbc3_decrypt,
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] crypto: ahash - ensure statesize is non-zero
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (9 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] crypto: sparc - initialize blkcipher.ivsize Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] btrfs: fix use after free iterating extrefs Sasha Levin
                   ` (46 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Russell King, Herbert Xu, Sasha Levin

From: Russell King <rmk+kernel@arm.linux.org.uk>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 8996eafdcbad149ac0f772fb1649fbb75c482a6a ]

Unlike shash algorithms, ahash drivers must implement export
and import as their descriptors may contain hardware state and
cannot be exported as is.  Unfortunately some ahash drivers did
not provide them and end up causing crashes with algif_hash.

This patch adds a check to prevent these drivers from registering
ahash algorithms until they are fixed.

Cc: stable@vger.kernel.org
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 crypto/ahash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/crypto/ahash.c b/crypto/ahash.c
index f6a36a5..c1d8591 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -543,7 +543,8 @@ static int ahash_prepare_alg(struct ahash_alg *alg)
 	struct crypto_alg *base = &alg->halg.base;
 
 	if (alg->halg.digestsize > PAGE_SIZE / 8 ||
-	    alg->halg.statesize > PAGE_SIZE / 8)
+	    alg->halg.statesize > PAGE_SIZE / 8 ||
+	    alg->halg.statesize == 0)
 		return -EINVAL;
 
 	base->cra_type = &crypto_ahash_type;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] btrfs: fix use after free iterating extrefs
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (10 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] crypto: ahash - ensure statesize is non-zero Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Sasha Levin
                   ` (45 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Chris Mason, Mark Fasheh, Sasha Levin

From: Chris Mason <clm@fb.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit dc6c5fb3b514221f2e9d21ee626a9d95d3418dff ]

The code for btrfs inode-resolve has never worked properly for
files with enough hard links to trigger extrefs.  It was trying to
get the leaf out of a path after freeing the path:

	btrfs_release_path(path);
	leaf = path->nodes[0];
	item_size = btrfs_item_size_nr(leaf, slot);

The fix here is to use the extent buffer we cloned just a little higher
up to avoid deadlocks caused by using the leaf in the path.

Signed-off-by: Chris Mason <clm@fb.com>
cc: stable@vger.kernel.org # v3.7+
cc: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 fs/btrfs/backref.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 2d3e32e..cfd1e6f 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1778,7 +1778,6 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
 	int found = 0;
 	struct extent_buffer *eb;
 	struct btrfs_inode_extref *extref;
-	struct extent_buffer *leaf;
 	u32 item_size;
 	u32 cur_offset;
 	unsigned long ptr;
@@ -1806,9 +1805,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
 		btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
 		btrfs_release_path(path);
 
-		leaf = path->nodes[0];
-		item_size = btrfs_item_size_nr(leaf, slot);
-		ptr = btrfs_item_ptr_offset(leaf, slot);
+		item_size = btrfs_item_size_nr(eb, slot);
+		ptr = btrfs_item_ptr_offset(eb, slot);
 		cur_offset = 0;
 
 		while (cur_offset < item_size) {
@@ -1822,7 +1820,7 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
 			if (ret)
 				break;
 
-			cur_offset += btrfs_inode_extref_name_len(leaf, extref);
+			cur_offset += btrfs_inode_extref_name_len(eb, extref);
 			cur_offset += sizeof(*extref);
 		}
 		btrfs_tree_read_unlock_blocking(eb);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (11 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] btrfs: fix use after free iterating extrefs Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: rcar: enable RuntimePM before registering to the core Sasha Levin
                   ` (44 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Will Deacon, Ard Biesheuvel, Sasha Levin

From: Will Deacon <will.deacon@arm.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit b6dd8e0719c0d2d01429639a11b7bc2677de240c ]

Commit df057cc7b4fa ("arm64: errata: add module build workaround for
erratum #843419") sets CFLAGS_MODULE to ensure that the large memory
model is used by the compiler when building kernel modules.

However, CFLAGS_MODULE is an environment variable and intended to be
overridden on the command line, which appears to be the case with the
Ubuntu kernel packaging system, so use KBUILD_CFLAGS_MODULE instead.

Cc: <stable@vger.kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419")
Reported-by: Dann Frazier <dann.frazier@canonical.com>
Tested-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index e7391ae..2d54c55 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -33,7 +33,7 @@ endif
 CHECKFLAGS	+= -D__aarch64__
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
-CFLAGS_MODULE	+= -mcmodel=large
+KBUILD_CFLAGS_MODULE	+= -mcmodel=large
 endif
 
 # Default value
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] i2c: rcar: enable RuntimePM before registering to the core
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (12 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: s3c2410: " Sasha Levin
                   ` (43 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Wolfram Sang, Wolfram Sang, stable, Sasha Levin

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 4f7effddf4549d57114289f273710f077c4c330a ]

The core may register clients attached to this master which may use
funtionality from the master. So, RuntimePM must be enabled before, otherwise
this will fail. While here, move drvdata, too.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/i2c/busses/i2c-rcar.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index d826e82..47bd421 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -584,15 +584,16 @@ static int rcar_i2c_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	pm_runtime_enable(dev);
+	platform_set_drvdata(pdev, priv);
+
 	ret = i2c_add_numbered_adapter(adap);
 	if (ret < 0) {
 		dev_err(dev, "reg adap failed: %d\n", ret);
+		pm_runtime_disable(dev);
 		return ret;
 	}
 
-	pm_runtime_enable(dev);
-	platform_set_drvdata(pdev, priv);
-
 	dev_info(dev, "probed\n");
 
 	return 0;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] i2c: s3c2410: enable RuntimePM before registering to the core
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (13 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: rcar: enable RuntimePM before registering to the core Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Sasha Levin
                   ` (42 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Wolfram Sang, Wolfram Sang, stable, Sasha Levin

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit eadd709f5d2e8aebb1b7bf49460e97a68d81a9b0 ]

The core may register clients attached to this master which may use
funtionality from the master. So, RuntimePM must be enabled before, otherwise
this will fail. While here, move drvdata, too.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Kukjin Kim <kgene@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/i2c/busses/i2c-s3c2410.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index c127af9..b928e7a 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1219,17 +1219,19 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
 	i2c->adap.nr = i2c->pdata->bus_num;
 	i2c->adap.dev.of_node = pdev->dev.of_node;
 
+	platform_set_drvdata(pdev, i2c);
+
+	pm_runtime_enable(&pdev->dev);
+
 	ret = i2c_add_numbered_adapter(&i2c->adap);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to add bus to i2c core\n");
+		pm_runtime_disable(&pdev->dev);
 		s3c24xx_i2c_deregister_cpufreq(i2c);
 		clk_unprepare(i2c->clk);
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, i2c);
-
-	pm_runtime_enable(&pdev->dev);
 	pm_runtime_enable(&i2c->adap.dev);
 
 	dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev));
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (14 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: s3c2410: " Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] workqueue: make sure delayed work run in local cpu Sasha Levin
                   ` (41 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Mika Westerberg, Wolfram Sang, stable, Sasha Levin

From: Mika Westerberg <mika.westerberg@linux.intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 56d4b8a24cef5d66f0d10ac778a520d3c2c68a48 ]

ACPI SSCN/FMCN methods were originally added because then the platform can
provide the most accurate HCNT/LCNT values to the driver. However, this
seems not to be true for Dell Inspiron 7348 where using these causes the
touchpad to fail in boot:

  i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
  i2c_designware INT3433:00: i2c_dw_handle_tx_abort: lost arbitration
  i2c_hid i2c-DLL0675:00: failed to retrieve report from device.
  i2c_designware INT3433:00: controller timed out

The values received from ACPI are (in fast mode):

  HCNT: 72
  LCNT: 160

this translates to following timings (input clock is 100MHz on Broadwell):

  tHIGH: 720 ns (spec min 600 ns)
  tLOW: 1600 ns (spec min 1300 ns)
  Bus period: 2920 ns (assuming 300 ns tf and tr)
  Bus speed: 342.5 kHz

Both tHIGH and tLOW are within the I2C specification.

The calculated values when ACPI parameters are not used are (in fast mode):

  HCNT: 87
  LCNT: 159

which translates to:

  tHIGH: 870 ns (spec min 600 ns)
  tLOW: 1590 ns (spec min 1300 ns)
  Bus period 3060 ns (assuming 300 ns tf and tr)
  Bus speed 326.8 kHz

These values are also within the I2C specification.

Since both ACPI and calculated values meet the I2C specification timing
requirements it is hard to say why the touchpad does not function properly
with the ACPI values except that the bus speed is higher in this case (but
still well below the max 400kHz).

Solve this by adding DMI quirk to the driver that disables using ACPI
parameters on this particulare machine.

Reported-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Pavel Roskin <plroskin@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 373dd4d..76babdb 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -24,6 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
+#include <linux/dmi.h>
 #include <linux/i2c.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
@@ -51,6 +52,22 @@ static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
 }
 
 #ifdef CONFIG_ACPI
+/*
+ * The HCNT/LCNT information coming from ACPI should be the most accurate
+ * for given platform. However, some systems get it wrong. On such systems
+ * we get better results by calculating those based on the input clock.
+ */
+static const struct dmi_system_id dw_i2c_no_acpi_params[] = {
+	{
+		.ident = "Dell Inspiron 7348",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7348"),
+		},
+	},
+	{ }
+};
+
 static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
 			       u16 *hcnt, u16 *lcnt, u32 *sda_hold)
 {
@@ -58,6 +75,9 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
 	acpi_handle handle = ACPI_HANDLE(&pdev->dev);
 	union acpi_object *obj;
 
+	if (dmi_check_system(dw_i2c_no_acpi_params))
+		return;
+
 	if (ACPI_FAILURE(acpi_evaluate_object(handle, method, NULL, &buf)))
 		return;
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] workqueue: make sure delayed work run in local cpu
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (15 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Sasha Levin
                   ` (40 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Shaohua Li, Tejun Heo, Sasha Levin

From: Shaohua Li <shli@fb.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 874bbfe600a660cba9c776b3957b1ce393151b76 ]

My system keeps crashing with below message. vmstat_update() schedules a delayed
work in current cpu and expects the work runs in the cpu.
schedule_delayed_work() is expected to make delayed work run in local cpu. The
problem is timer can be migrated with NO_HZ. __queue_work() queues work in
timer handler, which could run in a different cpu other than where the delayed
work is scheduled. The end result is the delayed work runs in different cpu.
The patch makes __queue_delayed_work records local cpu earlier. Where the timer
runs doesn't change where the work runs with the change.

[   28.010131] ------------[ cut here ]------------
[   28.010609] kernel BUG at ../mm/vmstat.c:1392!
[   28.011099] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN
[   28.011860] Modules linked in:
[   28.012245] CPU: 0 PID: 289 Comm: kworker/0:3 Tainted: G        W4.3.0-rc3+ #634
[   28.013065] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014
[   28.014160] Workqueue: events vmstat_update
[   28.014571] task: ffff880117682580 ti: ffff8800ba428000 task.ti: ffff8800ba428000
[   28.015445] RIP: 0010:[<ffffffff8115f921>]  [<ffffffff8115f921>]vmstat_update+0x31/0x80
[   28.016282] RSP: 0018:ffff8800ba42fd80  EFLAGS: 00010297
[   28.016812] RAX: 0000000000000000 RBX: ffff88011a858dc0 RCX:0000000000000000
[   28.017585] RDX: ffff880117682580 RSI: ffffffff81f14d8c RDI:ffffffff81f4df8d
[   28.018366] RBP: ffff8800ba42fd90 R08: 0000000000000001 R09:0000000000000000
[   28.019169] R10: 0000000000000000 R11: 0000000000000121 R12:ffff8800baa9f640
[   28.019947] R13: ffff88011a81e340 R14: ffff88011a823700 R15:0000000000000000
[   28.020071] FS:  0000000000000000(0000) GS:ffff88011a800000(0000)knlGS:0000000000000000
[   28.020071] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   28.020071] CR2: 00007ff6144b01d0 CR3: 00000000b8e93000 CR4:00000000000006f0
[   28.020071] Stack:
[   28.020071]  ffff88011a858dc0 ffff8800baa9f640 ffff8800ba42fe00ffffffff8106bd88
[   28.020071]  ffffffff8106bd0b 0000000000000096 0000000000000000ffffffff82f9b1e8
[   28.020071]  ffffffff829f0b10 0000000000000000 ffffffff81f18460ffff88011a81e340
[   28.020071] Call Trace:
[   28.020071]  [<ffffffff8106bd88>] process_one_work+0x1c8/0x540
[   28.020071]  [<ffffffff8106bd0b>] ? process_one_work+0x14b/0x540
[   28.020071]  [<ffffffff8106c214>] worker_thread+0x114/0x460
[   28.020071]  [<ffffffff8106c100>] ? process_one_work+0x540/0x540
[   28.020071]  [<ffffffff81071bf8>] kthread+0xf8/0x110
[   28.020071]  [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200
[   28.020071]  [<ffffffff81a6522f>] ret_from_fork+0x3f/0x70
[   28.020071]  [<ffffffff81071b00>] ?kthread_create_on_node+0x200/0x200

Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org # v2.6.31+
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 kernel/workqueue.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 2273f53..bd3c41d 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1442,13 +1442,13 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
 	timer_stats_timer_set_start_info(&dwork->timer);
 
 	dwork->wq = wq;
+	/* timer isn't guaranteed to run in this cpu, record earlier */
+	if (cpu == WORK_CPU_UNBOUND)
+		cpu = raw_smp_processor_id();
 	dwork->cpu = cpu;
 	timer->expires = jiffies + delay;
 
-	if (unlikely(cpu != WORK_CPU_UNBOUND))
-		add_timer_on(timer, cpu);
-	else
-		add_timer(timer);
+	add_timer_on(timer, cpu);
 }
 
 /**
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] drm/nouveau/fbcon: take runpm reference when userspace has an open fd
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (16 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] workqueue: make sure delayed work run in local cpu Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] drm/radeon: add pm sysfs files late Sasha Levin
                   ` (39 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Ben Skeggs, Sasha Levin

From: Ben Skeggs <bskeggs@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit f231976c2e8964ceaa9250e57d27c35ff03825c2 ]

We need to do this in order to prevent accesses to the device while it's
powered down.  Userspace may have an mmap of the fb, and there's no good
way (that I know of) to prevent it from touching the device otherwise.

This fixes some nasty races between runpm and plymouth on some systems,
which result in the GPU getting very upset and hanging the boot.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/gpu/drm/nouveau/nouveau_fbcon.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 593ef8a..ddcfc1d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -178,8 +178,30 @@ nouveau_fbcon_sync(struct fb_info *info)
 	return 0;
 }
 
+static int
+nouveau_fbcon_open(struct fb_info *info, int user)
+{
+	struct nouveau_fbdev *fbcon = info->par;
+	struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
+	int ret = pm_runtime_get_sync(drm->dev->dev);
+	if (ret < 0 && ret != -EACCES)
+		return ret;
+	return 0;
+}
+
+static int
+nouveau_fbcon_release(struct fb_info *info, int user)
+{
+	struct nouveau_fbdev *fbcon = info->par;
+	struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
+	pm_runtime_put(drm->dev->dev);
+	return 0;
+}
+
 static struct fb_ops nouveau_fbcon_ops = {
 	.owner = THIS_MODULE,
+	.fb_open = nouveau_fbcon_open,
+	.fb_release = nouveau_fbcon_release,
 	.fb_check_var = drm_fb_helper_check_var,
 	.fb_set_par = drm_fb_helper_set_par,
 	.fb_fillrect = nouveau_fbcon_fillrect,
@@ -195,6 +217,8 @@ static struct fb_ops nouveau_fbcon_ops = {
 
 static struct fb_ops nouveau_fbcon_sw_ops = {
 	.owner = THIS_MODULE,
+	.fb_open = nouveau_fbcon_open,
+	.fb_release = nouveau_fbcon_release,
 	.fb_check_var = drm_fb_helper_check_var,
 	.fb_set_par = drm_fb_helper_set_par,
 	.fb_fillrect = cfb_fillrect,
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] drm/radeon: add pm sysfs files late
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (17 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] dm thin: fix missing pool reference count decrement in pool_ctr error path Sasha Levin
                   ` (38 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Alex Deucher, Sasha Levin

From: Alex Deucher <alexander.deucher@amd.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 51a4726b04e880fdd9b4e0e58b13f70b0a68a7f5 ]

They were added relatively early in the driver init process
which meant that in some cases the driver was not finished
initializing before external tools tried to use them which
could result in a crash depending on the timing.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/gpu/drm/radeon/radeon_display.c | 14 ++------
 drivers/gpu/drm/radeon/radeon_pm.c      | 63 ++++++++++++++++++++-------------
 2 files changed, 40 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 2e1e9aa..21e6e97 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1619,18 +1619,8 @@ int radeon_modeset_init(struct radeon_device *rdev)
 	radeon_fbdev_init(rdev);
 	drm_kms_helper_poll_init(rdev->ddev);
 
-	if (rdev->pm.dpm_enabled) {
-		/* do dpm late init */
-		ret = radeon_pm_late_init(rdev);
-		if (ret) {
-			rdev->pm.dpm_enabled = false;
-			DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");
-		}
-		/* set the dpm state for PX since there won't be
-		 * a modeset to call this.
-		 */
-		radeon_pm_compute_clocks(rdev);
-	}
+	/* do pm late init */
+	ret = radeon_pm_late_init(rdev);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 1d94b54..d22cf0d 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1192,14 +1192,6 @@ static int radeon_pm_init_old(struct radeon_device *rdev)
 	INIT_DELAYED_WORK(&rdev->pm.dynpm_idle_work, radeon_dynpm_idle_work_handler);
 
 	if (rdev->pm.num_power_states > 1) {
-		/* where's the best place to put these? */
-		ret = device_create_file(rdev->dev, &dev_attr_power_profile);
-		if (ret)
-			DRM_ERROR("failed to create device file for power profile\n");
-		ret = device_create_file(rdev->dev, &dev_attr_power_method);
-		if (ret)
-			DRM_ERROR("failed to create device file for power method\n");
-
 		if (radeon_debugfs_pm_init(rdev)) {
 			DRM_ERROR("Failed to register debugfs file for PM!\n");
 		}
@@ -1257,20 +1249,6 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev)
 		goto dpm_failed;
 	rdev->pm.dpm_enabled = true;
 
-	ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
-	if (ret)
-		DRM_ERROR("failed to create device file for dpm state\n");
-	ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
-	if (ret)
-		DRM_ERROR("failed to create device file for dpm state\n");
-	/* XXX: these are noops for dpm but are here for backwards compat */
-	ret = device_create_file(rdev->dev, &dev_attr_power_profile);
-	if (ret)
-		DRM_ERROR("failed to create device file for power profile\n");
-	ret = device_create_file(rdev->dev, &dev_attr_power_method);
-	if (ret)
-		DRM_ERROR("failed to create device file for power method\n");
-
 	if (radeon_debugfs_pm_init(rdev)) {
 		DRM_ERROR("Failed to register debugfs file for dpm!\n");
 	}
@@ -1411,9 +1389,44 @@ int radeon_pm_late_init(struct radeon_device *rdev)
 	int ret = 0;
 
 	if (rdev->pm.pm_method == PM_METHOD_DPM) {
-		mutex_lock(&rdev->pm.mutex);
-		ret = radeon_dpm_late_enable(rdev);
-		mutex_unlock(&rdev->pm.mutex);
+		if (rdev->pm.dpm_enabled) {
+			ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
+			if (ret)
+				DRM_ERROR("failed to create device file for dpm state\n");
+			ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
+			if (ret)
+				DRM_ERROR("failed to create device file for dpm state\n");
+			/* XXX: these are noops for dpm but are here for backwards compat */
+			ret = device_create_file(rdev->dev, &dev_attr_power_profile);
+			if (ret)
+				DRM_ERROR("failed to create device file for power profile\n");
+			ret = device_create_file(rdev->dev, &dev_attr_power_method);
+			if (ret)
+				DRM_ERROR("failed to create device file for power method\n");
+
+			mutex_lock(&rdev->pm.mutex);
+			ret = radeon_dpm_late_enable(rdev);
+			mutex_unlock(&rdev->pm.mutex);
+			if (ret) {
+				rdev->pm.dpm_enabled = false;
+				DRM_ERROR("radeon_pm_late_init failed, disabling dpm\n");
+			} else {
+				/* set the dpm state for PX since there won't be
+				 * a modeset to call this.
+				 */
+				radeon_pm_compute_clocks(rdev);
+			}
+		}
+	} else {
+		if (rdev->pm.num_power_states > 1) {
+			/* where's the best place to put these? */
+			ret = device_create_file(rdev->dev, &dev_attr_power_profile);
+			if (ret)
+				DRM_ERROR("failed to create device file for power profile\n");
+			ret = device_create_file(rdev->dev, &dev_attr_power_method);
+			if (ret)
+				DRM_ERROR("failed to create device file for power method\n");
+		}
 	}
 	return ret;
 }
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] dm thin: fix missing pool reference count decrement in pool_ctr error path
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (18 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] drm/radeon: add pm sysfs files late Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] rbd: fix double free on rbd_dev->header_name Sasha Levin
                   ` (37 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Mike Snitzer, Sasha Levin

From: Mike Snitzer <snitzer@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit ba30670f4d5292c4e7f7980bbd5071f7c4794cdd ]

Fixes: ac8c3f3df ("dm thin: generate event when metadata threshold passed")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/dm-thin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 0801e35..a7c9685 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2596,7 +2596,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
 						metadata_low_callback,
 						pool);
 	if (r)
-		goto out_free_pt;
+		goto out_flags_changed;
 
 	pt->callbacks.congested_fn = pool_is_congested;
 	dm_table_add_target_callbacks(ti->table, &pt->callbacks);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] rbd: fix double free on rbd_dev->header_name
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (19 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] dm thin: fix missing pool reference count decrement in pool_ctr error path Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] lib/radix-tree.c: change to simpler include Sasha Levin
                   ` (36 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Ilya Dryomov, Sasha Levin

From: Ilya Dryomov <idryomov@gmail.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 3ebe138ac642a195c7f2efdb918f464734421fd6 ]

If rbd_dev_image_probe() in rbd_dev_probe_parent() fails, header_name
is freed twice: once in rbd_dev_probe_parent() and then in its caller
rbd_dev_image_probe() (rbd_dev_image_probe() is called recursively to
handle parent images).

rbd_dev_probe_parent() is responsible for probing the parent, so it
shouldn't muck with clone's fields.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/block/rbd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index dc1ca84..7327c36 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5198,7 +5198,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)
 out_err:
 	if (parent) {
 		rbd_dev_unparent(rbd_dev);
-		kfree(rbd_dev->header_name);
 		rbd_dev_destroy(parent);
 	} else {
 		rbd_put_client(rbdc);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] lib/radix-tree.c: change to simpler include
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (20 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] rbd: fix double free on rbd_dev->header_name Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ath9k: declare required extra tx headroom Sasha Levin
                   ` (35 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Rasmus Villemoes, Andrew Morton, Linus Torvalds, Sasha Levin

From: Rasmus Villemoes <linux@rasmusvillemoes.dk>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 886d3dfa85d5aa6f11813c319e50f5402c7cf4e4 ]

The comment helpfully explains why hardirq.h is included, but since
commit 2d4b84739f0a ("hardirq: Split preempt count mask definitions")
in_interrupt() has been provided by preempt_mask.h.  Use that instead,
saving around 40 lines in the generated dependency file.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 lib/radix-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 3291a8e..3d2aa27 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -33,7 +33,7 @@
 #include <linux/string.h>
 #include <linux/bitops.h>
 #include <linux/rcupdate.h>
-#include <linux/hardirq.h>		/* in_interrupt() */
+#include <linux/preempt_mask.h>		/* in_interrupt() */
 
 
 /*
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] ath9k: declare required extra tx headroom
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (21 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] lib/radix-tree.c: change to simpler include Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: dvm: fix D3 firmware PN programming Sasha Levin
                   ` (34 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Felix Fietkau, Kalle Valo, Sasha Levin

From: Felix Fietkau <nbd@openwrt.org>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 029cd0370241641eb70235d205aa0b90c84dce44 ]

ath9k inserts padding between the 802.11 header and the data area (to
align it). Since it didn't declare this extra required headroom, this
led to some nasty issues like randomly dropped packets in some setups.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/wireless/ath/ath9k/init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 3bd0304..ee15a57 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -821,6 +821,7 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 	hw->max_rate_tries = 10;
 	hw->sta_data_size = sizeof(struct ath_node);
 	hw->vif_data_size = sizeof(struct ath_vif);
+	hw->extra_tx_headroom = 4;
 
 	hw->wiphy->available_antennas_rx = BIT(ah->caps.max_rxchains) - 1;
 	hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iwlwifi: dvm: fix D3 firmware PN programming
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (22 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ath9k: declare required extra tx headroom Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: fix firmware filename for 3160 Sasha Levin
                   ` (33 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Johannes Berg, Luca Coelho, Sasha Levin

From: Johannes Berg <johannes.berg@intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 5bd166872d8f99f156fac191299d24f828bb2348 ]

The code to send the RX PN data (for each TID) to the firmware
has a devastating bug: it overwrites the data for TID 0 with
all the TID data, leaving the remaining TIDs zeroed. This will
allow replays to actually be accepted by the firmware, which
could allow waking up the system.

Cc: <stable@vger.kernel.org> [3.1+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/wireless/iwlwifi/dvm/lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlwifi/dvm/lib.c b/drivers/net/wireless/iwlwifi/dvm/lib.c
index cfe1293..b51fb89 100644
--- a/drivers/net/wireless/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/iwlwifi/dvm/lib.c
@@ -1022,7 +1022,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,
 			u8 *pn = seq.ccmp.pn;
 
 			ieee80211_get_key_rx_seq(key, i, &seq);
-			aes_sc->pn = cpu_to_le64(
+			aes_sc[i].pn = cpu_to_le64(
 					(u64)pn[5] |
 					((u64)pn[4] << 8) |
 					((u64)pn[3] << 16) |
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iwlwifi: fix firmware filename for 3160
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (23 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: dvm: fix D3 firmware PN programming Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: pcie: support 7265-D devices Sasha Levin
                   ` (32 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Johannes Berg, Luca Coelho, Sasha Levin

From: Johannes Berg <johannes.berg@intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit b5a48134f8af08f5243328f8a0b05fc5ae7cf343 ]

The MODULE_FIRMWARE() for 3160 should be using the 7260 version as
it's done in the device configuration struct instead of referencing
IWL3160_UCODE_API_OK which doesn't even exist.

Cc: <stable@vger.kernel.org> [3.8+]
Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/wireless/iwlwifi/iwl-7000.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c
index b04b885..76f6032 100644
--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
@@ -268,6 +268,5 @@ const struct iwl_cfg iwl7265_n_cfg = {
 };
 
 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
-MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));
-MODULE_FIRMWARE(IWL3165_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));
+MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
 MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iwlwifi: pcie: support 7265-D devices
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (24 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: fix firmware filename for 3160 Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: mvm: fix D3 firmware PN programming Sasha Levin
                   ` (31 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Johannes Berg, Emmanuel Grumbach, Sasha Levin

From: Johannes Berg <johannes.berg@intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 3fd0d3c170ad6ba8b64e16938f699d0b43cc782e ]

Identify 7265-D devices using the hardware revision (they have the
same PCI IDs as 7265) and change the configuration for them taking
the differences (currently only the firmware image) into account.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/wireless/iwlwifi/iwl-7000.c   | 34 ++++++++++++++++++++++++++++++
 drivers/net/wireless/iwlwifi/iwl-config.h |  3 +++
 drivers/net/wireless/iwlwifi/iwl-csr.h    | 35 ++++++++++++++++---------------
 drivers/net/wireless/iwlwifi/pcie/drv.c   | 20 ++++++++++++++++++
 4 files changed, 75 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c
index 76f6032..9dfd1d1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-7000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-7000.c
@@ -102,6 +102,9 @@
 #define IWL7265_FW_PRE "iwlwifi-7265-"
 #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode"
 
+#define IWL7265D_FW_PRE "iwlwifi-7265D-"
+#define IWL7265D_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode"
+
 #define NVM_HW_SECTION_NUM_FAMILY_7000		0
 
 static const struct iwl_base_params iwl7000_base_params = {
@@ -267,6 +270,37 @@ const struct iwl_cfg iwl7265_n_cfg = {
 	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
 };
 
+const struct iwl_cfg iwl7265d_2ac_cfg = {
+	.name = "Intel(R) Dual Band Wireless AC 7265",
+	.fw_name_pre = IWL7265D_FW_PRE,
+	IWL_DEVICE_7000,
+	.ht_params = &iwl7265_ht_params,
+	.nvm_ver = IWL7265_NVM_VERSION,
+	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
+	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
+};
+
+const struct iwl_cfg iwl7265d_2n_cfg = {
+	.name = "Intel(R) Dual Band Wireless N 7265",
+	.fw_name_pre = IWL7265D_FW_PRE,
+	IWL_DEVICE_7000,
+	.ht_params = &iwl7265_ht_params,
+	.nvm_ver = IWL7265_NVM_VERSION,
+	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
+	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
+};
+
+const struct iwl_cfg iwl7265d_n_cfg = {
+	.name = "Intel(R) Wireless N 7265",
+	.fw_name_pre = IWL7265D_FW_PRE,
+	IWL_DEVICE_7000,
+	.ht_params = &iwl7265_ht_params,
+	.nvm_ver = IWL7265_NVM_VERSION,
+	.nvm_calib_ver = IWL7265_TX_POWER_VERSION,
+	.pwr_tx_backoffs = iwl7265_pwr_tx_backoffs,
+};
+
 MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
 MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
 MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
+MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h
index 2ef83a3..6cc051c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/iwlwifi/iwl-config.h
@@ -346,6 +346,9 @@ extern const struct iwl_cfg iwl3165_2ac_cfg;
 extern const struct iwl_cfg iwl7265_2ac_cfg;
 extern const struct iwl_cfg iwl7265_2n_cfg;
 extern const struct iwl_cfg iwl7265_n_cfg;
+extern const struct iwl_cfg iwl7265d_2ac_cfg;
+extern const struct iwl_cfg iwl7265d_2n_cfg;
+extern const struct iwl_cfg iwl7265d_n_cfg;
 extern const struct iwl_cfg iwl8260_2n_cfg;
 extern const struct iwl_cfg iwl8260_2ac_cfg;
 extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;
diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h
index 3f6f015..671bdbc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/iwlwifi/iwl-csr.h
@@ -305,23 +305,24 @@ enum {
 };
 
 
-#define CSR_HW_REV_TYPE_MSK            (0x000FFF0)
-#define CSR_HW_REV_TYPE_5300           (0x0000020)
-#define CSR_HW_REV_TYPE_5350           (0x0000030)
-#define CSR_HW_REV_TYPE_5100           (0x0000050)
-#define CSR_HW_REV_TYPE_5150           (0x0000040)
-#define CSR_HW_REV_TYPE_1000           (0x0000060)
-#define CSR_HW_REV_TYPE_6x00           (0x0000070)
-#define CSR_HW_REV_TYPE_6x50           (0x0000080)
-#define CSR_HW_REV_TYPE_6150           (0x0000084)
-#define CSR_HW_REV_TYPE_6x05	       (0x00000B0)
-#define CSR_HW_REV_TYPE_6x30	       CSR_HW_REV_TYPE_6x05
-#define CSR_HW_REV_TYPE_6x35	       CSR_HW_REV_TYPE_6x05
-#define CSR_HW_REV_TYPE_2x30	       (0x00000C0)
-#define CSR_HW_REV_TYPE_2x00	       (0x0000100)
-#define CSR_HW_REV_TYPE_105	       (0x0000110)
-#define CSR_HW_REV_TYPE_135	       (0x0000120)
-#define CSR_HW_REV_TYPE_NONE           (0x00001F0)
+#define CSR_HW_REV_TYPE_MSK		(0x000FFF0)
+#define CSR_HW_REV_TYPE_5300		(0x0000020)
+#define CSR_HW_REV_TYPE_5350		(0x0000030)
+#define CSR_HW_REV_TYPE_5100		(0x0000050)
+#define CSR_HW_REV_TYPE_5150		(0x0000040)
+#define CSR_HW_REV_TYPE_1000		(0x0000060)
+#define CSR_HW_REV_TYPE_6x00		(0x0000070)
+#define CSR_HW_REV_TYPE_6x50		(0x0000080)
+#define CSR_HW_REV_TYPE_6150		(0x0000084)
+#define CSR_HW_REV_TYPE_6x05		(0x00000B0)
+#define CSR_HW_REV_TYPE_6x30		CSR_HW_REV_TYPE_6x05
+#define CSR_HW_REV_TYPE_6x35		CSR_HW_REV_TYPE_6x05
+#define CSR_HW_REV_TYPE_2x30		(0x00000C0)
+#define CSR_HW_REV_TYPE_2x00		(0x0000100)
+#define CSR_HW_REV_TYPE_105		(0x0000110)
+#define CSR_HW_REV_TYPE_135		(0x0000120)
+#define CSR_HW_REV_TYPE_7265D		(0x0000210)
+#define CSR_HW_REV_TYPE_NONE		(0x00001F0)
 
 /* EEPROM REG */
 #define CSR_EEPROM_REG_READ_VALID_MSK	(0x00000001)
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index 05cba8c..2f0c4b1 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -503,6 +503,7 @@ static void set_dflt_pwr_limit(struct iwl_trans *trans, struct pci_dev *pdev) {}
 static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
+	const struct iwl_cfg *cfg_7265d __maybe_unused = NULL;
 	struct iwl_trans *iwl_trans;
 	struct iwl_trans_pcie *trans_pcie;
 	int ret;
@@ -511,6 +512,25 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (IS_ERR(iwl_trans))
 		return PTR_ERR(iwl_trans);
 
+#if IS_ENABLED(CONFIG_IWLMVM)
+	/*
+	 * special-case 7265D, it has the same PCI IDs.
+	 *
+	 * Note that because we already pass the cfg to the transport above,
+	 * all the parameters that the transport uses must, until that is
+	 * changed, be identical to the ones in the 7265D configuration.
+	 */
+	if (cfg == &iwl7265_2ac_cfg)
+		cfg_7265d = &iwl7265d_2ac_cfg;
+	else if (cfg == &iwl7265_2n_cfg)
+		cfg_7265d = &iwl7265d_2n_cfg;
+	else if (cfg == &iwl7265_n_cfg)
+		cfg_7265d = &iwl7265d_n_cfg;
+	if (cfg_7265d &&
+	    (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D)
+		cfg = cfg_7265d;
+#endif
+
 	pci_set_drvdata(pdev, iwl_trans);
 
 	trans_pcie = IWL_TRANS_GET_PCIE_TRANS(iwl_trans);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iwlwifi: mvm: fix D3 firmware PN programming
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (25 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: pcie: support 7265-D devices Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: pci: add a few more PCI subvendor IDs for the 7265 series Sasha Levin
                   ` (30 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Johannes Berg, Luca Coelho, Sasha Levin

From: Johannes Berg <johannes.berg@intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 2cf5eb3ab7bb7f2e3a70edcef236cd62c87db030 ]

The code to send the RX PN data (for each TID) to the firmware
has a devastating bug: it overwrites the data for TID 0 with
all the TID data, leaving the remaining TIDs zeroed. This will
allow replays to actually be accepted by the firmware, which
could allow waking up the system.

Cc: <stable@vger.kernel.org> [3.1+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/wireless/iwlwifi/mvm/d3.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index c17be0f..8da34a5 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -298,12 +298,12 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
 			u8 *pn = seq.ccmp.pn;
 
 			ieee80211_get_key_rx_seq(key, i, &seq);
-			aes_sc->pn = cpu_to_le64((u64)pn[5] |
-						 ((u64)pn[4] << 8) |
-						 ((u64)pn[3] << 16) |
-						 ((u64)pn[2] << 24) |
-						 ((u64)pn[1] << 32) |
-						 ((u64)pn[0] << 40));
+			aes_sc[i].pn = cpu_to_le64((u64)pn[5] |
+						   ((u64)pn[4] << 8) |
+						   ((u64)pn[3] << 16) |
+						   ((u64)pn[2] << 24) |
+						   ((u64)pn[1] << 32) |
+						   ((u64)pn[0] << 40));
 		}
 		data->use_rsc_tsc = true;
 		break;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iwlwifi: pci: add a few more PCI subvendor IDs for the 7265 series
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (26 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: mvm: fix D3 firmware PN programming Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iommu/amd: Don't clear DTE flags when modifying it Sasha Levin
                   ` (29 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Luca Coelho, stable, Sasha Levin

From: Luca Coelho <luciano.coelho@intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit f08f625876476b6c4a87834dc86e3b927f4697d2 ]

Add 3 new subdevice IDs for the 0x095A device ID and 2 for the 0x095B
device ID.

Cc: <stable@vger.kernerl.org> [3.13+]
Reported-by: Jeremy <jeremy.bomkamp@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/wireless/iwlwifi/pcie/drv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index 2f0c4b1..a2f624d 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -410,6 +410,11 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 	{IWL_PCI_DEVICE(0x095A, 0x5590, iwl7265_2ac_cfg)},
 	{IWL_PCI_DEVICE(0x095B, 0x5290, iwl7265_2ac_cfg)},
 	{IWL_PCI_DEVICE(0x095A, 0x5490, iwl7265_2ac_cfg)},
+	{IWL_PCI_DEVICE(0x095A, 0x5F10, iwl7265_2ac_cfg)},
+	{IWL_PCI_DEVICE(0x095B, 0x5212, iwl7265_2ac_cfg)},
+	{IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)},
+	{IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)},
+	{IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)},
 
 /* 8000 Series */
 	{IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)},
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iommu/amd: Don't clear DTE flags when modifying it
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (27 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: pci: add a few more PCI subvendor IDs for the 7265 series Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] powerpc/rtas: Validate rtas.entry before calling enter_rtas() Sasha Levin
                   ` (28 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Joerg Roedel, Sasha Levin

From: Joerg Roedel <jroedel@suse.de>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit cbf3ccd09d683abf1cacd36e3640872ee912d99b ]

During device assignment/deassignment the flags in the DTE
get lost, which might cause spurious faults, for example
when the device tries to access the system management range.
Fix this by not clearing the flags with the rest of the DTE.

Reported-by: G. Richard Bellamy <rbellamy@pteradigm.com>
Tested-by: G. Richard Bellamy <rbellamy@pteradigm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/iommu/amd_iommu.c       | 4 ++--
 drivers/iommu/amd_iommu_types.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index fab0ea1..9feea72 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2100,8 +2100,8 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain, bool ats)
 static void clear_dte_entry(u16 devid)
 {
 	/* remove entry from the device table seen by the hardware */
-	amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
-	amd_iommu_dev_table[devid].data[1] = 0;
+	amd_iommu_dev_table[devid].data[0]  = IOMMU_PTE_P | IOMMU_PTE_TV;
+	amd_iommu_dev_table[devid].data[1] &= DTE_FLAG_MASK;
 
 	amd_iommu_apply_erratum_63(devid);
 }
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index cec51a8..791442a 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -289,6 +289,7 @@
 #define IOMMU_PTE_IR (1ULL << 61)
 #define IOMMU_PTE_IW (1ULL << 62)
 
+#define DTE_FLAG_MASK	(0x3ffULL << 32)
 #define DTE_FLAG_IOTLB	(0x01UL << 32)
 #define DTE_FLAG_GV	(0x01ULL << 55)
 #define DTE_GLX_SHIFT	(56)
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] powerpc/rtas: Validate rtas.entry before calling enter_rtas()
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (28 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] iommu/amd: Don't clear DTE flags when modifying it Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ASoC: wm8904: Correct number of EQ registers Sasha Levin
                   ` (27 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Vasant Hegde, Michael Ellerman, Sasha Levin

From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 8832317f662c06f5c06e638f57bfe89a71c9b266 ]

Currently we do not validate rtas.entry before calling enter_rtas(). This
leads to a kernel oops when user space calls rtas system call on a powernv
platform (see below). This patch adds code to validate rtas.entry before
making enter_rtas() call.

  Oops: Exception in kernel mode, sig: 4 [#1]
  SMP NR_CPUS=1024 NUMA PowerNV
  task: c000000004294b80 ti: c0000007e1a78000 task.ti: c0000007e1a78000
  NIP: 0000000000000000 LR: 0000000000009c14 CTR: c000000000423140
  REGS: c0000007e1a7b920 TRAP: 0e40   Not tainted  (3.18.17-340.el7_1.pkvm3_1_0.2400.1.ppc64le)
  MSR: 1000000000081000 <HV,ME>  CR: 00000000  XER: 00000000
  CFAR: c000000000009c0c SOFTE: 0
  NIP [0000000000000000]           (null)
  LR [0000000000009c14] 0x9c14
  Call Trace:
  [c0000007e1a7bba0] [c00000000041a7f4] avc_has_perm_noaudit+0x54/0x110 (unreliable)
  [c0000007e1a7bd80] [c00000000002ddc0] ppc_rtas+0x150/0x2d0
  [c0000007e1a7be30] [c000000000009358] syscall_exit+0x0/0x98

Cc: stable@vger.kernel.org # v3.2+
Fixes: 55190f88789a ("powerpc: Add skeleton PowerNV platform")
Reported-by: NAGESWARA R. SASTRY <nasastry@in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[mpe: Reword change log, trim oops, and add stable + fixes]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 arch/powerpc/kernel/rtas.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index af0dafa..79c459a 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1045,6 +1045,9 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
+	if (!rtas.entry)
+		return -EINVAL;
+
 	if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
 		return -EFAULT;
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] ASoC: wm8904: Correct number of EQ registers
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (29 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] powerpc/rtas: Validate rtas.entry before calling enter_rtas() Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:03 ` [added to the 3.18 stable tree] mm: make sendfile(2) killable Sasha Levin
                   ` (26 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Charles Keepax, Mark Brown, Sasha Levin

From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 97aff2c03a1e4d343266adadb52313613efb027f ]

There are 24 EQ registers not 25, I suspect this bug came about because
the registers start at EQ1 not zero. The bug is relatively harmless as
the extra register written is an unused one.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 include/sound/wm8904.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sound/wm8904.h b/include/sound/wm8904.h
index 898be3a..6d8f8fb 100644
--- a/include/sound/wm8904.h
+++ b/include/sound/wm8904.h
@@ -119,7 +119,7 @@
 #define WM8904_MIC_REGS  2
 #define WM8904_GPIO_REGS 4
 #define WM8904_DRC_REGS  4
-#define WM8904_EQ_REGS   25
+#define WM8904_EQ_REGS   24
 
 /**
  * DRC configurations are specified with a label and a set of register
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] mm: make sendfile(2) killable
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (30 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] ASoC: wm8904: Correct number of EQ registers Sasha Levin
@ 2015-11-16  4:03 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] sfc: Fix memcpy() with const destination compiler warning Sasha Levin
                   ` (25 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:03 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Jan Kara, Al Viro, Andrew Morton, Linus Torvalds, Sasha Levin

From: Jan Kara <jack@suse.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 296291cdd1629c308114504b850dc343eabc2782 ]

Currently a simple program below issues a sendfile(2) system call which
takes about 62 days to complete in my test KVM instance.

        int fd;
        off_t off = 0;

        fd = open("file", O_RDWR | O_TRUNC | O_SYNC | O_CREAT, 0644);
        ftruncate(fd, 2);
        lseek(fd, 0, SEEK_END);
        sendfile(fd, fd, &off, 0xfffffff);

Now you should not ask kernel to do a stupid stuff like copying 256MB in
2-byte chunks and call fsync(2) after each chunk but if you do, sysadmin
should have a way to stop you.

We actually do have a check for fatal_signal_pending() in
generic_perform_write() which triggers in this path however because we
always succeed in writing something before the check is done, we return
value > 0 from generic_perform_write() and thus the information about
signal gets lost.

Fix the problem by doing the signal check before writing anything.  That
way generic_perform_write() returns -EINTR, the error gets propagated up
and the sendfile loop terminates early.

Signed-off-by: Jan Kara <jack@suse.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 mm/filemap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 37beab9..7e6ab98 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2489,6 +2489,11 @@ again:
 			break;
 		}
 
+		if (fatal_signal_pending(current)) {
+			status = -EINTR;
+			break;
+		}
+
 		status = a_ops->write_begin(file, mapping, pos, bytes, flags,
 						&page, &fsdata);
 		if (unlikely(status < 0))
@@ -2526,10 +2531,6 @@ again:
 		written += copied;
 
 		balance_dirty_pages_ratelimited(mapping);
-		if (fatal_signal_pending(current)) {
-			status = -EINTR;
-			break;
-		}
 	} while (iov_iter_count(i));
 
 	return written ? written : status;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] sfc: Fix memcpy() with const destination compiler warning.
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (31 preceding siblings ...)
  2015-11-16  4:03 ` [added to the 3.18 stable tree] mm: make sendfile(2) killable Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] power: bq24190_charger: suppress build warning Sasha Levin
                   ` (24 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: David S. Miller, Sasha Levin

From: "David S. Miller" <davem@davemloft.net>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 1d20a16062e771b6e26b843c0cde3b17c1146e00 ]

drivers/net/ethernet/sfc/selftest.c: In function ‘efx_iterate_state’:
drivers/net/ethernet/sfc/selftest.c:388:9: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]

This is because the msg[] member of struct efx_loopback_payload
is marked as 'const'.  Remove that.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/ethernet/sfc/selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index 10b6173..b605dfd5 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -46,7 +46,7 @@ struct efx_loopback_payload {
 	struct iphdr ip;
 	struct udphdr udp;
 	__be16 iteration;
-	const char msg[64];
+	char msg[64];
 } __packed;
 
 /* Loopback test source MAC address */
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] power: bq24190_charger: suppress build warning
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (32 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] sfc: Fix memcpy() with const destination compiler warning Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/nouveau/gem: return only valid domain when there's only one Sasha Levin
                   ` (23 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Lad, Prabhakar, Sebastian Reichel, Sasha Levin

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 31f50e48e3e4ea9d503285a389d6a1b5349d66c0 ]

This patch fixes following build warning:

In file included from include/linux/printk.h:261:0,
                 from include/linux/kernel.h:13,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from drivers/power/bq24190_charger.c:11:
drivers/power/bq24190_charger.c: In function ‘bq24190_irq_handler_thread’:
include/linux/dynamic_debug.h:86:20: warning: ‘ss_reg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   __dynamic_dev_dbg(&descriptor, dev, fmt, \
                    ^
drivers/power/bq24190_charger.c:1211:5: note: ‘ss_reg’ was declared here
  u8 ss_reg, f_reg;
     ^
In file included from include/linux/printk.h:261:0,
                 from include/linux/kernel.h:13,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from drivers/power/bq24190_charger.c:11:
include/linux/dynamic_debug.h:86:20: warning: ‘f_reg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   __dynamic_dev_dbg(&descriptor, dev, fmt, \
                    ^
drivers/power/bq24190_charger.c:1211:13: note: ‘f_reg’ was declared here
  u8 ss_reg, f_reg;

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/power/bq24190_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/bq24190_charger.c b/drivers/power/bq24190_charger.c
index e4c95e1..d0e8236 100644
--- a/drivers/power/bq24190_charger.c
+++ b/drivers/power/bq24190_charger.c
@@ -1208,7 +1208,7 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
 {
 	struct bq24190_dev_info *bdi = data;
 	bool alert_userspace = false;
-	u8 ss_reg, f_reg;
+	u8 ss_reg = 0, f_reg = 0;
 	int ret;
 
 	pm_runtime_get_sync(bdi->dev);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] drm/nouveau/gem: return only valid domain when there's only one
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (33 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] power: bq24190_charger: suppress build warning Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/i915: Restore lost DPLL register write on gen2-4 Sasha Levin
                   ` (22 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Ilia Mirkin, Ben Skeggs, Sasha Levin

From: Ilia Mirkin <imirkin@alum.mit.edu>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 2a6c521bb41ce862e43db46f52e7681d33e8d771 ]

On nv50+, we restrict the valid domains to just the one where the buffer
was originally created. However after the buffer is evicted to system
memory, we might move it back to a different domain that was not
originally valid. When sharing the buffer and retrieving its GEM_INFO
data, we still want the domain that will be valid for this buffer in a
pushbuf, not the one where it currently happens to be.

This resolves fdo#92504 and several others. These are due to suspend
evicting all buffers, making it more likely that they temporarily end up
in the wrong place.

Cc: stable@vger.kernel.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92504
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/gpu/drm/nouveau/nouveau_gem.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 36951ee..9fcc77d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -199,11 +199,12 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem,
 	struct nouveau_bo *nvbo = nouveau_gem_object(gem);
 	struct nouveau_vma *vma;
 
-	if (nvbo->bo.mem.mem_type == TTM_PL_TT)
+	if (is_power_of_2(nvbo->valid_domains))
+		rep->domain = nvbo->valid_domains;
+	else if (nvbo->bo.mem.mem_type == TTM_PL_TT)
 		rep->domain = NOUVEAU_GEM_DOMAIN_GART;
 	else
 		rep->domain = NOUVEAU_GEM_DOMAIN_VRAM;
-
 	rep->offset = nvbo->bo.offset;
 	if (cli->vm) {
 		vma = nouveau_bo_vma_find(nvbo, cli->vm);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] drm/i915: Restore lost DPLL register write on gen2-4
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (34 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/nouveau/gem: return only valid domain when there's only one Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/radeon: don't try to recreate sysfs entries on resume Sasha Levin
                   ` (21 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Ville Syrjälä, Nick Bowler, Jani Nikula, Sasha Levin

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 8e7a65aa70bcc1235a44e40ae0da5056525fe081 ]

We accidentally lost the initial DPLL register write in
1c4e02746147 drm/i915: Fix DVO 2x clock enable on 830M

The "three times for luck" hack probably saved us from a total
disaster. But anyway, bring the initial write back so that the
code actually makes some sense.

Reported-and-tested-by: Nick Bowler <nbowler@draconx.ca>
References: http://mid.gmane.org/CAN_QmVyMaArxYgEcVVsGvsMo7-6ohZr8HmF5VhkkL4i9KOmrhw@mail.gmail.com
Cc: stable@vger.kernel.org
Cc: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 448327f..60c68e3c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1650,6 +1650,8 @@ static void i9xx_enable_pll(struct intel_crtc *crtc)
 			   I915_READ(DPLL(!crtc->pipe)) | DPLL_DVO_2X_MODE);
 	}
 
+	I915_WRITE(reg, dpll);
+
 	/* Wait for the clocks to stabilize. */
 	POSTING_READ(reg);
 	udelay(150);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] drm/radeon: don't try to recreate sysfs entries on resume
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (35 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/i915: Restore lost DPLL register write on gen2-4 Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] iio: mxs-lradc: Fix temperature offset Sasha Levin
                   ` (20 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Alex Deucher, Sasha Levin

From: Alex Deucher <alexander.deucher@amd.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 49abb26651167c892393cd9f2ad23df429645ed9 ]

Fixes a harmless error message caused by:
51a4726b04e880fdd9b4e0e58b13f70b0a68a7f5

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/gpu/drm/radeon/radeon.h    |  1 +
 drivers/gpu/drm/radeon/radeon_pm.c | 35 +++++++++++++++++++++--------------
 2 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index d6f0e40..ee38f9a 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1628,6 +1628,7 @@ struct radeon_pm {
 	struct device	        *int_hwmon_dev;
 	/* dpm */
 	bool                    dpm_enabled;
+	bool                    sysfs_initialized;
 	struct radeon_dpm       dpm;
 };
 
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index d22cf0d..fa537c0 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1390,19 +1390,23 @@ int radeon_pm_late_init(struct radeon_device *rdev)
 
 	if (rdev->pm.pm_method == PM_METHOD_DPM) {
 		if (rdev->pm.dpm_enabled) {
-			ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
-			if (ret)
-				DRM_ERROR("failed to create device file for dpm state\n");
-			ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
-			if (ret)
-				DRM_ERROR("failed to create device file for dpm state\n");
-			/* XXX: these are noops for dpm but are here for backwards compat */
-			ret = device_create_file(rdev->dev, &dev_attr_power_profile);
-			if (ret)
-				DRM_ERROR("failed to create device file for power profile\n");
-			ret = device_create_file(rdev->dev, &dev_attr_power_method);
-			if (ret)
-				DRM_ERROR("failed to create device file for power method\n");
+			if (!rdev->pm.sysfs_initialized) {
+				ret = device_create_file(rdev->dev, &dev_attr_power_dpm_state);
+				if (ret)
+					DRM_ERROR("failed to create device file for dpm state\n");
+				ret = device_create_file(rdev->dev, &dev_attr_power_dpm_force_performance_level);
+				if (ret)
+					DRM_ERROR("failed to create device file for dpm state\n");
+				/* XXX: these are noops for dpm but are here for backwards compat */
+				ret = device_create_file(rdev->dev, &dev_attr_power_profile);
+				if (ret)
+					DRM_ERROR("failed to create device file for power profile\n");
+				ret = device_create_file(rdev->dev, &dev_attr_power_method);
+				if (ret)
+					DRM_ERROR("failed to create device file for power method\n");
+				if (!ret)
+					rdev->pm.sysfs_initialized = true;
+			}
 
 			mutex_lock(&rdev->pm.mutex);
 			ret = radeon_dpm_late_enable(rdev);
@@ -1418,7 +1422,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
 			}
 		}
 	} else {
-		if (rdev->pm.num_power_states > 1) {
+		if ((rdev->pm.num_power_states > 1) &&
+		    (!rdev->pm.sysfs_initialized)) {
 			/* where's the best place to put these? */
 			ret = device_create_file(rdev->dev, &dev_attr_power_profile);
 			if (ret)
@@ -1426,6 +1431,8 @@ int radeon_pm_late_init(struct radeon_device *rdev)
 			ret = device_create_file(rdev->dev, &dev_attr_power_method);
 			if (ret)
 				DRM_ERROR("failed to create device file for power method\n");
+			if (!ret)
+				rdev->pm.sysfs_initialized = true;
 		}
 	}
 	return ret;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] iio: mxs-lradc: Fix temperature offset
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (36 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/radeon: don't try to recreate sysfs entries on resume Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] rbd: require stable pages if message data CRCs are enabled Sasha Levin
                   ` (19 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Alexandre Belloni, Jonathan Cameron, Sasha Levin

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit b94e22805a2224061bb263a82b72e09544a5fbb3 ]

0° Kelvin is actually −273.15°C, not -272.15°C. Fix the temperature offset.
Also improve the comment explaining the calculation.

Reported-by: Janusz Użycki <j.uzycki@elpromaelectronics.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Marek Vasut <marex@denx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/staging/iio/adc/mxs-lradc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index ffd4207..6050c58 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -910,11 +910,12 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
 	case IIO_CHAN_INFO_OFFSET:
 		if (chan->type == IIO_TEMP) {
 			/* The calculated value from the ADC is in Kelvin, we
-			 * want Celsius for hwmon so the offset is
-			 * -272.15 * scale
+			 * want Celsius for hwmon so the offset is -273.15
+			 * The offset is applied before scaling so it is
+			 * actually -213.15 * 4 / 1.012 = -1079.644268
 			 */
-			*val = -1075;
-			*val2 = 691699;
+			*val = -1079;
+			*val2 = 644268;
 
 			return IIO_VAL_INT_PLUS_MICRO;
 		}
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] rbd: require stable pages if message data CRCs are enabled
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (37 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] iio: mxs-lradc: Fix temperature offset Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] Revert "ARM64: unwind: Fix PC calculation" Sasha Levin
                   ` (18 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Ronny Hegewald, Ronny Hegewald, Ilya Dryomov, Sasha Levin

From: Ronny Hegewald <ronny.hegewald@online.de>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit bae818ee1577c27356093901a0ea48f672eda514 ]

rbd requires stable pages, as it performs a crc of the page data before
they are send to the OSDs.

But since kernel 3.9 (patch 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0
"mm: only enforce stable page writes if the backing device requires
it") it is not assumed anymore that block devices require stable pages.

This patch sets the necessary flag to get stable pages back for rbd.

In a ceph installation that provides multiple ext4 formatted rbd
devices "bad crc" messages appeared regularly (ca 1 message every 1-2
minutes on every OSD that provided the data for the rbd) in the
OSD-logs before this patch. After this patch this messages are pretty
much gone (only ca 1-2 / month / OSD).

Cc: stable@vger.kernel.org # 3.9+, needs backporting
Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
[idryomov@gmail.com: require stable pages only in crc case, changelog]
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/block/rbd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7327c36..8f51d6e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3780,6 +3780,9 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
 	q->limits.discard_zeroes_data = 1;
 
 	blk_queue_merge_bvec(q, rbd_merge_bvec);
+	if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC))
+		q->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES;
+
 	disk->queue = q;
 
 	q->queuedata = rbd_dev;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] Revert "ARM64: unwind: Fix PC calculation"
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (38 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] rbd: require stable pages if message data CRCs are enabled Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] dm btree remove: fix a bug when rebalancing nodes after removal Sasha Levin
                   ` (17 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Will Deacon, Sasha Levin

From: Will Deacon <will.deacon@arm.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 9702970c7bd3e2d6fecb642a190269131d4ac16c ]

This reverts commit e306dfd06fcb44d21c80acb8e5a88d55f3d1cf63.

With this patch applied, we were the only architecture making this sort
of adjustment to the PC calculation in the unwinder. This causes
problems for ftrace, where the PC values are matched against the
contents of the stack frames in the callchain and fail to match any
records after the address adjustment.

Whilst there has been some effort to change ftrace to workaround this,
those patches are not yet ready for mainline and, since we're the odd
architecture in this regard, let's just step in line with other
architectures (like arch/arm/) for now.

Cc: <stable@vger.kernel.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 arch/arm64/kernel/stacktrace.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 407991b..ccb6078 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -48,11 +48,7 @@ int notrace unwind_frame(struct stackframe *frame)
 
 	frame->sp = fp + 0x10;
 	frame->fp = *(unsigned long *)(fp);
-	/*
-	 * -4 here because we care about the PC at time of bl,
-	 * not where the return will go.
-	 */
-	frame->pc = *(unsigned long *)(fp + 8) - 4;
+	frame->pc = *(unsigned long *)(fp + 8);
 
 	return 0;
 }
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] dm btree remove: fix a bug when rebalancing nodes after removal
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (39 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] Revert "ARM64: unwind: Fix PC calculation" Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] dm btree: fix leak of bufio-backed block in btree_split_beneath error path Sasha Levin
                   ` (16 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Joe Thornber, Mike Snitzer, Sasha Levin

From: Joe Thornber <ejt@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 2871c69e025e8bc507651d5a9cf81a8a7da9d24b ]

Commit 4c7e309340ff ("dm btree remove: fix bug in redistribute3") wasn't
a complete fix for redistribute3().

The redistribute3 function takes 3 btree nodes and shares out the entries
evenly between them.  If the three nodes in total contained
(MAX_ENTRIES * 3) - 1 entries between them then this was erroneously getting
rebalanced as (MAX_ENTRIES - 1) on the left and right, and (MAX_ENTRIES + 1) in
the center.

Fix this issue by being more careful about calculating the target number
of entries for the left and right nodes.

Unit tested in userspace using this program:
https://github.com/jthornber/redistribute3-test/blob/master/redistribute3_t.c

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/persistent-data/dm-btree-remove.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c
index 7c0d755..92cd09f 100644
--- a/drivers/md/persistent-data/dm-btree-remove.c
+++ b/drivers/md/persistent-data/dm-btree-remove.c
@@ -301,11 +301,16 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
 {
 	int s;
 	uint32_t max_entries = le32_to_cpu(left->header.max_entries);
-	unsigned target = (nr_left + nr_center + nr_right) / 3;
-	BUG_ON(target > max_entries);
+	unsigned total = nr_left + nr_center + nr_right;
+	unsigned target_right = total / 3;
+	unsigned remainder = (target_right * 3) != total;
+	unsigned target_left = target_right + remainder;
+
+	BUG_ON(target_left > max_entries);
+	BUG_ON(target_right > max_entries);
 
 	if (nr_left < nr_right) {
-		s = nr_left - target;
+		s = nr_left - target_left;
 
 		if (s < 0 && nr_center < -s) {
 			/* not enough in central node */
@@ -316,10 +321,10 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
 		} else
 			shift(left, center, s);
 
-		shift(center, right, target - nr_right);
+		shift(center, right, target_right - nr_right);
 
 	} else {
-		s = target - nr_right;
+		s = target_right - nr_right;
 		if (s > 0 && nr_center < s) {
 			/* not enough in central node */
 			shift(center, right, nr_center);
@@ -329,7 +334,7 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent,
 		} else
 			shift(center, right, s);
 
-		shift(left, center, nr_left - target);
+		shift(left, center, nr_left - target_left);
 	}
 
 	*key_ptr(parent, c->index) = center->keys[0];
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] dm btree: fix leak of bufio-backed block in btree_split_beneath error path
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (40 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] dm btree remove: fix a bug when rebalancing nodes after removal Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] xhci: handle no ping response error properly Sasha Levin
                   ` (15 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Mike Snitzer, Sasha Levin

From: Mike Snitzer <snitzer@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 4dcb8b57df3593dcb20481d9d6cf79d1dc1534be ]

btree_split_beneath()'s error path had an outstanding FIXME that speaks
directly to the potential for _not_ cleaning up a previously allocated
bufio-backed block.

Fix this by releasing the previously allocated bufio block using
unlock_block().

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <thornber@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/persistent-data/dm-btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index c7726ce..d6e4703 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -523,7 +523,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key)
 
 	r = new_block(s->info, &right);
 	if (r < 0) {
-		/* FIXME: put left */
+		unlock_block(s->info, left);
 		return r;
 	}
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] xhci: handle no ping response error properly
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (41 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] dm btree: fix leak of bufio-backed block in btree_split_beneath error path Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] xhci: Add spurious wakeup quirk for LynxPoint-LP controllers Sasha Levin
                   ` (14 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Mathias Nyman, Greg Kroah-Hartman, Sasha Levin

From: Mathias Nyman <mathias.nyman@linux.intel.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 3b4739b8951d650becbcd855d7d6f18ac98a9a85 ]

If a host fails to wake up a isochronous SuperSpeed device from U1/U2
in time for a isoch transfer it will generate a "No ping response error"
Host will then move to the next transfer descriptor.

Handle this case in the same way as missed service errors, tag the
current TD as skipped and handle it on the next transfer event.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/usb/host/xhci-ring.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 136259b..1e5fb8c 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2238,6 +2238,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 	u32 trb_comp_code;
 	int ret = 0;
 	int td_num = 0;
+	bool handling_skipped_tds = false;
 
 	slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));
 	xdev = xhci->devs[slot_id];
@@ -2371,6 +2372,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 		ep->skip = true;
 		xhci_dbg(xhci, "Miss service interval error, set skip flag\n");
 		goto cleanup;
+	case COMP_PING_ERR:
+		ep->skip = true;
+		xhci_dbg(xhci, "No Ping response error, Skip one Isoc TD\n");
+		goto cleanup;
 	default:
 		if (xhci_is_vendor_info_code(xhci, trb_comp_code)) {
 			status = 0;
@@ -2507,13 +2512,18 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 						 ep, &status);
 
 cleanup:
+
+
+		handling_skipped_tds = ep->skip &&
+			trb_comp_code != COMP_MISSED_INT &&
+			trb_comp_code != COMP_PING_ERR;
+
 		/*
-		 * Do not update event ring dequeue pointer if ep->skip is set.
-		 * Will roll back to continue process missed tds.
+		 * Do not update event ring dequeue pointer if we're in a loop
+		 * processing missed tds.
 		 */
-		if (trb_comp_code == COMP_MISSED_INT || !ep->skip) {
+		if (!handling_skipped_tds)
 			inc_deq(xhci, xhci->event_ring);
-		}
 
 		if (ret) {
 			urb = td->urb;
@@ -2548,7 +2558,7 @@ cleanup:
 	 * Process them as short transfer until reach the td pointed by
 	 * the event.
 	 */
-	} while (ep->skip && trb_comp_code != COMP_MISSED_INT);
+	} while (handling_skipped_tds);
 
 	return 0;
 }
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] xhci: Add spurious wakeup quirk for LynxPoint-LP controllers
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (42 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] xhci: handle no ping response error properly Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing) Sasha Levin
                   ` (13 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Laura Abbott, Takashi Iwai, Oliver Neukum, Mathias Nyman,
	Greg Kroah-Hartman, Sasha Levin

From: Laura Abbott <labbott@fedoraproject.org>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit fd7cd061adcf5f7503515ba52b6a724642a839c8 ]

We received several reports of systems rebooting and powering on
after an attempted shutdown. Testing showed that setting
XHCI_SPURIOUS_WAKEUP quirk in addition to the XHCI_SPURIOUS_REBOOT
quirk allowed the system to shutdown as expected for LynxPoint-LP
xHCI controllers. Set the quirk back.

Note that the quirk was originally introduced for LynxPoint and
LynxPoint-LP just for this same reason. See:

commit 638298dc66ea ("xhci: Fix spurious wakeups after S5 on Haswell")

It was later limited to only concern HP machines as it caused
regression on some machines, see both bug and commit:

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66171
commit 6962d914f317 ("xhci: Limit the spurious wakeup fix only to HP machines")

Later it was discovered that the powering on after shutdown
was limited to LynxPoint-LP (Haswell-ULT) and that some non-LP HP
machine suffered from spontaneous resume from S3 (which should
not be related to the SPURIOUS_WAKEUP quirk at all). An attempt
to fix this then removed the SPURIOUS_WAKEUP flag usage completely.

commit b45abacde3d5 ("xhci: no switching back on non-ULT Haswell")

Current understanding is that LynxPoint-LP (Haswell ULT) machines
need the SPURIOUS_WAKEUP quirk, otherwise they will restart, and
plain Lynxpoint (Haswell) machines may _not_ have the quirk
set otherwise they again will restart.

Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Oliver Neukum <oneukum@suse.com>
[Added more history to commit message -Mathias]
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/usb/host/xhci-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 2af32e2..7e5c90e 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -135,6 +135,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
 		pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
 		xhci->quirks |= XHCI_SPURIOUS_REBOOT;
+		xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
 	}
 	if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
 		(pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing)
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (43 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] xhci: Add spurious wakeup quirk for LynxPoint-LP controllers Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] module: Fix locking in symbol_put_addr() Sasha Levin
                   ` (12 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Cathy Avery, Konrad Rzeszutek Wilk, Sasha Levin

From: Cathy Avery <cathy.avery@oracle.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit a54c8f0f2d7df525ff997e2afe71866a1a013064 ]

xen-blkfront will crash if the check to talk_to_blkback()
in blkback_changed()(XenbusStateInitWait) returns an error.
The driver data is freed and info is set to NULL. Later during
the close process via talk_to_blkback's call to xenbus_dev_fatal()
the null pointer is passed to and dereference in blkfront_closing.

CC: stable@vger.kernel.org
Signed-off-by: Cathy Avery <cathy.avery@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/block/xen-blkfront.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 218c485..34a01f1 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1911,7 +1911,8 @@ static void blkback_changed(struct xenbus_device *dev,
 			break;
 		/* Missed the backend's Closing state -- fallthrough */
 	case XenbusStateClosing:
-		blkfront_closing(info);
+		if (info)
+			blkfront_closing(info);
 		break;
 	}
 }
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] module: Fix locking in symbol_put_addr()
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (44 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing) Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] crypto: api - Only abort operations on fatal signal Sasha Levin
                   ` (11 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Peter Zijlstra, Rusty Russell, stable, Sasha Levin

From: Peter Zijlstra <peterz@infradead.org>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 275d7d44d802ef271a42dc87ac091a495ba72fc5 ]

Poma (on the way to another bug) reported an assertion triggering:

  [<ffffffff81150529>] module_assert_mutex_or_preempt+0x49/0x90
  [<ffffffff81150822>] __module_address+0x32/0x150
  [<ffffffff81150956>] __module_text_address+0x16/0x70
  [<ffffffff81150f19>] symbol_put_addr+0x29/0x40
  [<ffffffffa04b77ad>] dvb_frontend_detach+0x7d/0x90 [dvb_core]

Laura Abbott <labbott@redhat.com> produced a patch which lead us to
inspect symbol_put_addr(). This function has a comment claiming it
doesn't need to disable preemption around the module lookup
because it holds a reference to the module it wants to find, which
therefore cannot go away.

This is wrong (and a false optimization too, preempt_disable() is really
rather cheap, and I doubt any of this is on uber critical paths,
otherwise it would've retained a pointer to the actual module anyway and
avoided the second lookup).

While its true that the module cannot go away while we hold a reference
on it, the data structure we do the lookup in very much _CAN_ change
while we do the lookup. Therefore fix the comment and add the
required preempt_disable().

Reported-by: poma <pomidorabelisima@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: a6e6abd575fc ("module: remove module_text_address()")
Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 kernel/module.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index c353707..3da0c00 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -914,11 +914,15 @@ void symbol_put_addr(void *addr)
 	if (core_kernel_text(a))
 		return;
 
-	/* module_text_address is safe here: we're supposed to have reference
-	 * to module from symbol_get, so it can't go away. */
+	/*
+	 * Even though we hold a reference on the module; we still need to
+	 * disable preemption in order to safely traverse the data structure.
+	 */
+	preempt_disable();
 	modaddr = __module_text_address(a);
 	BUG_ON(!modaddr);
 	module_put(modaddr);
+	preempt_enable();
 }
 EXPORT_SYMBOL_GPL(symbol_put_addr);
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] crypto: api - Only abort operations on fatal signal
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (45 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] module: Fix locking in symbol_put_addr() Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid1: submit_bio_wait() returns 0 on success Sasha Levin
                   ` (10 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Herbert Xu, Sasha Levin

From: Herbert Xu <herbert@gondor.apana.org.au>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 3fc89adb9fa4beff31374a4bf50b3d099d88ae83 ]

Currently a number of Crypto API operations may fail when a signal
occurs.  This causes nasty problems as the caller of those operations
are often not in a good position to restart the operation.

In fact there is currently no need for those operations to be
interrupted by user signals at all.  All we need is for them to
be killable.

This patch replaces the relevant calls of signal_pending with
fatal_signal_pending, and wait_for_completion_interruptible with
wait_for_completion_killable, respectively.

Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 crypto/ablkcipher.c  | 2 +-
 crypto/algapi.c      | 2 +-
 crypto/api.c         | 6 +++---
 crypto/crypto_user.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 40886c4..520729d 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -695,7 +695,7 @@ struct crypto_ablkcipher *crypto_alloc_ablkcipher(const char *alg_name,
 err:
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 71a8143..314cc74 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -337,7 +337,7 @@ static void crypto_wait_for_test(struct crypto_larval *larval)
 		crypto_alg_tested(larval->alg.cra_driver_name, 0);
 	}
 
-	err = wait_for_completion_interruptible(&larval->completion);
+	err = wait_for_completion_killable(&larval->completion);
 	WARN_ON(err);
 
 out:
diff --git a/crypto/api.c b/crypto/api.c
index 2a81e98..7db2e89 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -172,7 +172,7 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
 	struct crypto_larval *larval = (void *)alg;
 	long timeout;
 
-	timeout = wait_for_completion_interruptible_timeout(
+	timeout = wait_for_completion_killable_timeout(
 		&larval->completion, 60 * HZ);
 
 	alg = larval->adult;
@@ -435,7 +435,7 @@ struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask)
 err:
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
@@ -552,7 +552,7 @@ void *crypto_alloc_tfm(const char *alg_name,
 err:
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index e2a34fe..c90af25 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -367,7 +367,7 @@ static struct crypto_alg *crypto_user_aead_alg(const char *name, u32 type,
 		err = PTR_ERR(alg);
 		if (err != -EAGAIN)
 			break;
-		if (signal_pending(current)) {
+		if (fatal_signal_pending(current)) {
 			err = -EINTR;
 			break;
 		}
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] md/raid1: submit_bio_wait() returns 0 on success
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (46 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] crypto: api - Only abort operations on fatal signal Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid10: " Sasha Levin
                   ` (9 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Jes Sorensen, NeilBrown, Sasha Levin

From: Jes Sorensen <Jes.Sorensen@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 203d27b0226a05202438ddb39ef0ef1acb14a759 ]

This was introduced with 9e882242c6193ae6f416f2d8d8db0d9126bd996b
which changed the return value of submit_bio_wait() to return != 0 on
error, but didn't update the caller accordingly.

Fixes: 9e882242c6 ("block: Add submit_bio_wait(), remove from md")
Cc: stable@vger.kernel.org (v3.10)
Reported-by: Bill Kuzeja <William.Kuzeja@stratus.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/raid1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index d24245c..3c8ada4 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2245,7 +2245,7 @@ static int narrow_write_error(struct r1bio *r1_bio, int i)
 		bio_trim(wbio, sector - r1_bio->sector, sectors);
 		wbio->bi_iter.bi_sector += rdev->data_offset;
 		wbio->bi_bdev = rdev->bdev;
-		if (submit_bio_wait(WRITE, wbio) == 0)
+		if (submit_bio_wait(WRITE, wbio) < 0)
 			/* failure! */
 			ok = rdev_set_badblocks(rdev, sector,
 						sectors, 0)
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] md/raid10: submit_bio_wait() returns 0 on success
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (47 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid1: submit_bio_wait() returns 0 on success Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] Revert "md: allow a partially recovered device to be hot-added to an array." Sasha Levin
                   ` (8 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Jes Sorensen, NeilBrown, Sasha Levin

From: Jes Sorensen <Jes.Sorensen@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 681ab4696062f5aa939c9e04d058732306a97176 ]

This was introduced with 9e882242c6193ae6f416f2d8d8db0d9126bd996b
which changed the return value of submit_bio_wait() to return != 0 on
error, but didn't update the caller accordingly.

Fixes: 9e882242c6 ("block: Add submit_bio_wait(), remove from md")
Cc: stable@vger.kernel.org (v3.10)
Reported-by: Bill Kuzeja <William.Kuzeja@stratus.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/raid10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 17eb767..644f9e5 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2599,7 +2599,7 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
 				   choose_data_offset(r10_bio, rdev) +
 				   (sector - r10_bio->sector));
 		wbio->bi_bdev = rdev->bdev;
-		if (submit_bio_wait(WRITE, wbio) == 0)
+		if (submit_bio_wait(WRITE, wbio) < 0)
 			/* Failure! */
 			ok = rdev_set_badblocks(rdev, sector,
 						sectors, 0)
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] Revert "md: allow a partially recovered device to be hot-added to an array."
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (48 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid10: " Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] mvsas: Fix NULL pointer dereference in mvs_slot_task_free Sasha Levin
                   ` (7 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: NeilBrown, Sasha Levin

From: NeilBrown <neilb@suse.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit d01552a76d71f9879af448e9142389ee9be6e95b ]

This reverts commit 7eb418851f3278de67126ea0c427641ab4792c57.

This commit is poorly justified, I can find not discusison in email,
and it clearly causes a problem.

If a device which is being recovered fails and is subsequently
re-added to an array, there could easily have been changes to the
array *before* the point where the recovery was up to.  So the
recovery must start again from the beginning.

If a spare is being recovered and fails, then when it is re-added we
really should do a bitmap-based recovery up to the recovery-offset,
and then a full recovery from there.  Before this reversion, we only
did the "full recovery from there" which is not corect.  After this
reversion with will do a full recovery from the start, which is safer
but not ideal.

It will be left to a future patch to arrange the two different styles
of recovery.

Reported-and-tested-by: Nate Dailey <nate.dailey@stratus.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Cc: stable@vger.kernel.org (3.14+)
Fixes: 7eb418851f32 ("md: allow a partially recovered device to be hot-added to an array.")
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/md.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9c5d53f..6c169f1 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7560,8 +7560,7 @@ static int remove_and_add_spares(struct mddev *mddev,
 		       !test_bit(Bitmap_sync, &rdev->flags)))
 			continue;
 
-		if (rdev->saved_raid_disk < 0)
-			rdev->recovery_offset = 0;
+		rdev->recovery_offset = 0;
 		if (mddev->pers->
 		    hot_add_disk(mddev, rdev) == 0) {
 			if (sysfs_link_rdev(mddev, rdev))
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] mvsas: Fix NULL pointer dereference in mvs_slot_task_free
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (49 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] Revert "md: allow a partially recovered device to be hot-added to an array." Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] IB/cm: Fix rb-tree duplicate free and use-after-free Sasha Levin
                   ` (6 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Dāvis Mosāns, James Bottomley, Sasha Levin

From: Dāvis Mosāns <davispuh@gmail.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 2280521719e81919283b82902ac24058f87dfc1b ]

When pci_pool_alloc fails in mvs_task_prep then task->lldd_task stays
NULL but it's later used in mvs_abort_task as slot which is passed
to mvs_slot_task_free causing NULL pointer dereference.

Just return from mvs_slot_task_free when passed with NULL slot.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=101891
Signed-off-by: Dāvis Mosāns <davispuh@gmail.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/scsi/mvsas/mv_sas.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index 0eb2da8..89215d4 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -988,6 +988,8 @@ static void mvs_slot_free(struct mvs_info *mvi, u32 rx_desc)
 static void mvs_slot_task_free(struct mvs_info *mvi, struct sas_task *task,
 			  struct mvs_slot_info *slot, u32 slot_idx)
 {
+	if (!slot)
+		return;
 	if (!slot->task)
 		return;
 	if (!sas_protocol_ata(task->task_proto))
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] IB/cm: Fix rb-tree duplicate free and use-after-free
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (50 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] mvsas: Fix NULL pointer dereference in mvs_slot_task_free Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid5: fix locking in handle_stripe_clean_event() Sasha Levin
                   ` (5 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Doron Tsur, Matan Barak, Doug Ledford, Sasha Levin

From: Doron Tsur <doront@mellanox.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 0ca81a2840f77855bbad1b9f172c545c4dc9e6a4 ]

ib_send_cm_sidr_rep could sometimes erase the node from the sidr
(depending on errors in the process). Since ib_send_cm_sidr_rep is
called both from cm_sidr_req_handler and cm_destroy_id, cm_id_priv
could be either erased from the rb_tree twice or not erased at all.
Fixing that by making sure it's erased only once before freeing
cm_id_priv.

Fixes: a977049dacde ('[PATCH] IB: Add the kernel CM implementation')
Signed-off-by: Doron Tsur <doront@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/infiniband/core/cm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index e28a494..c3a83f7 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -860,6 +860,11 @@ retest:
 	case IB_CM_SIDR_REQ_RCVD:
 		spin_unlock_irq(&cm_id_priv->lock);
 		cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT);
+		spin_lock_irq(&cm.lock);
+		if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node))
+			rb_erase(&cm_id_priv->sidr_id_node,
+				 &cm.remote_sidr_table);
+		spin_unlock_irq(&cm.lock);
 		break;
 	case IB_CM_REQ_SENT:
 		ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg);
@@ -3099,7 +3104,10 @@ int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id,
 	spin_unlock_irqrestore(&cm_id_priv->lock, flags);
 
 	spin_lock_irqsave(&cm.lock, flags);
-	rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);
+	if (!RB_EMPTY_NODE(&cm_id_priv->sidr_id_node)) {
+		rb_erase(&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);
+		RB_CLEAR_NODE(&cm_id_priv->sidr_id_node);
+	}
 	spin_unlock_irqrestore(&cm.lock, flags);
 	return 0;
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] md/raid5: fix locking in handle_stripe_clean_event()
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (51 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] IB/cm: Fix rb-tree duplicate free and use-after-free Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] serial: 8250_pci: Add support for 16 port Exar boards Sasha Levin
                   ` (4 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Roman Gushchin, NeilBrown, Shaohua Li, Sasha Levin

From: Roman Gushchin <klamm@yandex-team.ru>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit b8a9d66d043ffac116100775a469f05f5158c16f ]

After commit 566c09c53455 ("raid5: relieve lock contention in get_active_stripe()")
__find_stripe() is called under conf->hash_locks + hash.
But handle_stripe_clean_event() calls remove_hash() under
conf->device_lock.

Under some cirscumstances the hash chain can be circuited,
and we get an infinite loop with disabled interrupts and locked hash
lock in __find_stripe(). This leads to hard lockup on multiple CPUs
and following system crash.

I was able to reproduce this behavior on raid6 over 6 ssd disks.
The devices_handle_discard_safely option should be set to enable trim
support. The following script was used:

for i in `seq 1 32`; do
    dd if=/dev/zero of=large$i bs=10M count=100 &
done

neilb: original was against a 3.x kernel.  I forward-ported
  to 4.3-rc.  This verison is suitable for any kernel since
  Commit: 59fc630b8b5f ("RAID5: batch adjacent full stripe write")
  (v4.1+).  I'll post a version for earlier kernels to stable.

Signed-off-by: Roman Gushchin <klamm@yandex-team.ru>
Fixes: 566c09c53455 ("raid5: relieve lock contention in get_active_stripe()")
Signed-off-by: NeilBrown <neilb@suse.com>
Cc: Shaohua Li <shli@kernel.org>
Cc: <stable@vger.kernel.org> # 3.13 - 4.2
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/md/raid5.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e421016..5fa7549 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3060,6 +3060,8 @@ static void handle_stripe_clean_event(struct r5conf *conf,
 		}
 	if (!discard_pending &&
 	    test_bit(R5_Discard, &sh->dev[sh->pd_idx].flags)) {
+		int hash = sh->hash_lock_index;
+
 		clear_bit(R5_Discard, &sh->dev[sh->pd_idx].flags);
 		clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags);
 		if (sh->qd_idx >= 0) {
@@ -3073,9 +3075,9 @@ static void handle_stripe_clean_event(struct r5conf *conf,
 		 * no updated data, so remove it from hash list and the stripe
 		 * will be reinitialized
 		 */
-		spin_lock_irq(&conf->device_lock);
+		spin_lock_irq(conf->hash_locks + hash);
 		remove_hash(sh);
-		spin_unlock_irq(&conf->device_lock);
+		spin_unlock_irq(conf->hash_locks + hash);
 		if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state))
 			set_bit(STRIPE_HANDLE, &sh->state);
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] serial: 8250_pci: Add support for 16 port Exar boards
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (52 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid5: fix locking in handle_stripe_clean_event() Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] serial: 8250_pci: Add support for 12 " Sasha Levin
                   ` (3 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Soeren Grunewald, Greg Kroah-Hartman, Sasha Levin

From: Soeren Grunewald <soeren.grunewald@desy.de>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 96a5d18bc1338786fecac73599f1681f59a59a8e ]

The Exar XR17V358 chip usually provides only 8 ports. But two chips can be
combined to act as a single 16 port chip. Therefor one chip is configured
as master the second as slave by connecting the mode pin to VCC (master)
or GND (slave).

Then the master chip is reporting a different device-id depending on
whether a slave is detected or not. The UARTs 8-15 are addressed from
0x2000-0x3fff. So the offset of 0x400 from UART to UART can be used to
address all 16 ports as before.

See: https://www.exar.com/common/content/document.ashx?id=1587 page 11

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/tty/serial/8250/8250_pci.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 439bd1a..1e58ace 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1815,6 +1815,8 @@ pci_wch_ch353_setup(struct serial_private *priv,
 #define PCI_DEVICE_ID_SUNIX_1999	0x1999
 
 
+#define PCI_DEVICE_ID_EXAR_XR17V8358	0x8358
+
 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584	0x1584
 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1588	0x1588
@@ -2323,6 +2325,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
 		.subdevice	= PCI_ANY_ID,
 		.setup		= pci_xr17v35x_setup,
 	},
+	{
+		.vendor = PCI_VENDOR_ID_EXAR,
+		.device = PCI_DEVICE_ID_EXAR_XR17V8358,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= pci_xr17v35x_setup,
+	},
 	/*
 	 * Xircom cards
 	 */
@@ -2771,6 +2780,7 @@ enum pci_board_num_t {
 	pbn_exar_XR17V352,
 	pbn_exar_XR17V354,
 	pbn_exar_XR17V358,
+	pbn_exar_XR17V8358,
 	pbn_exar_ibm_saturn,
 	pbn_pasemi_1682M,
 	pbn_ni8430_2,
@@ -3440,6 +3450,14 @@ static struct pciserial_board pci_boards[] = {
 		.reg_shift	= 0,
 		.first_offset	= 0,
 	},
+	[pbn_exar_XR17V8358] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 16,
+		.base_baud	= 7812500,
+		.uart_offset	= 0x400,
+		.reg_shift	= 0,
+		.first_offset	= 0,
+	},
 	[pbn_exar_ibm_saturn] = {
 		.flags		= FL_BASE0,
 		.num_ports	= 1,
@@ -4808,7 +4826,7 @@ static struct pci_device_id serial_pci_tbl[] = {
 		0,
 		0, pbn_exar_XR17C158 },
 	/*
-	 * Exar Corp. XR17V35[248] Dual/Quad/Octal PCIe UARTs
+	 * Exar Corp. XR17V[48]35[248] Dual/Quad/Octal/Hexa PCIe UARTs
 	 */
 	{	PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V352,
 		PCI_ANY_ID, PCI_ANY_ID,
@@ -4822,7 +4840,10 @@ static struct pci_device_id serial_pci_tbl[] = {
 		PCI_ANY_ID, PCI_ANY_ID,
 		0,
 		0, pbn_exar_XR17V358 },
-
+	{	PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V8358,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0,
+		0, pbn_exar_XR17V8358 },
 	/*
 	 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
 	 */
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] serial: 8250_pci: Add support for 12 port Exar boards
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (53 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] serial: 8250_pci: Add support for 16 port Exar boards Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] vhost/scsi: potential memory corruption Sasha Levin
                   ` (2 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Soeren Grunewald, Greg Kroah-Hartman, Sasha Levin

From: Soeren Grunewald <soeren.grunewald@desy.de>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit be32c0cf0462c36f482b5ddcff1d8371be1e183c ]

The Exar XR17V358 can also be combined with a XR17V354 chip to act as a
single 12 port chip. This works the same way as the combining two XR17V358
chips. But the reported device id then is 0x4358.

Signed-off-by: Soeren Grunewald <soeren.grunewald@desy.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/tty/serial/8250/8250_pci.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 1e58ace..4227732 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1815,6 +1815,7 @@ pci_wch_ch353_setup(struct serial_private *priv,
 #define PCI_DEVICE_ID_SUNIX_1999	0x1999
 
 
+#define PCI_DEVICE_ID_EXAR_XR17V4358	0x4358
 #define PCI_DEVICE_ID_EXAR_XR17V8358	0x8358
 
 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
@@ -2327,6 +2328,13 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
 	},
 	{
 		.vendor = PCI_VENDOR_ID_EXAR,
+		.device = PCI_DEVICE_ID_EXAR_XR17V4358,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= pci_xr17v35x_setup,
+	},
+	{
+		.vendor = PCI_VENDOR_ID_EXAR,
 		.device = PCI_DEVICE_ID_EXAR_XR17V8358,
 		.subvendor	= PCI_ANY_ID,
 		.subdevice	= PCI_ANY_ID,
@@ -2780,6 +2788,7 @@ enum pci_board_num_t {
 	pbn_exar_XR17V352,
 	pbn_exar_XR17V354,
 	pbn_exar_XR17V358,
+	pbn_exar_XR17V4358,
 	pbn_exar_XR17V8358,
 	pbn_exar_ibm_saturn,
 	pbn_pasemi_1682M,
@@ -3450,6 +3459,14 @@ static struct pciserial_board pci_boards[] = {
 		.reg_shift	= 0,
 		.first_offset	= 0,
 	},
+	[pbn_exar_XR17V4358] = {
+		.flags		= FL_BASE0,
+		.num_ports	= 12,
+		.base_baud	= 7812500,
+		.uart_offset	= 0x400,
+		.reg_shift	= 0,
+		.first_offset	= 0,
+	},
 	[pbn_exar_XR17V8358] = {
 		.flags		= FL_BASE0,
 		.num_ports	= 16,
@@ -4840,6 +4857,10 @@ static struct pci_device_id serial_pci_tbl[] = {
 		PCI_ANY_ID, PCI_ANY_ID,
 		0,
 		0, pbn_exar_XR17V358 },
+	{	PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V4358,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0,
+		0, pbn_exar_XR17V4358 },
 	{	PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17V8358,
 		PCI_ANY_ID, PCI_ANY_ID,
 		0,
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] vhost/scsi: potential memory corruption
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (54 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] serial: 8250_pci: Add support for 12 " Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] ext4: allocate entire range in zero range Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] ext4: fix loss of delalloc extent info in ext4_zero_range() Sasha Levin
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Dan Carpenter, Nicholas Bellinger, Sasha Levin

From: Dan Carpenter <dan.carpenter@oracle.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 59c816c1f24df0204e01851431d3bab3eb76719c ]

This code in vhost_scsi_make_tpg() is confusing because we limit "tpgt"
to UINT_MAX but the data type of "tpg->tport_tpgt" and that is a u16.

I looked at the context and it turns out that in
vhost_scsi_set_endpoint(), "tpg->tport_tpgt" is used as an offset into
the vs_tpg[] array which has VHOST_SCSI_MAX_TARGET (256) elements so
anything higher than 255 then it is invalid.  I have made that the limit
now.

In vhost_scsi_send_evt() we mask away values higher than 255, but now
that the limit has changed, we don't need the mask.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/vhost/scsi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index cb84f69..313f09a 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1251,7 +1251,7 @@ tcm_vhost_send_evt(struct vhost_scsi *vs,
 		 * lun[4-7] need to be zero according to virtio-scsi spec.
 		 */
 		evt->event.lun[0] = 0x01;
-		evt->event.lun[1] = tpg->tport_tpgt & 0xFF;
+		evt->event.lun[1] = tpg->tport_tpgt;
 		if (lun->unpacked_lun >= 256)
 			evt->event.lun[2] = lun->unpacked_lun >> 8 | 0x40 ;
 		evt->event.lun[3] = lun->unpacked_lun & 0xFF;
@@ -2122,12 +2122,12 @@ tcm_vhost_make_tpg(struct se_wwn *wwn,
 			struct tcm_vhost_tport, tport_wwn);
 
 	struct tcm_vhost_tpg *tpg;
-	unsigned long tpgt;
+	u16 tpgt;
 	int ret;
 
 	if (strstr(name, "tpgt_") != name)
 		return ERR_PTR(-EINVAL);
-	if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)
+	if (kstrtou16(name + 5, 10, &tpgt) || tpgt >= VHOST_SCSI_MAX_TARGET)
 		return ERR_PTR(-EINVAL);
 
 	tpg = kzalloc(sizeof(struct tcm_vhost_tpg), GFP_KERNEL);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] ext4: allocate entire range in zero range
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (55 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] vhost/scsi: potential memory corruption Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  2015-11-16  4:04 ` [added to the 3.18 stable tree] ext4: fix loss of delalloc extent info in ext4_zero_range() Sasha Levin
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Lukas Czerner, Theodore Ts'o, Sasha Levin

From: Lukas Czerner <lczerner@redhat.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 0f2af21aae11972fa924374ddcf52e88347cf5a8 ]

Currently there is a bug in zero range code which causes zero range
calls to only allocate block aligned portion of the range, while
ignoring the rest in some cases.

In some cases, namely if the end of the range is past i_size, we do
attempt to preallocate the last nonaligned block. However this might
cause kernel to BUG() in some carefully designed zero range requests
on setups where page size > block size.

Fix this problem by first preallocating the entire range, including
the nonaligned edges and converting the written extents to unwritten
in the next step. This approach will also give us the advantage of
having the range to be as linearly contiguous as possible.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 fs/ext4/extents.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b5fcb1a..786dd45 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4792,12 +4792,6 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 	else
 		max_blocks -= lblk;
 
-	flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT |
-		EXT4_GET_BLOCKS_CONVERT_UNWRITTEN |
-		EXT4_EX_NOCACHE;
-	if (mode & FALLOC_FL_KEEP_SIZE)
-		flags |= EXT4_GET_BLOCKS_KEEP_SIZE;
-
 	mutex_lock(&inode->i_mutex);
 
 	/*
@@ -4814,15 +4808,28 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 		ret = inode_newsize_ok(inode, new_size);
 		if (ret)
 			goto out_mutex;
-		/*
-		 * If we have a partial block after EOF we have to allocate
-		 * the entire block.
-		 */
-		if (partial_end)
-			max_blocks += 1;
 	}
 
+	flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT;
+	if (mode & FALLOC_FL_KEEP_SIZE)
+		flags |= EXT4_GET_BLOCKS_KEEP_SIZE;
+
+	/* Preallocate the range including the unaligned edges */
+	if (partial_begin || partial_end) {
+		ret = ext4_alloc_file_blocks(file,
+				round_down(offset, 1 << blkbits) >> blkbits,
+				(round_up((offset + len), 1 << blkbits) -
+				 round_down(offset, 1 << blkbits)) >> blkbits,
+				new_size, flags, mode);
+		if (ret)
+			goto out_mutex;
+
+	}
+
+	/* Zero range excluding the unaligned edges */
 	if (max_blocks > 0) {
+		flags |= (EXT4_GET_BLOCKS_CONVERT_UNWRITTEN |
+			  EXT4_EX_NOCACHE);
 
 		/* Now release the pages and zero block aligned part of pages*/
 		truncate_pagecache_range(inode, start, end - 1);
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [added to the 3.18 stable tree] ext4: fix loss of delalloc extent info in ext4_zero_range()
  2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
                   ` (56 preceding siblings ...)
  2015-11-16  4:04 ` [added to the 3.18 stable tree] ext4: allocate entire range in zero range Sasha Levin
@ 2015-11-16  4:04 ` Sasha Levin
  57 siblings, 0 replies; 59+ messages in thread
From: Sasha Levin @ 2015-11-16  4:04 UTC (permalink / raw)
  To: stable, stable-commits; +Cc: Eric Whitney, Theodore Ts'o, Sasha Levin

From: Eric Whitney <enwlinux@gmail.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 94426f4b9648154dc5a6760b59e6953e640ab3b1 ]

In ext4_zero_range(), removing a file's entire block range from the
extent status tree removes all records of that file's delalloc extents.
The delalloc accounting code uses this information, and its loss can
then lead to accounting errors and kernel warnings at writeback time and
subsequent file system damage.  This is most noticeable on bigalloc
file systems where code in ext4_ext_map_blocks() handles cases where
delalloc extents share clusters with a newly allocated extent.

Because we're not deleting a block range and are correctly updating the
status of its associated extent, there is no need to remove anything
from the extent status tree.

When this patch is combined with an unrelated bug fix for
ext4_zero_range(), kernel warnings and e2fsck errors reported during
xfstests runs on bigalloc filesystems are greatly reduced without
introducing regressions on other xfstests-bld test scenarios.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 fs/ext4/extents.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 786dd45..b95c320 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4843,19 +4843,6 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 					     flags, mode);
 		if (ret)
 			goto out_dio;
-		/*
-		 * Remove entire range from the extent status tree.
-		 *
-		 * ext4_es_remove_extent(inode, lblk, max_blocks) is
-		 * NOT sufficient.  I'm not sure why this is the case,
-		 * but let's be conservative and remove the extent
-		 * status tree for the entire inode.  There should be
-		 * no outstanding delalloc extents thanks to the
-		 * filemap_write_and_wait_range() call above.
-		 */
-		ret = ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS);
-		if (ret)
-			goto out_dio;
 	}
 	if (!partial_begin && !partial_end)
 		goto out_dio;
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 59+ messages in thread

end of thread, other threads:[~2015-11-16  4:06 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16  4:03 [added to the 3.18 stable tree] jbd2: avoid infinite loop when destroying aborted journal Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] l2tp: protect tunnel->del_work by ref_count Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] af_unix: Convert the unix_sk macro to an inline function for type safety Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] af_unix: return data from multiple SKBs on recv() with MSG_PEEK flag Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] net/unix: fix logic about sk_peek_offset Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] skbuff: Fix skb checksum flag on skb pull Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] skbuff: Fix skb checksum partial check Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] net: add pfmemalloc check in sk_add_backlog() Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] ppp: don't override sk->sk_state in pppoe_flush_dev() Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] crypto: sparc - initialize blkcipher.ivsize Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] crypto: ahash - ensure statesize is non-zero Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] btrfs: fix use after free iterating extrefs Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] arm64: errata: use KBUILD_CFLAGS_MODULE for erratum #843419 Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: rcar: enable RuntimePM before registering to the core Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: s3c2410: " Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] i2c: designware: Do not use parameters from ACPI on Dell Inspiron 7348 Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] workqueue: make sure delayed work run in local cpu Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] drm/nouveau/fbcon: take runpm reference when userspace has an open fd Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] drm/radeon: add pm sysfs files late Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] dm thin: fix missing pool reference count decrement in pool_ctr error path Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] rbd: fix double free on rbd_dev->header_name Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] lib/radix-tree.c: change to simpler include Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] ath9k: declare required extra tx headroom Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: dvm: fix D3 firmware PN programming Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: fix firmware filename for 3160 Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: pcie: support 7265-D devices Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: mvm: fix D3 firmware PN programming Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] iwlwifi: pci: add a few more PCI subvendor IDs for the 7265 series Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] iommu/amd: Don't clear DTE flags when modifying it Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] powerpc/rtas: Validate rtas.entry before calling enter_rtas() Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] ASoC: wm8904: Correct number of EQ registers Sasha Levin
2015-11-16  4:03 ` [added to the 3.18 stable tree] mm: make sendfile(2) killable Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] sfc: Fix memcpy() with const destination compiler warning Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] power: bq24190_charger: suppress build warning Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/nouveau/gem: return only valid domain when there's only one Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/i915: Restore lost DPLL register write on gen2-4 Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] drm/radeon: don't try to recreate sysfs entries on resume Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] iio: mxs-lradc: Fix temperature offset Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] rbd: require stable pages if message data CRCs are enabled Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] Revert "ARM64: unwind: Fix PC calculation" Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] dm btree remove: fix a bug when rebalancing nodes after removal Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] dm btree: fix leak of bufio-backed block in btree_split_beneath error path Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] xhci: handle no ping response error properly Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] xhci: Add spurious wakeup quirk for LynxPoint-LP controllers Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing) Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] module: Fix locking in symbol_put_addr() Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] crypto: api - Only abort operations on fatal signal Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid1: submit_bio_wait() returns 0 on success Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid10: " Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] Revert "md: allow a partially recovered device to be hot-added to an array." Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] mvsas: Fix NULL pointer dereference in mvs_slot_task_free Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] IB/cm: Fix rb-tree duplicate free and use-after-free Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] md/raid5: fix locking in handle_stripe_clean_event() Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] serial: 8250_pci: Add support for 16 port Exar boards Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] serial: 8250_pci: Add support for 12 " Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] vhost/scsi: potential memory corruption Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] ext4: allocate entire range in zero range Sasha Levin
2015-11-16  4:04 ` [added to the 3.18 stable tree] ext4: fix loss of delalloc extent info in ext4_zero_range() Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.