From f020340904b90c1287c31e3bd631c5d397049da6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 18 Jul 2013 17:56:28 -0700 Subject: [PATCH] 3.4-stable patches added patches: arm-7765-1-perf-record-the-user-mode-pc-in-the-call-chain.patch drivers-dma-pl330.c-fix-locking-in-pl330_free_chan_resources.patch handle-big-endianness-in-ntlm-ntlmv2-authentication.patch --- ...d-the-user-mode-pc-in-the-call-chain.patch | 35 ++++++++ ...locking-in-pl330_free_chan_resources.patch | 68 ++++++++++++++++ ...anness-in-ntlm-ntlmv2-authentication.patch | 80 +++++++++++++++++++ queue-3.4/series | 3 + 4 files changed, 186 insertions(+) create mode 100644 queue-3.4/arm-7765-1-perf-record-the-user-mode-pc-in-the-call-chain.patch create mode 100644 queue-3.4/drivers-dma-pl330.c-fix-locking-in-pl330_free_chan_resources.patch create mode 100644 queue-3.4/handle-big-endianness-in-ntlm-ntlmv2-authentication.patch diff --git a/queue-3.4/arm-7765-1-perf-record-the-user-mode-pc-in-the-call-chain.patch b/queue-3.4/arm-7765-1-perf-record-the-user-mode-pc-in-the-call-chain.patch new file mode 100644 index 00000000000..a4151218dfc --- /dev/null +++ b/queue-3.4/arm-7765-1-perf-record-the-user-mode-pc-in-the-call-chain.patch @@ -0,0 +1,35 @@ +From c5f927a6f62196226915f12194c9d0df4e2210d7 Mon Sep 17 00:00:00 2001 +From: Jed Davis +Date: Thu, 20 Jun 2013 10:16:29 +0100 +Subject: ARM: 7765/1: perf: Record the user-mode PC in the call chain. + +From: Jed Davis + +commit c5f927a6f62196226915f12194c9d0df4e2210d7 upstream. + +With this change, we no longer lose the innermost entry in the user-mode +part of the call chain. See also the x86 port, which includes the ip. + +It's possible to partially work around this problem by post-processing +the data to use the PERF_SAMPLE_IP value, but this works only if the CPU +wasn't in the kernel when the sample was taken. + +Signed-off-by: Jed Davis +Signed-off-by: Will Deacon +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/kernel/perf_event.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/kernel/perf_event.c ++++ b/arch/arm/kernel/perf_event.c +@@ -824,6 +824,7 @@ perf_callchain_user(struct perf_callchai + struct frame_tail __user *tail; + + ++ perf_callchain_store(entry, regs->ARM_pc); + tail = (struct frame_tail __user *)regs->ARM_fp - 1; + + while ((entry->nr < PERF_MAX_STACK_DEPTH) && diff --git a/queue-3.4/drivers-dma-pl330.c-fix-locking-in-pl330_free_chan_resources.patch b/queue-3.4/drivers-dma-pl330.c-fix-locking-in-pl330_free_chan_resources.patch new file mode 100644 index 00000000000..d329c202bc3 --- /dev/null +++ b/queue-3.4/drivers-dma-pl330.c-fix-locking-in-pl330_free_chan_resources.patch @@ -0,0 +1,68 @@ +From da331ba8e9c5de72a27e50f71105395bba6eebe0 Mon Sep 17 00:00:00 2001 +From: Bartlomiej Zolnierkiewicz +Date: Wed, 3 Jul 2013 15:00:43 -0700 +Subject: drivers/dma/pl330.c: fix locking in pl330_free_chan_resources() + +From: Bartlomiej Zolnierkiewicz + +commit da331ba8e9c5de72a27e50f71105395bba6eebe0 upstream. + +tasklet_kill() may sleep so call it before taking pch->lock. + +Fixes following lockup: + + BUG: scheduling while atomic: cat/2383/0x00000002 + Modules linked in: + unwind_backtrace+0x0/0xfc + __schedule_bug+0x4c/0x58 + __schedule+0x690/0x6e0 + sys_sched_yield+0x70/0x78 + tasklet_kill+0x34/0x8c + pl330_free_chan_resources+0x24/0x88 + dma_chan_put+0x4c/0x50 + [...] + BUG: spinlock lockup suspected on CPU#0, swapper/0/0 + lock: 0xe52aa04c, .magic: dead4ead, .owner: cat/2383, .owner_cpu: 1 + unwind_backtrace+0x0/0xfc + do_raw_spin_lock+0x194/0x204 + _raw_spin_lock_irqsave+0x20/0x28 + pl330_tasklet+0x2c/0x5a8 + tasklet_action+0xfc/0x114 + __do_softirq+0xe4/0x19c + irq_exit+0x98/0x9c + handle_IPI+0x124/0x16c + gic_handle_irq+0x64/0x68 + __irq_svc+0x40/0x70 + cpuidle_wrap_enter+0x4c/0xa0 + cpuidle_enter_state+0x18/0x68 + cpuidle_idle_call+0xac/0xe0 + cpu_idle+0xac/0xf0 + +Signed-off-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Kyungmin Park +Acked-by: Jassi Brar +Cc: Vinod Koul +Cc: Tomasz Figa +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/pl330.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/dma/pl330.c ++++ b/drivers/dma/pl330.c +@@ -2469,10 +2469,10 @@ static void pl330_free_chan_resources(st + struct dma_pl330_chan *pch = to_pchan(chan); + unsigned long flags; + +- spin_lock_irqsave(&pch->lock, flags); +- + tasklet_kill(&pch->task); + ++ spin_lock_irqsave(&pch->lock, flags); ++ + pl330_release_channel(pch->pl330_chid); + pch->pl330_chid = NULL; + diff --git a/queue-3.4/handle-big-endianness-in-ntlm-ntlmv2-authentication.patch b/queue-3.4/handle-big-endianness-in-ntlm-ntlmv2-authentication.patch new file mode 100644 index 00000000000..fb790a74d06 --- /dev/null +++ b/queue-3.4/handle-big-endianness-in-ntlm-ntlmv2-authentication.patch @@ -0,0 +1,80 @@ +From fdf96a907c1fbb93c633e2b7ede3b8df26d6a4c0 Mon Sep 17 00:00:00 2001 +From: Steve French +Date: Tue, 25 Jun 2013 14:03:16 -0500 +Subject: Handle big endianness in NTLM (ntlmv2) authentication + +From: Steve French + +commit fdf96a907c1fbb93c633e2b7ede3b8df26d6a4c0 upstream. + +This is RH bug 970891 +Uppercasing of username during calculation of ntlmv2 hash fails +because UniStrupr function does not handle big endian wchars. + +Also fix a comment in the same code to reflect its correct usage. + +[To make it easier for stable (rather than require 2nd patch) fixed +this patch of Shirish's to remove endian warning generated +by sparse -- steve f.] + +Reported-by: steve +Signed-off-by: Shirish Pargaonkar +Reviewed-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/cifs_unicode.h | 8 ++++---- + fs/cifs/cifsencrypt.c | 6 +++--- + 2 files changed, 7 insertions(+), 7 deletions(-) + +--- a/fs/cifs/cifs_unicode.h ++++ b/fs/cifs/cifs_unicode.h +@@ -323,14 +323,14 @@ UniToupper(register wchar_t uc) + /* + * UniStrupr: Upper case a unicode string + */ +-static inline wchar_t * +-UniStrupr(register wchar_t *upin) ++static inline __le16 * ++UniStrupr(register __le16 *upin) + { +- register wchar_t *up; ++ register __le16 *up; + + up = upin; + while (*up) { /* For all characters */ +- *up = UniToupper(*up); ++ *up = cpu_to_le16(UniToupper(le16_to_cpu(*up))); + up++; + } + return upin; /* Return input pointer */ +--- a/fs/cifs/cifsencrypt.c ++++ b/fs/cifs/cifsencrypt.c +@@ -394,7 +394,7 @@ static int calc_ntlmv2_hash(struct cifs_ + int rc = 0; + int len; + char nt_hash[CIFS_NTHASH_SIZE]; +- wchar_t *user; ++ __le16 *user; + wchar_t *domain; + wchar_t *server; + +@@ -419,7 +419,7 @@ static int calc_ntlmv2_hash(struct cifs_ + return rc; + } + +- /* convert ses->user_name to unicode and uppercase */ ++ /* convert ses->user_name to unicode */ + len = ses->user_name ? strlen(ses->user_name) : 0; + user = kmalloc(2 + (len * 2), GFP_KERNEL); + if (user == NULL) { +@@ -429,7 +429,7 @@ static int calc_ntlmv2_hash(struct cifs_ + } + + if (len) { +- len = cifs_strtoUTF16((__le16 *)user, ses->user_name, len, nls_cp); ++ len = cifs_strtoUTF16(user, ses->user_name, len, nls_cp); + UniStrupr(user); + } else { + memset(user, '\0', 2); diff --git a/queue-3.4/series b/queue-3.4/series index 7ab1fe167fa..6605defc2df 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -19,3 +19,6 @@ timer-fix-jiffies-wrap-behavior-of-round_jiffies_common.patch ext4-fix-data-offset-overflow-in-ext4_xattr_fiemap-on-32-bit-archs.patch ext4-fix-overflow-when-counting-used-blocks-on-32-bit-architectures.patch ext4-don-t-allow-ext4_free_blocks-to-fail-due-to-enomem.patch +arm-7765-1-perf-record-the-user-mode-pc-in-the-call-chain.patch +drivers-dma-pl330.c-fix-locking-in-pl330_free_chan_resources.patch +handle-big-endianness-in-ntlm-ntlmv2-authentication.patch -- 2.47.3