From: Greg Kroah-Hartman Date: Mon, 27 Oct 2014 08:52:18 +0000 (+0800) Subject: 3.10-stable patches X-Git-Tag: v3.10.59~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bb74d95bb525cbce2b825482e57fc52fca7fad7;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: alsa-emu10k1-fix-deadlock-in-synth-voice-lookup.patch alsa-pcm-use-the-same-dma-mmap-codepath-both-for-arm-and-arm64.patch alsa-usb-audio-add-support-for-steinberg-ur22-usb-interface.patch arm-at91-pmc-don-t-forget-to-write-pmc_pcdr-register-to-disable-clocks.patch arm64-compat-fix-compat-types-affecting-struct.patch ecryptfs-avoid-to-access-null-pointer-when-write-metadata-in-xattr.patch --- diff --git a/queue-3.10/alsa-emu10k1-fix-deadlock-in-synth-voice-lookup.patch b/queue-3.10/alsa-emu10k1-fix-deadlock-in-synth-voice-lookup.patch new file mode 100644 index 00000000000..5c91701b25a --- /dev/null +++ b/queue-3.10/alsa-emu10k1-fix-deadlock-in-synth-voice-lookup.patch @@ -0,0 +1,63 @@ +From 95926035b187cc9fee6fb61385b7da9c28123f74 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 13 Oct 2014 23:18:02 +0200 +Subject: ALSA: emu10k1: Fix deadlock in synth voice lookup + +From: Takashi Iwai + +commit 95926035b187cc9fee6fb61385b7da9c28123f74 upstream. + +The emu10k1 voice allocator takes voice_lock spinlock. When there is +no empty stream available, it tries to release a voice used by synth, +and calls get_synth_voice. The callback function, +snd_emu10k1_synth_get_voice(), however, also takes the voice_lock, +thus it deadlocks. + +The fix is simply removing the voice_lock holds in +snd_emu10k1_synth_get_voice(), as this is always called in the +spinlock context. + +Reported-and-tested-by: Arthur Marsh +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/emu10k1/emu10k1_callback.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/sound/pci/emu10k1/emu10k1_callback.c ++++ b/sound/pci/emu10k1/emu10k1_callback.c +@@ -85,6 +85,8 @@ snd_emu10k1_ops_setup(struct snd_emux *e + * get more voice for pcm + * + * terminate most inactive voice and give it as a pcm voice. ++ * ++ * voice_lock is already held. + */ + int + snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) +@@ -92,12 +94,10 @@ snd_emu10k1_synth_get_voice(struct snd_e + struct snd_emux *emu; + struct snd_emux_voice *vp; + struct best_voice best[V_END]; +- unsigned long flags; + int i; + + emu = hw->synth; + +- spin_lock_irqsave(&emu->voice_lock, flags); + lookup_voices(emu, hw, best, 1); /* no OFF voices */ + for (i = 0; i < V_END; i++) { + if (best[i].voice >= 0) { +@@ -113,11 +113,9 @@ snd_emu10k1_synth_get_voice(struct snd_e + vp->emu->num_voices--; + vp->ch = -1; + vp->state = SNDRV_EMUX_ST_OFF; +- spin_unlock_irqrestore(&emu->voice_lock, flags); + return ch; + } + } +- spin_unlock_irqrestore(&emu->voice_lock, flags); + + /* not found */ + return -ENOMEM; diff --git a/queue-3.10/alsa-pcm-use-the-same-dma-mmap-codepath-both-for-arm-and-arm64.patch b/queue-3.10/alsa-pcm-use-the-same-dma-mmap-codepath-both-for-arm-and-arm64.patch new file mode 100644 index 00000000000..d5830133f49 --- /dev/null +++ b/queue-3.10/alsa-pcm-use-the-same-dma-mmap-codepath-both-for-arm-and-arm64.patch @@ -0,0 +1,38 @@ +From a011e213f3700233ed2a676f1ef0a74a052d7162 Mon Sep 17 00:00:00 2001 +From: Anatol Pomozov +Date: Fri, 17 Oct 2014 12:43:34 -0700 +Subject: ALSA: pcm: use the same dma mmap codepath both for arm and arm64 + +From: Anatol Pomozov + +commit a011e213f3700233ed2a676f1ef0a74a052d7162 upstream. + +This avoids following kernel crash when try to playback on arm64 + +[ 107.497203] [] snd_pcm_mmap_data_fault+0x90/0xd4 +[ 107.503405] [] __do_fault+0xb0/0x498 +[ 107.508565] [] handle_mm_fault+0x224/0x7b0 +[ 107.514246] [] do_page_fault+0x11c/0x310 +[ 107.519738] [] do_mem_abort+0x38/0x98 + +Tested: backported to 3.14 and tried to playback on arm64 machine + +Signed-off-by: Anatol Pomozov +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/core/pcm_native.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/core/pcm_native.c ++++ b/sound/core/pcm_native.c +@@ -3197,7 +3197,7 @@ static const struct vm_operations_struct + + #ifndef ARCH_HAS_DMA_MMAP_COHERENT + /* This should be defined / handled globally! */ +-#ifdef CONFIG_ARM ++#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) + #define ARCH_HAS_DMA_MMAP_COHERENT + #endif + #endif diff --git a/queue-3.10/alsa-usb-audio-add-support-for-steinberg-ur22-usb-interface.patch b/queue-3.10/alsa-usb-audio-add-support-for-steinberg-ur22-usb-interface.patch new file mode 100644 index 00000000000..b43551d603c --- /dev/null +++ b/queue-3.10/alsa-usb-audio-add-support-for-steinberg-ur22-usb-interface.patch @@ -0,0 +1,70 @@ +From f0b127fbfdc8756eba7437ab668f3169280bd358 Mon Sep 17 00:00:00 2001 +From: Vlad Catoi +Date: Sat, 18 Oct 2014 17:45:41 -0500 +Subject: ALSA: usb-audio: Add support for Steinberg UR22 USB interface + +From: Vlad Catoi + +commit f0b127fbfdc8756eba7437ab668f3169280bd358 upstream. + +Adding support for Steinberg UR22 USB interface via quirks table patch + +See Ubuntu bug report: +https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1317244 +Also see threads: +http://linux-audio.4202.n7.nabble.com/Support-for-Steinberg-UR22-Yamaha-USB-chipset-0499-1509-tc82888.html#a82917 +http://www.steinberg.net/forums/viewtopic.php?t=62290 + +Tested by at least 4 people judging by the threads. +Did not test MIDI interface, but audio output and capture both are +functional. Built 3.17 kernel with this driver on Ubuntu 14.04 & tested with mpg123 +Patch applied to 3.13 Ubuntu kernel works well enough for daily use. + +Signed-off-by: Vlad Catoi +Acked-by: Clemens Ladisch +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/usb/quirks-table.h | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/sound/usb/quirks-table.h ++++ b/sound/usb/quirks-table.h +@@ -386,6 +386,36 @@ YAMAHA_DEVICE(0x105d, NULL), + } + }, + { ++ USB_DEVICE(0x0499, 0x1509), ++ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { ++ /* .vendor_name = "Yamaha", */ ++ /* .product_name = "Steinberg UR22", */ ++ .ifnum = QUIRK_ANY_INTERFACE, ++ .type = QUIRK_COMPOSITE, ++ .data = (const struct snd_usb_audio_quirk[]) { ++ { ++ .ifnum = 1, ++ .type = QUIRK_AUDIO_STANDARD_INTERFACE ++ }, ++ { ++ .ifnum = 2, ++ .type = QUIRK_AUDIO_STANDARD_INTERFACE ++ }, ++ { ++ .ifnum = 3, ++ .type = QUIRK_MIDI_YAMAHA ++ }, ++ { ++ .ifnum = 4, ++ .type = QUIRK_IGNORE_INTERFACE ++ }, ++ { ++ .ifnum = -1 ++ } ++ } ++ } ++}, ++{ + USB_DEVICE(0x0499, 0x150a), + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { + /* .vendor_name = "Yamaha", */ diff --git a/queue-3.10/arm-at91-pmc-don-t-forget-to-write-pmc_pcdr-register-to-disable-clocks.patch b/queue-3.10/arm-at91-pmc-don-t-forget-to-write-pmc_pcdr-register-to-disable-clocks.patch new file mode 100644 index 00000000000..01a2a8cfdcd --- /dev/null +++ b/queue-3.10/arm-at91-pmc-don-t-forget-to-write-pmc_pcdr-register-to-disable-clocks.patch @@ -0,0 +1,31 @@ +From cfa1950e6c6b72251e80adc736af3c3d2907ab0e Mon Sep 17 00:00:00 2001 +From: Ludovic Desroches +Date: Mon, 22 Sep 2014 15:51:33 +0200 +Subject: ARM: at91/PMC: don't forget to write PMC_PCDR register to disable clocks + +From: Ludovic Desroches + +commit cfa1950e6c6b72251e80adc736af3c3d2907ab0e upstream. + +When introducing support for sama5d3, the write to PMC_PCDR register has +been accidentally removed. + +Reported-by: Nathalie Cyrille +Signed-off-by: Ludovic Desroches +Signed-off-by: Nicolas Ferre +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-at91/clock.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-at91/clock.c ++++ b/arch/arm/mach-at91/clock.c +@@ -947,6 +947,7 @@ static int __init at91_clock_reset(void) + } + + at91_pmc_write(AT91_PMC_SCDR, scdr); ++ at91_pmc_write(AT91_PMC_PCDR, pcdr); + if (cpu_is_sama5d3()) + at91_pmc_write(AT91_PMC_PCDR1, pcdr1); + diff --git a/queue-3.10/arm64-compat-fix-compat-types-affecting-struct.patch b/queue-3.10/arm64-compat-fix-compat-types-affecting-struct.patch new file mode 100644 index 00000000000..b4c4aa89b68 --- /dev/null +++ b/queue-3.10/arm64-compat-fix-compat-types-affecting-struct.patch @@ -0,0 +1,40 @@ +From 971a5b6fe634bb7b617d8c5f25b6a3ddbc600194 Mon Sep 17 00:00:00 2001 +From: Victor Kamensky +Date: Tue, 14 Oct 2014 06:55:05 +0100 +Subject: arm64: compat: fix compat types affecting struct + compat_elf_prpsinfo + +From: Victor Kamensky + +commit 971a5b6fe634bb7b617d8c5f25b6a3ddbc600194 upstream. + +The compat_elf_prpsinfo structure does not match the arch/arm struct +elf_pspsinfo definition. As result NT_PRPSINFO note in core file +created by arm64 kernel for aarch32 (compat) process has wrong size. +So gdb cannot display command that caused process crash. + +Fix is to change size of __compat_uid_t, __compat_gid_t so it would +match size of similar fields in arch/arm case. + +Signed-off-by: Victor Kamensky +Acked-by: Arnd Bergmann +Signed-off-by: Catalin Marinas +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/include/asm/compat.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm64/include/asm/compat.h ++++ b/arch/arm64/include/asm/compat.h +@@ -33,8 +33,8 @@ typedef s32 compat_ssize_t; + typedef s32 compat_time_t; + typedef s32 compat_clock_t; + typedef s32 compat_pid_t; +-typedef u32 __compat_uid_t; +-typedef u32 __compat_gid_t; ++typedef u16 __compat_uid_t; ++typedef u16 __compat_gid_t; + typedef u16 __compat_uid16_t; + typedef u16 __compat_gid16_t; + typedef u32 __compat_uid32_t; diff --git a/queue-3.10/ecryptfs-avoid-to-access-null-pointer-when-write-metadata-in-xattr.patch b/queue-3.10/ecryptfs-avoid-to-access-null-pointer-when-write-metadata-in-xattr.patch new file mode 100644 index 00000000000..9aa48687071 --- /dev/null +++ b/queue-3.10/ecryptfs-avoid-to-access-null-pointer-when-write-metadata-in-xattr.patch @@ -0,0 +1,87 @@ +From 35425ea2492175fd39f6116481fe98b2b3ddd4ca Mon Sep 17 00:00:00 2001 +From: Chao Yu +Date: Thu, 24 Jul 2014 17:25:42 +0800 +Subject: ecryptfs: avoid to access NULL pointer when write metadata in xattr + +From: Chao Yu + +commit 35425ea2492175fd39f6116481fe98b2b3ddd4ca upstream. + +Christopher Head 2014-06-28 05:26:20 UTC described: +"I tried to reproduce this on 3.12.21. Instead, when I do "echo hello > foo" +in an ecryptfs mount with ecryptfs_xattr specified, I get a kernel crash: + +BUG: unable to handle kernel NULL pointer dereference at (null) +IP: [] fsstack_copy_attr_all+0x2/0x61 +PGD d7840067 PUD b2c3c067 PMD 0 +Oops: 0002 [#1] SMP +Modules linked in: nvidia(PO) +CPU: 3 PID: 3566 Comm: bash Tainted: P O 3.12.21-gentoo-r1 #2 +Hardware name: ASUSTek Computer Inc. G60JX/G60JX, BIOS 206 03/15/2010 +task: ffff8801948944c0 ti: ffff8800bad70000 task.ti: ffff8800bad70000 +RIP: 0010:[] [] fsstack_copy_attr_all+0x2/0x61 +RSP: 0018:ffff8800bad71c10 EFLAGS: 00010246 +RAX: 00000000000181a4 RBX: ffff880198648480 RCX: 0000000000000000 +RDX: 0000000000000004 RSI: ffff880172010450 RDI: 0000000000000000 +RBP: ffff880198490e40 R08: 0000000000000000 R09: 0000000000000000 +R10: ffff880172010450 R11: ffffea0002c51e80 R12: 0000000000002000 +R13: 000000000000001a R14: 0000000000000000 R15: ffff880198490e40 +FS: 00007ff224caa700(0000) GS:ffff88019fcc0000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 0000000000000000 CR3: 00000000bb07f000 CR4: 00000000000007e0 +Stack: +ffffffff811826e8 ffff8800a39d8000 0000000000000000 000000000000001a +ffff8800a01d0000 ffff8800a39d8000 ffffffff81185fd5 ffffffff81082c2c +00000001a39d8000 53d0abbc98490e40 0000000000000037 ffff8800a39d8220 +Call Trace: +[] ? ecryptfs_setxattr+0x40/0x52 +[] ? ecryptfs_write_metadata+0x1b3/0x223 +[] ? should_resched+0x5/0x23 +[] ? ecryptfs_initialize_file+0xaf/0xd4 +[] ? ecryptfs_create+0xf4/0x142 +[] ? vfs_create+0x48/0x71 +[] ? do_last.isra.68+0x559/0x952 +[] ? link_path_walk+0xbd/0x458 +[] ? path_openat+0x224/0x472 +[] ? do_filp_open+0x2b/0x6f +[] ? __alloc_fd+0xd6/0xe7 +[] ? do_sys_open+0x65/0xe9 +[] ? system_call_fastpath+0x16/0x1b +RIP [] fsstack_copy_attr_all+0x2/0x61 +RSP +CR2: 0000000000000000 +---[ end trace df9dba5f1ddb8565 ]---" + +If we create a file when we mount with ecryptfs_xattr_metadata option, we will +encounter a crash in this path: +->ecryptfs_create + ->ecryptfs_initialize_file + ->ecryptfs_write_metadata + ->ecryptfs_write_metadata_to_xattr + ->ecryptfs_setxattr + ->fsstack_copy_attr_all +It's because our dentry->d_inode used in fsstack_copy_attr_all is NULL, and it +will be initialized when ecryptfs_initialize_file finish. + +So we should skip copying attr from lower inode when the value of ->d_inode is +invalid. + +Signed-off-by: Chao Yu +Signed-off-by: Tyler Hicks +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ecryptfs/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ecryptfs/inode.c ++++ b/fs/ecryptfs/inode.c +@@ -1051,7 +1051,7 @@ ecryptfs_setxattr(struct dentry *dentry, + } + + rc = vfs_setxattr(lower_dentry, name, value, size, flags); +- if (!rc) ++ if (!rc && dentry->d_inode) + fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode); + out: + return rc; diff --git a/queue-3.10/series b/queue-3.10/series index 6dcde28dbbc..9e39928a037 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -35,3 +35,9 @@ mm-clear-__gfp_fs-when-pf_memalloc_noio-is-set.patch fanotify-enable-close-on-exec-on-events-fd-when-requested-in-fanotify_init.patch kernel-add-support-for-gcc-5.patch spi-dw-mid-terminate-ongoing-transfers-at-exit.patch +arm64-compat-fix-compat-types-affecting-struct.patch +alsa-pcm-use-the-same-dma-mmap-codepath-both-for-arm-and-arm64.patch +alsa-emu10k1-fix-deadlock-in-synth-voice-lookup.patch +alsa-usb-audio-add-support-for-steinberg-ur22-usb-interface.patch +arm-at91-pmc-don-t-forget-to-write-pmc_pcdr-register-to-disable-clocks.patch +ecryptfs-avoid-to-access-null-pointer-when-write-metadata-in-xattr.patch