Linux 3.14.60
Greg KH
maintainerI'm announcing the release of the 3.14.60 kernel.
All users of the 3.14 kernel series must upgrade.
The updated 3.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.14.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 - arch/arm64/include/asm/kvm_emulate.h | 8 +++-- arch/arm64/kernel/ptrace.c | 6 ++++ arch/arm64/kernel/setup.c | 4 ++ arch/arm64/kvm/inject_fault.c | 2 - arch/arm64/mm/mmu.c | 3 ++ arch/mn10300/Kconfig | 4 -- arch/openrisc/Kconfig | 4 -- arch/powerpc/include/asm/cmpxchg.h | 16 +++++----- arch/powerpc/include/asm/reg.h | 1 arch/powerpc/include/asm/synch.h | 2 - arch/powerpc/kernel/process.c | 18 ++++++++++++ arch/powerpc/kernel/signal_32.c | 14 ++++++--- arch/powerpc/kernel/signal_64.c | 4 ++ arch/powerpc/kvm/book3s_hv.c | 6 ++++ arch/x86/include/asm/boot.h | 2 - arch/x86/kernel/reboot.c | 8 +++++ arch/x86/kernel/signal.c | 17 ++++++----- arch/x86/xen/suspend.c | 3 +- drivers/char/ipmi/ipmi_si_intf.c | 8 ++--- drivers/connector/connector.c | 11 ++----- drivers/hid/hid-core.c | 2 - drivers/isdn/i4l/isdn_ppp.c | 12 +++++--- drivers/net/bonding/bond_main.c | 5 ++- drivers/net/ppp/ppp_generic.c | 6 +--- drivers/net/slip/slhc.c | 12 +++++--- drivers/net/slip/slip.c | 2 - drivers/net/team/team.c | 6 ++-- drivers/net/veth.c | 6 ---- drivers/parisc/iommu-helpers.h | 15 +++++----- drivers/usb/host/xhci.c | 12 ++++++++ drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/ipaq.c | 3 +- drivers/xen/gntdev.c | 2 - include/linux/sched.h | 1 include/linux/syscalls.h | 2 - include/linux/types.h | 2 - include/net/inet_ecn.h | 19 ++++++++++-- net/bridge/br_stp_if.c | 5 ++- net/core/dst.c | 3 +- net/ipv4/tcp_yeah.c | 2 - net/ipv6/addrlabel.c | 2 - net/ipv6/xfrm6_mode_tunnel.c | 2 - net/phonet/af_phonet.c | 4 ++ net/sctp/sm_statefuns.c | 6 ++-- net/sctp/socket.c | 3 -- net/sctp/sysctl.c | 2 - net/unix/af_unix.c | 24 +++++++++++++--- net/unix/garbage.c | 16 ++++++++-- scripts/recordmcount.pl | 3 +- sound/core/control.c | 2 + sound/core/hrtimer.c | 3 +- sound/core/pcm_compat.c | 13 ++++++-- sound/core/seq/seq_clientmgr.c | 2 - sound/core/seq/seq_compat.c | 9 +++--- sound/core/seq/seq_queue.c | 2 + sound/core/timer.c | 52 ++++++++++++++++++++++------------- sound/pci/hda/hda_intel.c | 39 ++++++++++++++++++++++++++ sound/pci/hda/patch_realtek.c | 12 ++++++-- sound/pci/hda/patch_sigmatel.c | 1 sound/pci/rme96.c | 41 +++++++++++++++++---------- sound/soc/codecs/arizona.c | 2 - sound/soc/codecs/wm8962.c | 4 +- sound/soc/codecs/wm8974.c | 1 sound/soc/soc-compress.c | 23 +++++++++++++-- 65 files changed, 375 insertions(+), 154 deletions(-)
Alexandra Yates (1):
ALSA: hda - Add Intel Lewisburg device IDs Audio
Andrew Morton (1):
openrisc: fix CONFIG_UID16 setting
Andrey Ryabinin (1):
ipv6/addrlabel: fix ip6addrlbl_get()
Arnd Bergmann (1):
arm64: fix building without CONFIG_UID16
Ben Hutchings (2):
isdn_ppp: Add checks for allocation failure in isdn_ppp_open() ppp, slip: Validate VJ compression slot parameters completely
Boqun Feng (2):
powerpc: Make value-returning atomics fully ordered
powerpc: Make {cmp}xchg* and their atomic_ versions fully ordered
Boris Ostrovsky (1):
xen/gntdev: Grant maps should not be subject to NUMA balancing
Chunfeng Yun (1):
usb: xhci: fix config fail of FS hub behind a HS hub with MTT
Dan Carpenter (1):
USB: ipaq.c: fix a timeout loop
David Henningsson (1):
ALSA: hda - Add inverted dmic for Packard Bell DOTS
Dmitry V. Levin (1):
x86/signal: Fix restart_syscall number for x32 tasks
Eric Dumazet (2):
phonet: properly unshare skbs in phonet_rcv()
ipv6: update skb->csum when CE mark is propagated
Florian Westphal (1):
connector: bump skb->users before callback invocation
Francesco Ruggeri (1):
net: possible use after free in dst_release
Greg Kroah-Hartman (1):
Linux 3.14.60
Guenter Roeck (1):
mn10300: Select CONFIG_HAVE_UID16 to fix build failure
H.J. Lu (1):
x86/boot: Double BOOT_HEAP_SIZE to 64KB
Hannes Frederic Sowa (1):
bridge: Only call /sbin/bridge-stp for the initial network namespace
Ido Schimmel (1):
team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid
Jan Stancek (1):
ipmi: move timer init to before irq is setup
John Blackwood (1):
arm64: Clear out any singlestep state on a ptrace detach operation
Karl Heiss (1):
bonding: Prevent IPv6 link local address on enslaved devices
Mans Rullgard (1):
ASoC: wm8974: set cache type for regmap
Marc Zyngier (1):
arm64: KVM: Fix AArch32 to AArch64 register mapping
Mario Kleiner (2):
x86/reboot/quirks: Add iMac10,1 to pci_reboot_dmi_table[]
ALSA: hda/realtek - Fix silent headphone output on MacPro 4,1 (v2)
Michael Neuling (2):
powerpc/tm: Block signal return setting invalid MSR state powerpc/tm: Check for already reclaimed tasks
Mikulas Patocka (1):
parisc iommu: fix panic due to trying to allocate too large region
Neal Cardwell (1):
tcp_yeah: don't set ssthresh below 2
Nicolas Boichat (2):
ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode
ALSA: pcm: Fix snd_pcm_hw_params struct copy in compat mode
Nikesh Oswal (1):
ASoC: arizona: Fix bclk for sample rates that are multiple of 4kHz
Oliver Freyermuth (1):
USB: cp210x: add ID for ELV Marble Sound Board 1
Oliver Neukum (1):
xhci: refuse loading if nousb is used
Ouyang Zhaowei (Charles) (1):
x86/xen: don't reset vcpu_info on a cancelled suspend
Paul Mackerras (1):
KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR
Richard Purdie (1):
HID: core: Avoid uninitialized buffer access
Sachin Pandhare (1):
ASoC: wm8962: correct addresses for HPF_C_0/1
Sasha Levin (1):
net: sctp: prevent writes to cookie_hmac_alg from accessing invalid memory
Takashi Iwai (9):
ALSA: hda - Apply pin fixup for HP ProBook 6550b
ALSA: rme96: Fix unexpected volume reset after rate changes
ALSA: seq: Fix missing NULL check at remove_events ioctl
ALSA: seq: Fix race at timer setup and close
ALSA: timer: Harden slave timer list handling
ALSA: timer: Fix race among timer ioctls
ALSA: timer: Fix double unlink of active_list
ALSA: hrtimer: Fix stall by hrtimer_cancel()
ALSA: control: Avoid kernel warnings from tlv ioctl with numid 0
Ulrich Weigand (1):
scripts/recordmcount.pl: support data in text section on powerpc
Vijay Pandurangan (1):
veth: don’t modify ip_summed; doing so treats packets with bad checksums as good.
Vinod Koul (1):
ASoC: compress: Fix compress device direction check
Will Deacon (1):
arm64: mm: ensure that the zero page is visible to the page table walker
Xin Long (1):
sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close
Xiong Zhang (1):
ALSA: hda - Set SKL+ hda controller power at freeze() and thaw()
Yang Shi (1):
arm64: restore bogomips information in /proc/cpuinfo
willy tarreau (1):
unix: properly account for FDs passed over unix sockets
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 14 -SUBLEVEL = 59 +SUBLEVEL = 60 EXTRAVERSION = NAME = Remembering Coco
arch/arm64/include/asm/kvm_emulate.h +5 -3
@@ -86,11 +86,13 @@ static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu) *vcpu_cpsr (vcpu) |=COMPAT_PSR_T_BIT ; } +/* +* vcpu_reg should always be passed a register number coming from a +* read of ESR_EL2. Otherwise, it may give the wrong result on AArch32 +* with banked registers. +*/ static inline unsigned long *vcpu_reg (const struct kvm_vcpu *vcpu,u8 reg_num) { -if (vcpu_mode_is_32bit (vcpu)) -return vcpu_reg32 (vcpu, reg_num); -return (unsigned long *)&vcpu_gp_regs (vcpu)->regs.regs[reg_num]; }
arch/arm64/kernel/ptrace.c +6 -0
@@ -51,6 +51,12 @@*/ void ptrace_disable (struct task_struct *child) { +/* +* This would be better off in core code, but PTRACE_DETACH has +* grown its fair share of arch-specific worts and changing it +* is likely to cause regressions on obscure architectures. +*/ +user_disable_single_step (child); }#ifdef CONFIG_HAVE_HW_BREAKPOINT
arch/arm64/kernel/setup.c +4 -0
@@ -446,6 +446,10 @@ static int c_show(struct seq_file *m, void *v)seq_printf (m,"processor\t: %d\n" , i);#endif +seq_printf (m,"BogoMIPS\t: %lu.%02lu\n" , + loops_per_jiffy / (500000UL /HZ ), + loops_per_jiffy / (5000UL /HZ ) %100 ); +/* * Dump out the common processor features in a single line. * Userspace should read the hwcaps with getauxval(AT_HWCAP)
arch/arm64/kvm/inject_fault.c +1 -1
@@ -48,7 +48,7 @@ static void prepare_fault32(struct kvm_vcpu *vcpu, u32 mode, u32 vect_offset)/* Note: These now point to the banked copies */ *vcpu_spsr (vcpu) = new_spsr_value; - *vcpu_reg (vcpu,14 ) = *vcpu_pc (vcpu) + return_offset; + *vcpu_reg32 (vcpu,14 ) = *vcpu_pc (vcpu) + return_offset;/* Branch to exception vector */ if (sctlr & (1 <<13 ))
arch/arm64/mm/mmu.c +3 -0
@@ -374,6 +374,9 @@ void __init paging_init(void) empty_zero_page =virt_to_page (zero_page); +/* Ensure the zero page is visible to the page table walker */ +dsb (ishst); +/* * TTBR0 is only used for the identity mapping at this stage. Make it * point to zero page to avoid speculatively fetching new entries.
arch/mn10300/Kconfig +1 -3
@@ -1,6 +1,7 @@ config MN10300 def_bool y select HAVE_OPROFILE + select HAVE_UID16 select GENERIC_IRQ_SHOW select ARCH_WANT_IPC_PARSE_VERSION select HAVE_ARCH_TRACEHOOK
@@ -37,9 +38,6 @@ config HIGHMEM config NUMA def_bool n -config UID16 - def_bool y - config RWSEM_GENERIC_SPINLOCK def_bool y
arch/openrisc/Kconfig +1 -3
@@ -16,6 +16,7 @@ config OPENRISC select GENERIC_IRQ_SHOW select GENERIC_IOMAP select GENERIC_CPU_DEVICES + select HAVE_UID16 select GENERIC_ATOMIC64 select GENERIC_CLOCKEVENTS select GENERIC_STRNCPY_FROM_USER
@@ -29,9 +30,6 @@ config MMU config HAVE_DMA_ATTRS def_bool y -config UID16 - def_bool y - config RWSEM_GENERIC_SPINLOCK def_bool y
arch/powerpc/include/asm/cmpxchg.h +8 -8
@@ -18,12 +18,12 @@ __xchg_u32(volatile void *p, unsigned long val)unsigned long prev; __asm__ __volatile__( -PPC_RELEASE_BARRIER +PPC_ATOMIC_ENTRY_BARRIER "1: lwarx %0,0,%2 \n" PPC405_ERR77(0,%2)" stwcx. %3,0,%2 \n\ bne- 1b" -PPC_ACQUIRE_BARRIER +PPC_ATOMIC_EXIT_BARRIER : "=&r" (prev), "+m" (*(volatile unsigned int *)p) : "r" (p), "r" (val) : "cc", "memory");
@@ -61,12 +61,12 @@ __xchg_u64(volatile void *p, unsigned long val)unsigned long prev; __asm__ __volatile__( -PPC_RELEASE_BARRIER +PPC_ATOMIC_ENTRY_BARRIER "1: ldarx %0,0,%2 \n" PPC405_ERR77(0,%2)" stdcx. %3,0,%2 \n\ bne- 1b" -PPC_ACQUIRE_BARRIER +PPC_ATOMIC_EXIT_BARRIER : "=&r" (prev), "+m" (*(volatile unsigned long *)p) : "r" (p), "r" (val) : "cc", "memory");
@@ -152,14 +152,14 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)unsigned int prev; __asm__ __volatile__ ( -PPC_RELEASE_BARRIER +PPC_ATOMIC_ENTRY_BARRIER "1: lwarx %0,0,%2 # __cmpxchg_u32\n\ cmpw 0,%0,%3\n\ bne- 2f\n" PPC405_ERR77(0,%2)" stwcx. %4,0,%2\n\ bne- 1b" -PPC_ACQUIRE_BARRIER +PPC_ATOMIC_EXIT_BARRIER "\n\ 2:" : "=&r" (prev), "+m" (*p)
@@ -198,13 +198,13 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)unsigned long prev; __asm__ __volatile__ ( -PPC_RELEASE_BARRIER +PPC_ATOMIC_ENTRY_BARRIER "1: ldarx %0,0,%2 # __cmpxchg_u64\n\ cmpd 0,%0,%3\n\ bne- 2f\n\ stdcx. %4,0,%2\n\ bne- 1b" -PPC_ACQUIRE_BARRIER +PPC_ATOMIC_EXIT_BARRIER "\n\ 2:" : "=&r" (prev), "+m" (*p)
arch/powerpc/include/asm/reg.h +1 -0
@@ -108,6 +108,7 @@#define MSR_TS_T __MASK(MSR_TS_T_LG)/* Transaction Transactional */ #define MSR_TS_MASK (MSR_TS_T | MSR_TS_S)/* Transaction State bits */ #define MSR_TM_ACTIVE (x) (((x) & MSR_TS_MASK) != 0)/* Transaction active? */ +#define MSR_TM_RESV (x) (((x) & MSR_TS_MASK) == MSR_TS_MASK)/* Reserved */ #define MSR_TM_TRANSACTIONAL (x) (((x) & MSR_TS_MASK) == MSR_TS_T)#define MSR_TM_SUSPENDED (x) (((x) & MSR_TS_MASK) == MSR_TS_S)
arch/powerpc/include/asm/synch.h +1 -1
@@ -44,7 +44,7 @@ static inline void isync(void)MAKE_LWSYNC_SECTION_ENTRY (97 , __lwsync_fixup);#define PPC_ACQUIRE_BARRIER "\n" stringify_in_c(__PPC_ACQUIRE_BARRIER)#define PPC_RELEASE_BARRIER stringify_in_c(LWSYNC) "\n" -#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(LWSYNC) "\n" +#define PPC_ATOMIC_ENTRY_BARRIER "\n" stringify_in_c(sync) "\n"#define PPC_ATOMIC_EXIT_BARRIER "\n" stringify_in_c(sync) "\n"#else #define PPC_ACQUIRE_BARRIER
arch/powerpc/kernel/process.c +18 -0
@@ -545,6 +545,24 @@ static void tm_reclaim_thread(struct thread_struct *thr, msr_diff &=MSR_FP |MSR_VEC |MSR_VSX |MSR_FE0 |MSR_FE1 ; } +/* +* Use the current MSR TM suspended bit to track if we have +* checkpointed state outstanding. +* On signal delivery, we'd normally reclaim the checkpointed +* state to obtain stack pointer (see:get_tm_stackpointer()). +* This will then directly return to userspace without going +* through __switch_to(). However, if the stack frame is bad, +* we need to exit this thread which calls __switch_to() which +* will again attempt to reclaim the already saved tm state. +* Hence we need to check that we've not already reclaimed +* this state. +* We do this using the current MSR, rather tracking it in +* some specific thread_struct bit, as it has the additional +* benifit of checking for a potential TM bad thing exception. +*/ +if (!MSR_TM_SUSPENDED (mfmsr ())) +return ; +tm_reclaim (thr, thr->regs->msr, cause);/* Having done the reclaim, we now have the checkpointed
arch/powerpc/kernel/signal_32.c +9 -5
@@ -876,6 +876,15 @@ static long restore_tm_user_regs(struct pt_regs *regs,return 1 ;#endif /* CONFIG_SPE */ +/* Get the top half of the MSR from the user context */ +if (__get_user (msr_hi, &tm_sr->mc_gregs[PT_MSR ])) +return 1 ; + msr_hi <<=32 ; +/* If TM bits are set to the reserved value, it's an invalid context */ +if (MSR_TM_RESV (msr_hi)) +return 1 ; +/* Pull in the MSR TM bits from the user context */ + regs->msr = (regs->msr & ~MSR_TS_MASK ) | (msr_hi &MSR_TS_MASK );/* Now, recheckpoint. This loads up all of the checkpointed (older) * registers, including FP and V[S]Rs. After recheckpointing, the * transactional versions should be loaded.
@@ -885,11 +894,6 @@ static long restore_tm_user_regs(struct pt_regs *regs, current->thread.tm_texasr |=TEXASR_FS ;/* This loads the checkpointed FP/VEC state, if used */ tm_recheckpoint (¤t->thread, msr); -/* Get the top half of the MSR */ -if (__get_user (msr_hi, &tm_sr->mc_gregs[PT_MSR ])) -return 1 ; -/* Pull in MSR TM from user context */ - regs->msr = (regs->msr & ~MSR_TS_MASK ) | ((msr_hi<<32 ) &MSR_TS_MASK );/* This loads the speculative FP/VEC state, if used */ if (msr &MSR_FP ) {
arch/powerpc/kernel/signal_64.c +4 -0
@@ -428,6 +428,10 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,/* get MSR separately, transfer the LE bit if doing signal return */ err |=__get_user (msr, &sc->gp_regs[PT_MSR ]); +/* Don't allow reserved mode. */ +if (MSR_TM_RESV (msr)) +return -EINVAL ; +/* pull in MSR TM from user context */ regs->msr = (regs->msr & ~MSR_TS_MASK ) | (msr &MSR_TS_MASK );
arch/powerpc/kvm/book3s_hv.c +6 -0
@@ -166,6 +166,12 @@ static void kvmppc_core_vcpu_put_hv(struct kvm_vcpu *vcpu)static void kvmppc_set_msr_hv (struct kvm_vcpu *vcpu,u64 msr) { +/* +* Check for illegal transactional state bit combination +* and if we find it, force the TS field to a safe state. +*/ +if ((msr &MSR_TS_MASK ) ==MSR_TS_MASK ) + msr &= ~MSR_TS_MASK ; vcpu->arch.shregs.msr = msr;kvmppc_end_cede (vcpu); }
arch/x86/include/asm/boot.h +1 -1
@@ -27,7 +27,7 @@#define BOOT_HEAP_SIZE 0x400000#else /* !CONFIG_KERNEL_BZIP2 */ -#define BOOT_HEAP_SIZE 0x8000 +#define BOOT_HEAP_SIZE 0x10000#endif /* !CONFIG_KERNEL_BZIP2 */
arch/x86/kernel/reboot.c +8 -0
@@ -180,6 +180,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"), }, }, + { /* Handle problems with rebooting on the iMac10,1. */ + .callback = set_pci_reboot, + .ident = "Apple iMac10,1", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "iMac10,1"), + }, + },/* ASRock */ {/* Handle problems with rebooting on ASRock Q1900DC-ITX */
arch/x86/kernel/signal.c +10 -7
@@ -682,12 +682,15 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)signal_setup_done (failed, ksig,test_thread_flag (TIF_SINGLESTEP )); } -#ifdef CONFIG_X86_32 -#define NR_restart_syscall __NR_restart_syscall -#else /* !CONFIG_X86_32 */ -#define NR_restart_syscall \ - test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall -#endif /* CONFIG_X86_32 */ +static inline unsigned long get_nr_restart_syscall (const struct pt_regs *regs) +{ +#if defined(CONFIG_X86_32 ) || !defined(CONFIG_X86_64 ) +return __NR_restart_syscall; +#else /* !CONFIG_X86_32 && CONFIG_X86_64 */ +return test_thread_flag (TIF_IA32 ) ? __NR_ia32_restart_syscall : + __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); +#endif /* CONFIG_X86_32 || !CONFIG_X86_64 */ +}/* * Note that 'init' is a special process: it doesn't get signals it doesn't
@@ -716,7 +719,7 @@ static void do_signal(struct pt_regs *regs)break ;case -ERESTART_RESTARTBLOCK : - regs->ax = NR_restart_syscall; + regs->ax =get_nr_restart_syscall (regs); regs->ip -=2 ;break ; }
arch/x86/xen/suspend.c +2 -1
@@ -30,7 +30,8 @@ void xen_arch_hvm_post_suspend(int suspend_cancelled) {#ifdef CONFIG_XEN_PVHVM int cpu; -xen_hvm_init_shared_info (); +if (!suspend_cancelled) +xen_hvm_init_shared_info ();xen_callback_vector ();xen_unplug_emulated_devices ();if (xen_feature (XENFEAT_hvm_safe_pvclock)) {
drivers/char/ipmi/ipmi_si_intf.c +4 -4
@@ -1152,14 +1152,14 @@ static int smi_start_processing(void *send_info, new_smi->intf = intf; -/* Try to claim any interrupts. */ -if (new_smi->irq_setup) - new_smi->irq_setup (new_smi); -/* Set up the timer that drives the interface. */ setup_timer (&new_smi->si_timer, smi_timeout, (long )new_smi);smi_mod_timer (new_smi, jiffies +SI_TIMEOUT_JIFFIES ); +/* Try to claim any interrupts. */ +if (new_smi->irq_setup) + new_smi->irq_setup (new_smi); +/* * Check if the user forcefully enabled the daemon. */
drivers/connector/connector.c +3 -8
@@ -154,26 +154,21 @@ static int cn_call_callback(struct sk_buff *skb)* * It checks skb, netlink header and msg sizes, and calls callback helper. */ -static void cn_rx_skb (struct sk_buff *__skb) +static void cn_rx_skb (struct sk_buff *skb) {struct nlmsghdr *nlh; -struct sk_buff *skb;int len, err; - skb =skb_get (__skb); -if (skb->len >=NLMSG_HDRLEN ) { nlh =nlmsg_hdr (skb); len =nlmsg_len (nlh);if (len < (int )sizeof (struct cn_msg ) || skb->len < nlh->nlmsg_len || - len >CONNECTOR_MAX_MSG_SIZE ) { -kfree_skb (skb); + len >CONNECTOR_MAX_MSG_SIZE )return ; - } - err =cn_call_callback (skb); + err =cn_call_callback (skb_get (skb));if (err <0 )kfree_skb (skb); }
drivers/hid/hid-core.c +1 -1
@@ -1506,7 +1506,7 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) "Multi-Axis Controller" };const char *type, *bus; -char buf[64 ]; +char buf[64 ] ="" ;unsigned int i;int len;int ret;
drivers/isdn/i4l/isdn_ppp.c +8 -4
@@ -301,6 +301,8 @@ isdn_ppp_open(int min, struct file *file) is->compflags =0 ; is->reset =isdn_ppp_ccp_reset_alloc (is); +if (!is->reset) +return -ENOMEM ; is->lp =NULL ; is->mp_seqno =0 ;/* MP sequence number */
@@ -320,6 +322,10 @@ isdn_ppp_open(int min, struct file *file)* VJ header compression init */ is->slcomp =slhc_init (16 ,16 );/* not necessary for 2. link in bundle */ +if (IS_ERR (is->slcomp)) { +isdn_ppp_ccp_reset_free (is); +return PTR_ERR (is->slcomp); + }#endif #ifdef CONFIG_IPPP_FILTER is->pass_filter =NULL ;
@@ -568,10 +574,8 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) is->maxcid = val;#ifdef CONFIG_ISDN_PPP_VJ sltmp =slhc_init (16 , val); -if (!sltmp) { -printk (KERN_ERR "ippp, can't realloc slhc struct\n" ); -return -ENOMEM ; - } +if (IS_ERR (sltmp)) +return PTR_ERR (sltmp);if (is->slcomp)slhc_free (is->slcomp); is->slcomp = sltmp;
drivers/net/bonding/bond_main.c +4 -1
@@ -1181,7 +1181,6 @@ static int bond_master_upper_dev_link(struct net_device *bond_dev, err =netdev_master_upper_dev_link_private (slave_dev, bond_dev, slave);if (err)return err; - slave_dev->flags |=IFF_SLAVE ;rtmsg_ifinfo (RTM_NEWLINK , slave_dev,IFF_SLAVE ,GFP_KERNEL );return 0 ; }
@@ -1363,6 +1362,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) } } +/* set slave flag before open to prevent IPv6 addrconf */ + slave_dev->flags |=IFF_SLAVE ; +/* open the slave since the application closed it */ res =dev_open (slave_dev);if (res) {
@@ -1617,6 +1619,7 @@ err_close:dev_close (slave_dev); err_restore_mac: + slave_dev->flags &= ~IFF_SLAVE ;if (!bond->params.fail_over_mac || bond->params.mode !=BOND_MODE_ACTIVEBACKUP ) {/* XXX TODO - fom follow mode needs to change master's
drivers/net/ppp/ppp_generic.c +2 -4
@@ -716,10 +716,8 @@ static long ppp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) val &=0xffff ; } vj =slhc_init (val2+1 , val+1 ); -if (!vj) { -netdev_err (ppp->dev, -"PPP: no memory (VJ compressor)\n" ); - err = -ENOMEM ; +if (IS_ERR (vj)) { + err =PTR_ERR (vj);break ; }ppp_lock (ppp);
drivers/net/slip/slhc.c +8 -4
@@ -84,8 +84,9 @@ static long decode(unsigned char **cpp);static unsigned char *put16 (unsigned char *cp,unsigned short x);static unsigned short pull16 (unsigned char **cpp); -/* Initialize compression data structure +/* Allocate compression data structure * slots must be in range 0 to 255 (zero meaning no compression) +* Returns pointer to structure or ERR_PTR() on error. */ struct slcompress *slhc_init (int rslots,int tslots)
@@ -94,11 +95,14 @@ slhc_init(int rslots, int tslots) registerstruct cstate *ts;struct slcompress *comp; +if (rslots <0 || rslots >255 || tslots <0 || tslots >255 ) +return ERR_PTR (-EINVAL ); + comp =kzalloc (sizeof (struct slcompress ),GFP_KERNEL );if (! comp) goto out_fail; -if ( rslots >0 && rslots <256 ) { +if (rslots >0 ) {size_t rsize = rslots *sizeof (struct cstate ); comp->rstate =kzalloc (rsize,GFP_KERNEL );if (! comp->rstate)
@@ -106,7 +110,7 @@ slhc_init(int rslots, int tslots) comp->rslot_limit = rslots -1 ; } -if ( tslots >0 && tslots <256 ) { +if (tslots >0 ) {size_t tsize = tslots *sizeof (struct cstate ); comp->tstate =kzalloc (tsize,GFP_KERNEL );if (! comp->tstate)
@@ -141,7 +145,7 @@ out_free2: out_free:kfree (comp); out_fail: -return NULL ; +return ERR_PTR (-ENOMEM ); }
drivers/net/slip/slip.c +1 -1
@@ -164,7 +164,7 @@ static int sl_alloc_bufs(struct slip *sl, int mtu)if (cbuff ==NULL ) goto err_exit; slcomp =slhc_init (16 ,16 ); -if (slcomp ==NULL ) +if (IS_ERR (slcomp)) goto err_exit;#endif spin_lock_bh (&sl->lock);
drivers/net/team/team.c +3 -3
@@ -1838,10 +1838,10 @@ static int team_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)struct team *team =netdev_priv (dev);struct team_port *port; -rcu_read_lock (); -list_for_each_entry_rcu (port, &team->port_list, list) +mutex_lock (&team->lock); +list_for_each_entry (port, &team->port_list, list)vlan_vid_del (port->dev, proto, vid); -rcu_read_unlock (); +mutex_unlock (&team->lock);return 0 ; }
drivers/net/veth.c +0 -6
@@ -116,12 +116,6 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)kfree_skb (skb); goto drop; } -/* don't change ip_summed == CHECKSUM_PARTIAL, as that -* will cause bad checksum on forwarded packets -*/ -if (skb->ip_summed ==CHECKSUM_NONE && - rcv->features &NETIF_F_RXCSUM ) - skb->ip_summed =CHECKSUM_UNNECESSARY ;if (likely (dev_forward_skb (rcv, skb) ==NET_RX_SUCCESS )) {struct pcpu_vstats *stats =this_cpu_ptr (dev->vstats);
drivers/parisc/iommu-helpers.h +8 -7
@@ -104,7 +104,11 @@ iommu_coalesce_chunks(struct ioc *ioc, struct device *dev,struct scatterlist *contig_sg;/* contig chunk head */ unsigned long dma_offset, dma_len;/* start/len of DMA stream */ unsigned int n_mappings =0 ; -unsigned int max_seg_size =dma_get_max_seg_size (dev); +unsigned int max_seg_size =min (dma_get_max_seg_size (dev), + (unsigned )DMA_CHUNK_SIZE ); +unsigned int max_seg_boundary =dma_get_seg_boundary (dev) +1 ; +if (max_seg_boundary)/* check if the addition above didn't overflow */ + max_seg_size =min (max_seg_size, max_seg_boundary);while (nents >0 ) {
@@ -139,14 +143,11 @@ iommu_coalesce_chunks(struct ioc *ioc, struct device *dev,/* ** First make sure current dma stream won't -** exceed DMA_CHUNK_SIZE if we coalesce the +** exceed max_seg_size if we coalesce the ** next entry. */ -if (unlikely (ALIGN (dma_len + dma_offset + startsg->length, -IOVP_SIZE ) >DMA_CHUNK_SIZE )) -break ; - -if (startsg->length + dma_len > max_seg_size) +if (unlikely (ALIGN (dma_len + dma_offset + startsg->length,IOVP_SIZE ) > + max_seg_size))break ;/*
drivers/usb/host/xhci.c +12 -0
@@ -4696,8 +4696,16 @@ int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, ctrl_ctx->add_flags |=cpu_to_le32 (SLOT_FLAG ); slot_ctx =xhci_get_slot_ctx (xhci, config_cmd->in_ctx); slot_ctx->dev_info |=cpu_to_le32 (DEV_HUB ); +/* +* refer to section 6.2.2: MTT should be 0 for full speed hub, +* but it may be already set to 1 when setup an xHCI virtual +* device, so clear it anyway. +*/ if (tt->multi) slot_ctx->dev_info |=cpu_to_le32 (DEV_MTT ); +else if (hdev->speed ==USB_SPEED_FULL ) + slot_ctx->dev_info &=cpu_to_le32 (~DEV_MTT ); +if (xhci->hci_version >0x95 ) { xhci_dbg(xhci, "xHCI version %x needs hub " "TT think time and number of ports\n",
@@ -4885,6 +4893,10 @@ static int __init xhci_hcd_init(void)BUILD_BUG_ON (sizeof (struct xhci_intr_reg ) !=8 *32 /8 );/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */ BUILD_BUG_ON (sizeof (struct xhci_run_regs ) != (8 +8 *128 )*32 /8 ); + +if (usb_disabled ()) +return -ENODEV ; +return 0 ; unreg_pci:xhci_unregister_pci ();
drivers/usb/serial/cp210x.c +1 -0
@@ -160,6 +160,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ + { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
drivers/usb/serial/ipaq.c +2 -1
@@ -531,7 +531,8 @@ static int ipaq_open(struct tty_struct *tty,* through. Since this has a reasonably high failure rate, we retry * several times. */ -while (retries--) { +while (retries) { + retries--; result =usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ),0x22 ,0x21 ,0x1 ,0 ,NULL ,0 ,100 );
drivers/xen/gntdev.c +1 -1
@@ -765,7 +765,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) vma->vm_ops = &gntdev_vmops; - vma->vm_flags |=VM_DONTEXPAND |VM_DONTDUMP ; + vma->vm_flags |=VM_DONTEXPAND |VM_DONTDUMP |VM_IO ;if (use_ptemod) vma->vm_flags |=VM_DONTCOPY ;
include/linux/sched.h +1 -0
@@ -755,6 +755,7 @@ struct user_struct {unsigned long mq_bytes;/* How many bytes can be allocated to mqueue? */ #endif unsigned long locked_shm;/* How many pages of mlocked shm ? */ +unsigned long unix_inflight;/* How many files in flight in unix sockets */ #ifdef CONFIG_KEYS struct key *uid_keyring;/* UID specific keyring */
include/linux/syscalls.h +1 -1
@@ -507,7 +507,7 @@ asmlinkage long sys_chown(const char __user *filename,asmlinkage long sys_lchown (const char __user *filename,uid_t user,gid_t group);asmlinkage long sys_fchown (unsigned int fd,uid_t user,gid_t group); -#ifdef CONFIG_UID16 +#ifdef CONFIG_HAVE_UID16 asmlinkage long sys_chown16 (const char __user *filename,old_uid_t user,old_gid_t group); asmlinkage long sys_lchown16(const char __user *filename,
include/linux/types.h +1 -1
@@ -35,7 +35,7 @@ typedef __kernel_gid16_t gid16_t;typedef unsigned long uintptr_t ; -#ifdef CONFIG_UID16 +#ifdef CONFIG_HAVE_UID16 /* This is defined by include/asm-{arch}/posix_types.h */ typedef __kernel_old_uid_t old_uid_t ;typedef __kernel_old_gid_t old_gid_t ;
include/net/inet_ecn.h +16 -3
@@ -111,11 +111,24 @@ static inline void ipv4_copy_dscp(unsigned int dscp, struct iphdr *inner)struct ipv6hdr ; -static inline int IP6_ECN_set_ce (struct ipv6hdr *iph) +/* Note: +* IP_ECN_set_ce() has to tweak IPV4 checksum when setting CE, +* meaning both changes have no effect on skb->csum if/when CHECKSUM_COMPLETE +* In IPv6 case, no checksum compensates the change in IPv6 header, +* so we have to update skb->csum. +*/ +static inline int IP6_ECN_set_ce (struct sk_buff *skb,struct ipv6hdr *iph) { +__be32 from, to; +if (INET_ECN_is_not_ect (ipv6_get_dsfield (iph)))return 0 ; - *(__be32 *)iph |=htonl (INET_ECN_CE <<20 ); + + from = *(__be32 *)iph; + to = from |htonl (INET_ECN_CE <<20 ); + *(__be32 *)iph = to; +if (skb->ip_summed ==CHECKSUM_COMPLETE ) + skb->csum =csum_add (csum_sub (skb->csum, from), to);return 1 ; }
@@ -142,7 +155,7 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb)case cpu_to_be16 (ETH_P_IPV6 ):if (skb_network_header (skb) +sizeof (struct ipv6hdr ) <=skb_tail_pointer (skb)) -return IP6_ECN_set_ce (ipv6_hdr (skb)); +return IP6_ECN_set_ce (skb,ipv6_hdr (skb));break ; }
net/bridge/br_stp_if.c +4 -1
@@ -128,7 +128,10 @@ static void br_stp_start(struct net_bridge *br)char *argv[] = {BR_STP_PROG , br->dev->name,"start" ,NULL };char *envp[] = {NULL }; - r =call_usermodehelper (BR_STP_PROG , argv, envp,UMH_WAIT_PROC ); +if (net_eq (dev_net (br->dev), &init_net)) + r =call_usermodehelper (BR_STP_PROG , argv, envp,UMH_WAIT_PROC ); +else + r = -ENOENT ;spin_lock_bh (&br->lock);
net/core/dst.c +2 -1
@@ -280,10 +280,11 @@ void dst_release(struct dst_entry *dst) {if (dst) {int newrefcnt; +unsigned short nocache = dst->flags &DST_NOCACHE ; newrefcnt =atomic_dec_return (&dst->__refcnt);WARN_ON (newrefcnt <0 ); -if (!newrefcnt &&unlikely (dst->flags &DST_NOCACHE )) +if (!newrefcnt &&unlikely (nocache))call_rcu (&dst->rcu_head, dst_destroy_rcu); } }
net/ipv4/tcp_yeah.c +1 -1
@@ -223,7 +223,7 @@ static u32 tcp_yeah_ssthresh(struct sock *sk) { yeah->fast_count =0 ; yeah->reno_count =max (yeah->reno_count>>1 ,2U ); -return tp->snd_cwnd - reduction; +return max_t (int, tp->snd_cwnd - reduction,2 ); }static struct tcp_congestion_ops tcp_yeah__read_mostly = {
net/ipv6/addrlabel.c +1 -1
@@ -558,7 +558,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh)rcu_read_lock (); p =__ipv6_addr_label (net, addr,ipv6_addr_type (addr), ifal->ifal_index); -if (p &&ip6addrlbl_hold (p)) +if (p && !ip6addrlbl_hold (p)) p =NULL ; lseq = ip6addrlbl_table.seq;rcu_read_unlock ();
net/ipv6/xfrm6_mode_tunnel.c +1 -1
@@ -83,7 +83,7 @@ static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)struct ipv6hdr *inner_iph =ipipv6_hdr (skb);if (INET_ECN_is_ce (ipv6_get_dsfield (outer_iph))) -IP6_ECN_set_ce (inner_iph); +IP6_ECN_set_ce (skb, inner_iph); }/* Add encapsulation header.
net/phonet/af_phonet.c +4 -0
@@ -377,6 +377,10 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,struct sockaddr_pn sa;u16 len; + skb =skb_share_check (skb,GFP_ATOMIC ); +if (!skb) +return NET_RX_DROP ; +/* check we have at least a full Phonet header */ if (!pskb_pull (skb,sizeof (struct phonethdr ))) goto out;
net/sctp/sm_statefuns.c +4 -2
@@ -4833,7 +4833,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort( retval =SCTP_DISPOSITION_CONSUME ; -sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (abort)); +if (abort) +sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (abort));/* Even if we can't send the ABORT due to low memory delete the * TCB. This is a departure from our typical NOMEM handling.
@@ -4970,7 +4971,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort( SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); retval =SCTP_DISPOSITION_CONSUME ; -sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (abort)); +if (abort) +sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (abort));sctp_add_cmd_sf (commands,SCTP_CMD_NEW_STATE ,SCTP_STATE (SCTP_STATE_CLOSED ));
net/sctp/socket.c +1 -2
@@ -1517,8 +1517,7 @@ static void sctp_close(struct sock *sk, long timeout)struct sctp_chunk *chunk; chunk =sctp_make_abort_user (asoc,NULL ,0 ); -if (chunk) -sctp_primitive_ABORT (net, asoc, chunk); +sctp_primitive_ABORT (net, asoc, chunk); }else sctp_primitive_SHUTDOWN (net, asoc,NULL ); }
net/sctp/sysctl.c +1 -1
@@ -310,7 +310,7 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,struct ctl_table tbl;bool changed = false;char *none ="none" ; -char tmp[8 ]; +char tmp[8 ] = {0 };int ret;memset (&tbl,0 ,sizeof (struct ctl_table ));
net/unix/af_unix.c +20 -4
@@ -1486,6 +1486,21 @@ static void unix_destruct_scm(struct sk_buff *skb)sock_wfree (skb); } +/* +* The "user->unix_inflight" variable is protected by the garbage +* collection lock, and we just read it locklessly here. If you go +* over the limit, there might be a tiny race in actually noticing +* it across threads. Tough. +*/ +static inline bool too_many_unix_fds (struct task_struct *p) +{ +struct user_struct *user =current_user (); + +if (unlikely (user->unix_inflight >task_rlimit (p,RLIMIT_NOFILE ))) +return !capable (CAP_SYS_RESOURCE ) && !capable (CAP_SYS_ADMIN ); +return false; +} +#define MAX_RECURSION_LEVEL 4static int unix_attach_fds (struct scm_cookie *scm,struct sk_buff *skb)
@@ -1494,6 +1509,9 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)unsigned char max_level =0 ;int unix_sock_count =0 ; +if (too_many_unix_fds (current)) +return -ETOOMANYREFS ; +for (i = scm->fp->count -1 ; i >=0 ; i--) {struct sock *sk =unix_get_socket (scm->fp->fp[i]);
@@ -1515,10 +1533,8 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)if (!UNIXCB (skb).fp)return -ENOMEM ; -if (unix_sock_count) { -for (i = scm->fp->count -1 ; i >=0 ; i--) -unix_inflight (scm->fp->fp[i]); - } +for (i = scm->fp->count -1 ; i >=0 ; i--) +unix_inflight (scm->fp->fp[i]);return max_level; }
net/unix/garbage.c +12 -4
@@ -125,9 +125,12 @@ struct sock *unix_get_socket(struct file *filp)void unix_inflight (struct file *fp) {struct sock *s =unix_get_socket (fp); + +spin_lock (&unix_gc_lock); +if (s) {struct unix_sock *u =unix_sk (s); -spin_lock (&unix_gc_lock); +if (atomic_long_inc_return (&u->inflight) ==1 ) {BUG_ON (!list_empty (&u->link));list_add_tail (&u->link, &gc_inflight_list);
@@ -135,22 +138,27 @@ void unix_inflight(struct file *fp)BUG_ON (list_empty (&u->link)); } unix_tot_inflight++; -spin_unlock (&unix_gc_lock); } + fp->f_cred->user->unix_inflight++; +spin_unlock (&unix_gc_lock); }void unix_notinflight (struct file *fp) {struct sock *s =unix_get_socket (fp); + +spin_lock (&unix_gc_lock); +if (s) {struct unix_sock *u =unix_sk (s); -spin_lock (&unix_gc_lock); +BUG_ON (list_empty (&u->link));if (atomic_long_dec_and_test (&u->inflight))list_del_init (&u->link); unix_tot_inflight--; -spin_unlock (&unix_gc_lock); } + fp->f_cred->user->unix_inflight--; +spin_unlock (&unix_gc_lock); } static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
scripts/recordmcount.pl +2 -1
@@ -265,7 +265,8 @@ if ($arch eq "x86_64") { } elsif ($arch eq "powerpc") { $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; - $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:"; + # See comment in the sparc64 section for why we use '\w'. + $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:"; $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$"; if ($bits == 64) {
sound/core/control.c +2 -0
@@ -1325,6 +1325,8 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,return -EFAULT ;if (tlv.length <sizeof (unsigned int ) *2 )return -EINVAL ; +if (!tlv.numid) +return -EINVAL ;down_read (&card->controls_rwsem); kctl =snd_ctl_find_numid (card, tlv.numid);if (kctl ==NULL ) {
sound/core/hrtimer.c +2 -1
@@ -90,7 +90,7 @@ static int snd_hrtimer_start(struct snd_timer *t)struct snd_hrtimer *stime = t->private_data;atomic_set (&stime->running,0 ); -hrtimer_cancel (&stime->hrt); +hrtimer_try_to_cancel (&stime->hrt);hrtimer_start (&stime->hrt,ns_to_ktime (t->sticks * resolution),HRTIMER_MODE_REL );atomic_set (&stime->running,1 );
@@ -101,6 +101,7 @@ static int snd_hrtimer_stop(struct snd_timer *t) {struct snd_hrtimer *stime = t->private_data;atomic_set (&stime->running,0 ); +hrtimer_try_to_cancel (&stime->hrt);return 0 ; }
sound/core/pcm_compat.c +9 -4
@@ -236,10 +236,15 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,if (! (runtime = substream->runtime))return -ENOTTY ; -/* only fifo_size is different, so just copy all */ - data =memdup_user (data32,sizeof (*data32)); -if (IS_ERR (data)) -return PTR_ERR (data); + data =kmalloc (sizeof (*data),GFP_KERNEL ); +if (!data) +return -ENOMEM ; + +/* only fifo_size (RO from userspace) is different, so just copy all */ +if (copy_from_user (data, data32,sizeof (*data32))) { + err = -EFAULT ; + goto error; + }if (refine) err =snd_pcm_hw_refine (substream, data);
sound/core/seq/seq_clientmgr.c +1 -1
@@ -1950,7 +1950,7 @@ static int snd_seq_ioctl_remove_events(struct snd_seq_client *client,* No restrictions so for a user client we can clear * the whole fifo */ -if (client->type ==USER_CLIENT ) +if (client->type ==USER_CLIENT && client->data.user.fifo)snd_seq_fifo_clear (client->data.user.fifo); }
sound/core/seq/seq_compat.c +5 -4
@@ -49,11 +49,12 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsignedstruct snd_seq_port_info *data;mm_segment_t fs; - data =memdup_user (data32,sizeof (*data32)); -if (IS_ERR (data)) -return PTR_ERR (data); + data =kmalloc (sizeof (*data),GFP_KERNEL ); +if (!data) +return -ENOMEM ; -if (get_user (data->flags, &data32->flags) || +if (copy_from_user (data, data32,sizeof (*data32)) || +get_user (data->flags, &data32->flags) ||get_user (data->time_queue, &data32->time_queue)) goto error; data->kernel =NULL ;
sound/core/seq/seq_queue.c +2 -0
@@ -144,8 +144,10 @@ static struct snd_seq_queue *queue_new(int owner, int locked)static void queue_delete (struct snd_seq_queue *q) {/* stop and release the timer */ +mutex_lock (&q->timer_mutex);snd_seq_timer_stop (q->timer);snd_seq_timer_close (q); +mutex_unlock (&q->timer_mutex);/* wait until access free */ snd_use_lock_sync (&q->use_lock);/* release resources... */
sound/core/timer.c +34 -18
148 lines not on this page · raw message
sound/pci/hda/hda_intel.c +39 -0
@@ -1124,6 +1124,36 @@ static unsigned int azx_get_response(struct hda_bus *bus,return azx_rirb_get_response (bus, addr); } +#ifdef CONFIG_PM_SLEEP +/* put codec down to D3 at hibernation for Intel SKL+; +* otherwise BIOS may still access the codec and screw up the driver +*/ +#define IS_SKL (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170) +#define IS_SKL_LP (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70) +#define IS_BXT (pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) +#define IS_SKL_PLUS (pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci)) + +static int azx_freeze_noirq (struct device *dev) +{ +struct pci_dev *pci =to_pci_dev (dev); + +if (IS_SKL_PLUS (pci)) +pci_set_power_state (pci, PCI_D3hot); + +return 0 ; +} + +static int azx_thaw_noirq (struct device *dev) +{ +struct pci_dev *pci =to_pci_dev (dev); + +if (IS_SKL_PLUS (pci)) +pci_set_power_state (pci,PCI_D0 ); + +return 0 ; +} +#endif /* CONFIG_PM_SLEEP */ +#ifdef CONFIG_PM static void azx_power_notify (struct hda_bus *bus,bool power_up);#endif
@@ -3072,6 +3102,10 @@ static int azx_runtime_idle(struct device *dev)#ifdef CONFIG_PM static const struct dev_pm_ops azx_pm = {SET_SYSTEM_SLEEP_PM_OPS (azx_suspend, azx_resume) +#ifdef CONFIG_PM_SLEEP + .freeze_noirq = azx_freeze_noirq, + .thaw_noirq = azx_thaw_noirq, +#endifSET_RUNTIME_PM_OPS (azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) };
@@ -3996,6 +4030,11 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, { PCI_DEVICE(0x8086, 0x8d21), .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, + /* Lewisburg */ + { PCI_DEVICE(0x8086, 0xa1f0), + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, + { PCI_DEVICE(0x8086, 0xa270), + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, /* Lynx Point-LP */ { PCI_DEVICE(0x8086, 0x9c20), .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
sound/pci/hda/patch_realtek.c +10 -2
@@ -1825,6 +1825,7 @@ enum {ALC889_FIXUP_MBA11_VREF ,ALC889_FIXUP_MBA21_VREF ,ALC889_FIXUP_MP11_VREF , +ALC889_FIXUP_MP41_VREF ,ALC882_FIXUP_INV_DMIC ,ALC882_FIXUP_NO_PRIMARY_HP , ALC887_FIXUP_ASUS_BASS,
@@ -1912,7 +1913,7 @@ static void alc889_fixup_mbp_vref(struct hda_codec *codec, const struct hda_fixup *fix, int action) {struct alc_spec *spec = codec->spec; -static hda_nid_t nids[2 ] = {0x14 ,0x15 }; +static hda_nid_t nids[3 ] = {0x14 ,0x15 ,0x19 };int i;if (action !=HDA_FIXUP_ACT_INIT )
@@ -2200,6 +2201,12 @@ static const struct hda_fixup alc882_fixups[] = { .chained = true, .chain_id = ALC885_FIXUP_MACPRO_GPIO, }, + [ALC889_FIXUP_MP41_VREF] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc889_fixup_mbp_vref, + .chained = true, + .chain_id = ALC885_FIXUP_MACPRO_GPIO, + }, [ALC882_FIXUP_INV_DMIC] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_inv_dmic_0x12,
@@ -2278,7 +2285,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {SND_PCI_QUIRK (0x106b ,0x3f00 ,"Macbook 5,1" ,ALC889_FIXUP_IMAC91_VREF ),SND_PCI_QUIRK (0x106b ,0x4000 ,"MacbookPro 5,1" ,ALC889_FIXUP_IMAC91_VREF ),SND_PCI_QUIRK (0x106b ,0x4100 ,"Macmini 3,1" ,ALC889_FIXUP_IMAC91_VREF ), -SND_PCI_QUIRK (0x106b ,0x4200 ,"Mac Pro 5,1" ,ALC885_FIXUP_MACPRO_GPIO ), +SND_PCI_QUIRK (0x106b ,0x4200 ,"Mac Pro 4,1/5,1" ,ALC889_FIXUP_MP41_VREF ),SND_PCI_QUIRK (0x106b ,0x4300 ,"iMac 9,1" ,ALC889_FIXUP_IMAC91_VREF ),SND_PCI_QUIRK (0x106b ,0x4600 ,"MacbookPro 5,2" ,ALC889_FIXUP_IMAC91_VREF ), SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
@@ -5337,6 +5344,7 @@ static const struct hda_fixup alc662_fixups[] = {static const struct snd_pci_quirk alc662_fixup_tbl[] = {SND_PCI_QUIRK (0x1019 ,0x9087 ,"ECS" ,ALC662_FIXUP_ASUS_MODE2 ),SND_PCI_QUIRK (0x1025 ,0x022f ,"Acer Aspire One" ,ALC662_FIXUP_INV_DMIC ), +SND_PCI_QUIRK (0x1025 ,0x0241 ,"Packard Bell DOTS" ,ALC662_FIXUP_INV_DMIC ),SND_PCI_QUIRK (0x1025 ,0x0308 ,"Acer Aspire 8942G" ,ALC662_FIXUP_ASPIRE ),SND_PCI_QUIRK (0x1025 ,0x031c ,"Gateway NV79" ,ALC662_FIXUP_SKU_IGNORE ),SND_PCI_QUIRK (0x1025 ,0x0349 ,"eMachines eM250" ,ALC662_FIXUP_INV_DMIC ),
sound/pci/hda/patch_sigmatel.c +1 -0
@@ -723,6 +723,7 @@ static bool hp_bnb2011_with_dock(struct hda_codec *codec)static bool hp_blike_system (u32 subsystem_id) {switch (subsystem_id) { +case 0x103c1473 :/* HP ProBook 6550b */ case 0x103c1520 :case 0x103c1521 :case 0x103c1523 :
sound/pci/rme96.c +26 -15
75 lines not on this page · raw message
sound/soc/codecs/arizona.c +1 -1
@@ -1171,7 +1171,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,int chan_limit = arizona->pdata.max_channels_clocked[dai->id -1 ];int bclk, lrclk, wl, frame, bclk_target; -if (params_rate (params) %8000 ) +if (params_rate (params) %4000 ) rates = &arizona_44k1_bclk_rates[0 ];else rates = &arizona_48k_bclk_rates[0 ];
sound/soc/codecs/wm8962.c +2 -2
@@ -364,8 +364,8 @@ static struct reg_default wm8962_reg[] = { { 16924, 0x0059 }, /* R16924 - HDBASS_PG_1 */ { 16925, 0x999A }, /* R16925 - HDBASS_PG_0 */ - { 17048, 0x0083 }, /* R17408 - HPF_C_1 */ - { 17049, 0x98AD }, /* R17409 - HPF_C_0 */ + { 17408, 0x0083 }, /* R17408 - HPF_C_1 */ + { 17409, 0x98AD }, /* R17409 - HPF_C_0 */ { 17920, 0x007F }, /* R17920 - ADCL_RETUNE_C1_1 */ { 17921, 0xFFFF }, /* R17921 - ADCL_RETUNE_C1_0 */
sound/soc/codecs/wm8974.c +1 -0
@@ -587,6 +587,7 @@ static const struct regmap_config wm8974_regmap = { .max_register = WM8974_MONOMIX, .reg_defaults = wm8974_reg_defaults, .num_reg_defaults = ARRAY_SIZE(wm8974_reg_defaults), + .cache_type = REGCACHE_FLAT, };static int wm8974_probe (struct snd_soc_codec *codec)
sound/soc/soc-compress.c +20 -3
@@ -665,17 +665,34 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)struct snd_pcm *be_pcm;char new_name[64 ];int ret =0 , direction =0 ; +int playback =0 , capture =0 ;/* check client and interface hw capabilities */ snprintf (new_name,sizeof (new_name),"%s %s-%d" , rtd->dai_link->stream_name, codec_dai->name, num);if (codec_dai->driver->playback.channels_min) + playback =1 ; +if (codec_dai->driver->capture.channels_min) + capture =1 ; + + capture = capture && cpu_dai->driver->capture.channels_min; + playback = playback && cpu_dai->driver->playback.channels_min; + +/* +* Compress devices are unidirectional so only one of the directions +* should be set, check for that (xor) +*/ +if (playback + capture !=1 ) { +dev_err (rtd->card->dev,"Invalid direction for compress P %d, C %d\n" , + playback, capture); +return -EINVAL ; + } + +if (playback) direction =SND_COMPRESS_PLAYBACK ; -else if (codec_dai->driver->capture.channels_min) - direction =SND_COMPRESS_CAPTURE ;else -return -EINVAL ; + direction =SND_COMPRESS_CAPTURE ; compr =kzalloc (sizeof (*compr),GFP_KERNEL );if (compr ==NULL ) {