Linux 3.16.81
I'm announcing the release of the 3.16.81 kernel.
All users of the 3.16 kernel series should upgrade.
The updated 3.16.y git tree can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.16.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git
The diff from 3.16.80 is attached to this message.
Ben.
------------
Makefile | 2 +- arch/arm/Kconfig | 6 +- arch/arm64/Kconfig | 5 +- arch/arm64/include/asm/page.h | 2 + arch/arm64/include/asm/shmparam.h | 2 +- arch/arm64/kernel/entry.S | 2 +- arch/arm64/kernel/kgdb.c | 15 +- arch/arm64/kernel/traps.c | 8 +- arch/arm64/mm/fault.c | 36 +++-- arch/tile/lib/atomic_asm_32.S | 3 +- arch/x86/include/asm/atomic.h | 36 +---- arch/x86/include/asm/atomic64_64.h | 8 +- arch/x86/include/asm/barrier.h | 4 +- crypto/cts.c | 8 +- drivers/dma/qcom_bam_dma.c | 14 ++ drivers/hid/hid-core.c | 3 + drivers/hid/hid-ids.h | 2 + drivers/hid/hid-sony.c | 6 + drivers/media/usb/cpia2/cpia2_v4l.c | 3 +- drivers/mmc/card/block.c | 7 +- drivers/mmc/core/core.c | 10 +- drivers/mmc/core/debugfs.c | 2 +- drivers/mmc/core/mmc.c | 13 +- drivers/mmc/core/mmc_ops.c | 2 +- drivers/net/can/usb/kvaser_usb.c | 6 +- drivers/net/ethernet/qlogic/qla3xxx.c | 9 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +- drivers/net/wireless/mwifiex/cfg80211.c | 17 ++- drivers/net/wireless/mwifiex/ioctl.h | 1 + drivers/net/wireless/mwifiex/sta_ioctl.c | 23 ++- drivers/scsi/libsas/sas_discover.c | 11 +- drivers/staging/android/ashmem.c | 4 +- drivers/staging/android/ion/ion_carveout_heap.c | 2 +- drivers/staging/android/uapi/ashmem.h | 1 + drivers/staging/goldfish/goldfish_audio.c | 1 + drivers/usb/dwc3/gadget.c | 6 + drivers/usb/gadget/composite.c | 2 + drivers/usb/gadget/configfs.c | 2 + drivers/usb/gadget/rndis.c | 6 + drivers/usb/gadget/u_serial.c | 12 +- drivers/usb/host/xhci-hub.c | 8 + drivers/usb/host/xhci-ring.c | 15 +- drivers/usb/host/xhci.h | 2 + drivers/usb/renesas_usbhs/mod_gadget.c | 5 +- drivers/video/fbdev/goldfishfb.c | 2 +- fs/ext4/inode.c | 15 ++ fs/ext4/super.c | 59 +++++--- fs/readdir.c | 40 +++++ include/asm-generic/fixmap.h | 12 +- include/linux/swap.h | 1 - include/net/inet_connection_sock.h | 5 - kernel/power/Makefile | 3 +- kernel/power/block_io.c | 103 ------------- kernel/power/power.h | 9 -- kernel/power/swap.c | 177 +++++++++++++++++----- kernel/sched/fair.c | 14 +- kernel/sched/sched.h | 2 - kernel/trace/trace_uprobe.c | 9 +- mm/page_io.c | 2 +- mm/rmap.c | 2 +- net/ceph/messenger.c | 12 +- net/dccp/ipv4.c | 8 +- net/dccp/ipv6.c | 2 +- net/ipv4/inet_diag.c | 18 ++- net/ipv4/tcp_ipv4.c | 7 +- net/ipv6/tcp_ipv6.c | 2 +- net/wireless/nl80211.c | 16 +- scripts/setlocalversion | 2 +- sound/core/compress_offload.c | 13 ++ 69 files changed, 532 insertions(+), 351 deletions(-)
Adrian Bunk (1):
mwifiex: Fix NL80211_TX_POWER_LIMITED
Amitkumar Karwar (1):
mwifiex: don't follow AP if country code received from EEPROM
Andreas Ziegler (1):
tracing/uprobes: Fix output for multiple string arguments
Ard Biesheuvel (1):
arm64/kernel: fix incorrect EL0 check in inv_entry macro
Arnd Bergmann (1):
ARM: 8458/1: bL_switcher: add GIC dependency
Baolin Wang (1):
usb: gadget: Add the gserial port checking in gs_start_tx()
Ben Hutchings (4):
net: qlogic: Fix error paths in ql_alloc_large_buffers()
ext4: Introduce ext4_clamp_want_extra_isize() Revert "sched/fair: Fix bandwidth timer clock drift condition" Linux 3.16.81
Bhadram Varka (1):
stmmac: copy unicast mac address to MAC registers
Chaotian Jing (1):
mmc: mmc: fix switch timeout issue caused by jiffies precision
Christoffer Dall (1):
video: fbdev: Set pixclock = 0 in goldfishfb
Christoph Hellwig (1):
suspend: simplify block I/O handling
Chuanxiao Dong (1):
mmc: debugfs: Add a restriction to mmc debugfs clock setting
Colin Cross (1):
mmc: block: Allow more than 8 partitions per card
Dmitry Vyukov (1):
locking/x86: Remove the unused atomic_inc_short() methd
Dong Aisheng (1):
mmc: core: fix using wrong io voltage if mmc_select_hs200 fails
Eric Biggers (2):
crypto: cts - fix crash on short inputs
arm64: support keyctl() system call in 32-bit mode
Eric Dumazet (2):
tcp/dccp: drop SYN packets if accept queue is full
net: diag: support v4mapped sockets in inet_diag_find_one_icsk()
Ezequiel Garcia (1):
arm64: kconfig: drop CONFIG_RTC_LIB dependency
Ganapathi Bhat (1):
mwifiex: fix possible heap overflow in mwifiex_process_country_ie()
Greg Hackmann (1):
staging: goldfish: audio: fix compiliation on arm
Ilya Dryomov (1):
libceph: handle an empty authorize reply
James Morse (3):
arm64: mm: Add trace_irqflags annotations to do_debug_exception()
arm64: kernel: Include _AC definition in page.h
PM / Hibernate: Call flush_icache_range() on pages restored in-place
Jason Yan (1):
scsi: libsas: stop discovering if oob mode is disconnected
Jeffrey Hugo (1):
dmaengine: qcom: bam_dma: Fix resource leak
Johannes Berg (1):
cfg80211: size various nl80211 messages correctly
Konstantin Khlebnikov (1):
mm/rmap: replace BUG_ON(anon_vma->degree) with VM_WARN_ON
Laura Abbott (1):
staging: ashmem: Avoid deadlock with mmap/shrink
Linus Torvalds (2):
Make filldir[64]() verify the directory entry filename is valid filldir[64]: remove WARN_ON_ONCE() for bad directory entries
Lorenzo Pieralisi (1):
ARM: 8510/1: rework ARM_CPU_SUSPEND dependencies
Mark Rutland (1):
asm-generic: Fix local variable shadow in __set_fixmap_offset
Mathias Nyman (2):
xhci: Fix port resume done detection for SS ports with LPM enabled
xhci: fix USB3 device initiated resume race with roothub autosuspend
Navid Emamdoost (1):
net: qlogic: Fix memory leak in ql_alloc_large_buffers
Peter Chen (1):
usb: gadget: composite: fix dereference after null check coverify warning
Peter Zijlstra (2):
x86/atomic: Fix smp_mb__{before,after}_atomic() locking,x86: Kill atomic_or_long()
Philip Oberstaller (1):
usb: gadget: serial: fix re-ordering of tx data
Qiao Zhou (1):
arm64: traps: disable irq in die()
Rajmal Menariya (1):
staging: ion: Set minimum carveout heap allocation order to PAGE_SHIFT
Ravindra Lokhande (1):
ALSA: compress: add support for 32bit calls in a 64bit kernel
Roderick Colenbrander (2):
HID: sony: Update device ids
HID: sony: Support DS4 dongle
Roger Quadros (1):
usb: dwc3: gadget: Fix suspend/resume during device mode
Rom Lemarchand (1):
staging: ashmem: Add missing include
Russell King (1):
mmc: core: shut up "voltage-ranges unspecified" pr_info()
Theodore Ts'o (1):
ext4: add more paranoia checking in ext4_expand_extra_isize handling
Will Deacon (2):
arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals
arm64: debug: Ensure debug handlers check triggering exception level
Winter Wang (1):
usb: gadget: configfs: add mutex lock before unregister gadget
Wolfram Sang (2):
mmc: sanitize 'bus width' in debug output
kbuild: setlocalversion: print error to STDERR
Xerox Lin (1):
usb: gadget: rndis: free response queue during REMOTE_NDIS_RESET_MSG
Xiaolong Huang (1):
can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices
Yoshihiro Shimoda (1):
usb: renesas_usbhs: gadget: fix unused-but-set-variable warning
YueHaibing (1):
media: cpia2: Fix use-after-free in cpia2_exit
Yury Norov (1):
arm64: fix COMPAT_SHMLBA definition for large pages
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 16 -SUBLEVEL = 80 +SUBLEVEL = 81 EXTRAVERSION = NAME = Museum of Fishiegoodies
arch/arm/Kconfig +3 -3
@@ -1485,8 +1485,7 @@ config BIG_LITTLE config BL_SWITCHER bool "big.LITTLE switcher support" - depends on BIG_LITTLE && MCPM && HOTPLUG_CPU - select ARM_CPU_SUSPEND + depends on BIG_LITTLE && MCPM && HOTPLUG_CPU && ARM_GIC select CPU_PM help The big.LITTLE "switcher" provides the core functionality to
@@ -2201,7 +2200,8 @@ config ARCH_SUSPEND_POSSIBLE def_bool y config ARM_CPU_SUSPEND - def_bool PM_SLEEP + def_bool PM_SLEEP || BL_SWITCHER + depends on ARCH_SUSPEND_POSSIBLE config ARCH_HIBERNATION_POSSIBLE bool
arch/arm64/Kconfig +4 -1
@@ -60,7 +60,6 @@ config ARM64 select PERF_USE_VMALLOC select POWER_RESET select POWER_SUPPLY - select RTC_LIB select SPARSE_IRQ select SYSCTL_EXCEPTION_TRACE help
@@ -353,6 +352,10 @@ config SYSVIPC_COMPAT def_bool y depends on COMPAT && SYSVIPC +config KEYS_COMPAT + def_bool y + depends on COMPAT && KEYS + endmenu menu "Power management options"
arch/arm64/include/asm/page.h +2 -0
@@ -19,6 +19,8 @@#ifndef __ASM_PAGE_H#define __ASM_PAGE_H +#include <linux/const.h> +/* PAGE_SHIFT determines the page size */ #ifdef CONFIG_ARM64_64K_PAGES #define PAGE_SHIFT 16
arch/arm64/include/asm/shmparam.h +1 -1
@@ -21,7 +21,7 @@* alignment value. Since we don't have aliasing D-caches, the rest of * the time we can safely use PAGE_SIZE. */ -#define COMPAT_SHMLBA 0x4000 +#define COMPAT_SHMLBA (4 * PAGE_SIZE)#include <asm-generic/shmparam.h>
arch/arm64/kernel/entry.S +1 -1
@@ -187,7 +187,7 @@ END(vectors) * Invalid mode handlers */ .macro inv_entry, el, reason, regsize = 64 - kernel_entry el, \regsize + kernel_entry \el, \regsize mov x0, sp mov x1, #\reason mrs x2, esr_el1
arch/arm64/kernel/kgdb.c +12 -3
@@ -215,22 +215,31 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,static int kgdb_brk_fn (struct pt_regs *regs,unsigned int esr) { +if (user_mode (regs)) +return DBG_HOOK_ERROR ; +kgdb_handle_exception (1 ,SIGTRAP ,0 , regs); -return 0 ; +return DBG_HOOK_HANDLED ; }static int kgdb_compiled_brk_fn (struct pt_regs *regs,unsigned int esr) { +if (user_mode (regs)) +return DBG_HOOK_ERROR ; + compiled_break =1 ;kgdb_handle_exception (1 ,SIGTRAP ,0 , regs); -return 0 ; +return DBG_HOOK_HANDLED ; }static int kgdb_step_brk_fn (struct pt_regs *regs,unsigned int esr) { +if (user_mode (regs)) +return DBG_HOOK_ERROR ; +kgdb_handle_exception (1 ,SIGTRAP ,0 , regs); -return 0 ; +return DBG_HOOK_HANDLED ; }static struct break_hook kgdb_brkpt_hook = {
arch/arm64/kernel/traps.c +6 -2
@@ -178,10 +178,12 @@ void die(const char *str, struct pt_regs *regs, int err) {struct thread_info *thread =current_thread_info ();int ret; +unsigned long flags; + +raw_spin_lock_irqsave (&die_lock, flags);oops_enter (); -raw_spin_lock_irq (&die_lock);console_verbose ();bust_spinlocks (1 ); ret =__die (str, err, thread, regs);
@@ -191,13 +193,15 @@ void die(const char *str, struct pt_regs *regs, int err)bust_spinlocks (0 );add_taint (TAINT_DIE ,LOCKDEP_NOW_UNRELIABLE ); -raw_spin_unlock_irq (&die_lock);oops_exit ();if (in_interrupt ())panic ("Fatal exception in interrupt" );if (panic_on_oops)panic ("Fatal exception" ); + +raw_spin_unlock_irqrestore (&die_lock, flags); +if (ret !=NOTIFY_STOP )do_exit (SIGSEGV ); }
arch/arm64/mm/fault.c +25 -11
@@ -512,24 +512,38 @@ void __init hook_debug_fault_code(int nr, debug_fault_info[nr].name = name; } -asmlinkage int __exception do_debug_exception(unsigned long addr, +asmlinkage int __exception do_debug_exception(unsigned long addr_if_watchpoint,unsigned int esr,struct pt_regs *regs) {const struct fault_info *inf = debug_fault_info +DBG_ESR_EVT (esr); +unsigned long pc =instruction_pointer (regs);struct siginfo info; +int rv; -if (!inf->fn (addr, esr, regs)) -return 1 ; +/* +* Tell lockdep we disabled irqs in entry.S. Do nothing if they were +* already disabled to preserve the last enabled/disabled addresses. +*/ +if (interrupts_enabled (regs)) +trace_hardirqs_off (); -pr_alert ("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n" , - inf->name, esr, addr); +if (!inf->fn (addr_if_watchpoint, esr, regs)) { + rv =1 ; + }else { +pr_alert ("Unhandled debug exception: %s (0x%08x) at 0x%016lx\n" , + inf->name, esr, pc); + + info.si_signo = inf->sig; + info.si_errno =0 ; + info.si_code = inf->code; + info.si_addr = (void __user *)pc; +arm64_notify_die ("" , regs, &info,0 ); + rv =0 ; + } - info.si_signo = inf->sig; - info.si_errno =0 ; - info.si_code = inf->code; - info.si_addr = (void __user *)addr; -arm64_notify_die ("" , regs, &info,0 ); +if (interrupts_enabled (regs)) +trace_hardirqs_on (); -return 0 ; +return rv; }
arch/tile/lib/atomic_asm_32.S +1 -2
@@ -24,8 +24,7 @@ * has an opportunity to return -EFAULT to the user if needed. * The 64-bit routines just return a "long long" with the value, * since they are only used from kernel space and don't expect to fault. - * Support for 16-bit ops is included in the framework but we don't provide - * any (x86_64 has an atomic_inc_short(), so we might want to some day). + * Support for 16-bit ops is included in the framework but we don't provide any. * * Note that the caller is advised to issue a suitable L1 or L2 * prefetch on the address being manipulated to avoid extra stalls.
arch/x86/include/asm/atomic.h +4 -32
@@ -49,7 +49,7 @@ static inline void atomic_add(int i, atomic_t *v) { asmvolatile (LOCK_PREFIX "addl %1,%0" :"+m" (v->counter) - :"ir" (i)); + :"ir" (i) :"memory" ); }/**
@@ -63,7 +63,7 @@ static inline void atomic_sub(int i, atomic_t *v) { asmvolatile (LOCK_PREFIX "subl %1,%0" :"+m" (v->counter) - :"ir" (i)); + :"ir" (i) :"memory" ); }/**
@@ -89,7 +89,7 @@ static inline int atomic_sub_and_test(int i, atomic_t *v)static inline void atomic_inc (atomic_t *v) { asmvolatile (LOCK_PREFIX "incl %0" - :"+m" (v->counter)); + :"+m" (v->counter) ::"memory" ); }/**
@@ -101,7 +101,7 @@ static inline void atomic_inc(atomic_t *v)static inline void atomic_dec (atomic_t *v) { asmvolatile (LOCK_PREFIX "decl %0" - :"+m" (v->counter)); + :"+m" (v->counter) ::"memory" ); }/**
@@ -205,34 +205,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)return c; } -/** -* atomic_inc_short - increment of a short integer -* @v: pointer to type int -* -* Atomically adds 1 to @v -* Returns the new value of @u -*/ -static inline short int atomic_inc_short (short int *v) -{ - asm(LOCK_PREFIX "addw $1, %0" :"+m" (*v)); -return *v; -} - -#ifdef CONFIG_X86_64 -/** -* atomic_or_long - OR of two long integers -* @v1: pointer to type unsigned long -* @v2: pointer to type unsigned long -* -* Atomically ORs @v1 and @v2 -* Returns the result of the OR -*/ -static inline void atomic_or_long (unsigned long *v1,unsigned long v2) -{ - asm(LOCK_PREFIX "orq %1, %0" :"+m" (*v1) :"r" (v2)); -} -#endif -/* These are x86-specific, used by some header files */ #define atomic_clear_mask (mask, addr) \ asm volatile(LOCK_PREFIX "andl %0,%1" \
arch/x86/include/asm/atomic64_64.h +4 -4
@@ -44,7 +44,7 @@ static inline void atomic64_add(long i, atomic64_t *v) { asmvolatile (LOCK_PREFIX "addq %1,%0" :"=m" (v->counter) - :"er" (i),"m" (v->counter)); + :"er" (i),"m" (v->counter) :"memory" ); }/**
@@ -58,7 +58,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) { asmvolatile (LOCK_PREFIX "subq %1,%0" :"=m" (v->counter) - :"er" (i),"m" (v->counter)); + :"er" (i),"m" (v->counter) :"memory" ); }/**
@@ -85,7 +85,7 @@ static inline void atomic64_inc(atomic64_t *v) { asmvolatile (LOCK_PREFIX "incq %0" :"=m" (v->counter) - :"m" (v->counter)); + :"m" (v->counter) :"memory" ); }/**
@@ -98,7 +98,7 @@ static inline void atomic64_dec(atomic64_t *v) { asmvolatile (LOCK_PREFIX "decq %0" :"=m" (v->counter) - :"m" (v->counter)); + :"m" (v->counter) :"memory" ); }/**
arch/x86/include/asm/barrier.h +2 -2
@@ -167,8 +167,8 @@ do { \#endif /* Atomic operations are already serializing on x86 */ -#define smp_mb__before_atomic () barrier() -#define smp_mb__after_atomic () barrier() +#define smp_mb__before_atomic () do { } while (0) +#define smp_mb__after_atomic () do { } while (0)/* * Stop RDTSC speculation. This is needed when you need to use RDTSC
crypto/cts.c +4 -4
@@ -137,8 +137,8 @@ static int crypto_cts_encrypt(struct blkcipher_desc *desc, lcldesc.info = desc->info; lcldesc.flags = desc->flags; -if (tot_blocks ==1 ) { - err =crypto_blkcipher_encrypt_iv (&lcldesc, dst, src, bsize); +if (tot_blocks <=1 ) { + err =crypto_blkcipher_encrypt_iv (&lcldesc, dst, src, nbytes); }else if (nbytes <= bsize *2 ) { err =cts_cbc_encrypt (ctx, desc, dst, src,0 , nbytes); }else {
@@ -232,8 +232,8 @@ static int crypto_cts_decrypt(struct blkcipher_desc *desc, lcldesc.info = desc->info; lcldesc.flags = desc->flags; -if (tot_blocks ==1 ) { - err =crypto_blkcipher_decrypt_iv (&lcldesc, dst, src, bsize); +if (tot_blocks <=1 ) { + err =crypto_blkcipher_decrypt_iv (&lcldesc, dst, src, nbytes); }else if (nbytes <= bsize *2 ) { err =cts_cbc_decrypt (ctx, desc, dst, src,0 , nbytes); }else {
drivers/dma/qcom_bam_dma.c +14 -0
@@ -539,7 +539,21 @@ static void bam_dma_terminate_all(struct bam_chan *bchan)/* remove all transactions, including active transaction */ spin_lock_irqsave (&bchan->vc.lock, flag); +/* +* If we have transactions queued, then some might be committed to the +* hardware in the desc fifo. The only way to reset the desc fifo is +* to do a hardware reset (either by pipe or the entire block). +* bam_chan_init_hw() will trigger a pipe reset, and also reinit the +* pipe. If the pipe is left disabled (default state after pipe reset) +* and is accessed by a connected hardware engine, a fatal error in +* the BAM will occur. There is a small window where this could happen +* with bam_chan_init_hw(), but it is assumed that the caller has +* stopped activity on any attached hardware engine. Make sure to do +* this first so that the BAM hardware doesn't cause memory corruption +* by accessing freed resources. +*/ if (bchan->curr_txd) { +bam_chan_init_hw (bchan, bchan->curr_txd->dir);list_add (&bchan->curr_txd->vd.node, &bchan->vc.desc_issued); bchan->curr_txd =NULL ; }
drivers/hid/hid-core.c +3 -0
@@ -1932,6 +1932,9 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
drivers/hid/hid-ids.h +2 -0
@@ -876,6 +876,8 @@#define USB_DEVICE_ID_SONY_PS3_BDREMOTE 0x0306#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268#define USB_DEVICE_ID_SONY_PS4_CONTROLLER 0x05c4 +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_2 0x09cc +#define USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE 0x0ba0#define USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER 0x042f#define USB_DEVICE_ID_SONY_BUZZ_CONTROLLER 0x0002#define USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER 0x1000
drivers/hid/hid-sony.c +6 -0
@@ -1998,6 +1998,12 @@ static const struct hid_device_id sony_devices[] = { .driver_data = DUALSHOCK4_CONTROLLER_USB }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER), .driver_data = DUALSHOCK4_CONTROLLER_BT }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2), + .driver_data = DUALSHOCK4_CONTROLLER_USB }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_2), + .driver_data = DUALSHOCK4_CONTROLLER_BT }, + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE), + .driver_data = DUALSHOCK4_CONTROLLER_USB }, { } };MODULE_DEVICE_TABLE (hid, sony_devices);
drivers/media/usb/cpia2/cpia2_v4l.c +1 -2
@@ -1249,8 +1249,7 @@ static int __init cpia2_init(void)LOG ("%s v%s\n" ,ABOUT ,CPIA_VERSION );check_parameters (); -cpia2_usb_init (); -return 0 ; +return cpia2_usb_init (); }
drivers/mmc/card/block.c +2 -5
@@ -168,11 +168,7 @@ static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)static inline int mmc_get_devidx (struct gendisk *disk) { -int devmaj =MAJOR (disk_devt (disk)); -int devidx =MINOR (disk_devt (disk)) / perdev_minors; - -if (!devmaj) - devidx = disk->first_minor / perdev_minors; +int devidx = disk->first_minor / perdev_minors;return devidx; }
@@ -2169,6 +2165,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, md->disk->queue = md->queue.queue; md->disk->driverfs_dev = parent;set_disk_ro (md->disk, md->read_only || default_ro); + md->disk->flags =GENHD_FL_EXT_DEVT ;if (area_type &MMC_BLK_DATA_AREA_RPMB ) md->disk->flags |=GENHD_FL_NO_PART_SCAN ;
drivers/mmc/core/core.c +7 -3
@@ -973,7 +973,7 @@ static inline void mmc_set_ios(struct mmc_host *host)"width %u timing %u\n" ,mmc_hostname (host), ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select, ios->vdd, - ios->bus_width, ios->timing); + 1 << ios->bus_width, ios->timing);if (ios->clock >0 )mmc_set_ungated (host);
@@ -1181,8 +1181,12 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask) voltage_ranges =of_get_property (np,"voltage-ranges" , &num_ranges); num_ranges = num_ranges /sizeof (*voltage_ranges) /2 ; -if (!voltage_ranges || !num_ranges) { -pr_info ("%s: voltage-ranges unspecified\n" , np->full_name); +if (!voltage_ranges) { +pr_debug ("%s: voltage-ranges unspecified\n" , np->full_name); +return -EINVAL ; + } +if (!num_ranges) { +pr_err ("%s: voltage-ranges empty\n" , np->full_name);return -EINVAL ; }
drivers/mmc/core/debugfs.c +1 -1
@@ -195,7 +195,7 @@ static int mmc_clock_opt_set(void *data, u64 val)struct mmc_host *host = data;/* We need this check due to input value is u64 */ -if (val > host->f_max) +if (val !=0 && (val > host->f_max || val < host->f_min))return -EINVAL ;mmc_claim_host (host);
drivers/mmc/core/mmc.c +10 -3
@@ -935,7 +935,7 @@ static int mmc_select_bus_width(struct mmc_card *card)break ; }else {pr_warn ("%s: switch to bus width %d failed\n" , -mmc_hostname (host), ext_csd_bits[idx]); +mmc_hostname (host),1 << bus_width); } }
@@ -1079,8 +1079,10 @@ static int mmc_select_hs400(struct mmc_card *card)static int mmc_select_hs200 (struct mmc_card *card) {struct mmc_host *host = card->host; +unsigned int old_signal_voltage;int err = -EINVAL ; + old_signal_voltage = host->ios.signal_voltage;if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_HS200_1_2V ) err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_120 );
@@ -1089,7 +1091,7 @@ static int mmc_select_hs200(struct mmc_card *card)/* If fails try again during next card power cycle */ if (err) - goto err; +return err;/* * Set the bus width(4 or 8) with host's support and
@@ -1104,7 +1106,12 @@ static int mmc_select_hs200(struct mmc_card *card)if (!err)mmc_set_timing (host,MMC_TIMING_MMC_HS200 ); } -err: + +if (err) { +/* fall back to the old signal voltage, if fails report error */ +if (__mmc_set_signal_voltage (host, old_signal_voltage)) + err = -EIO ; + }return err; }
drivers/mmc/core/mmc_ops.c +1 -1
@@ -470,7 +470,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, timeout_ms =MMC_OPS_TIMEOUT_MS ;/* Must check status to be sure of no errors. */ - timeout = jiffies +msecs_to_jiffies (timeout_ms); + timeout = jiffies +msecs_to_jiffies (timeout_ms) +1 ; do { if (send_status) { err = __mmc_send_status(card, &status, ignore_crc);
drivers/net/can/usb/kvaser_usb.c +3 -3
@@ -586,7 +586,7 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,return -ENOMEM ; } - buf =kmalloc (sizeof (struct kvaser_msg ),GFP_ATOMIC ); + buf =kzalloc (sizeof (struct kvaser_msg ),GFP_ATOMIC );if (!buf) {usb_free_urb (urb);return -ENOMEM ;
@@ -1109,7 +1109,7 @@ static int kvaser_usb_set_opt_mode(const struct kvaser_usb_net_priv *priv)struct kvaser_msg *msg;int rc; - msg =kmalloc (sizeof (*msg),GFP_KERNEL ); + msg =kzalloc (sizeof (*msg),GFP_KERNEL );if (!msg)return -ENOMEM ;
@@ -1240,7 +1240,7 @@ static int kvaser_usb_flush_queue(struct kvaser_usb_net_priv *priv)struct kvaser_msg *msg;int rc; - msg =kmalloc (sizeof (*msg),GFP_KERNEL ); + msg =kzalloc (sizeof (*msg),GFP_KERNEL );if (!msg)return -ENOMEM ;
drivers/net/ethernet/qlogic/qla3xxx.c +5 -4
@@ -2758,6 +2758,9 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)int err;for (i =0 ; i < qdev->num_large_buffers; i++) { + lrg_buf_cb = &qdev->lrg_buf[i]; +memset (lrg_buf_cb,0 ,sizeof (struct ql_rcv_buf_cb )); + skb =netdev_alloc_skb (qdev->ndev, qdev->lrg_buffer_len);if (unlikely (!skb)) {
@@ -2768,11 +2771,7 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)ql_free_large_buffers (qdev);return -ENOMEM ; }else { - - lrg_buf_cb = &qdev->lrg_buf[i]; -memset (lrg_buf_cb,0 ,sizeof (struct ql_rcv_buf_cb )); lrg_buf_cb->index = i; - lrg_buf_cb->skb = skb;/* * We save some space to copy the ethhdr from first * buffer
@@ -2789,10 +2788,12 @@ static int ql_alloc_large_buffers(struct ql3_adapter *qdev)netdev_err (qdev->ndev,"PCI mapping failed with error: %d\n" , err); +dev_kfree_skb_irq (skb);ql_free_large_buffers (qdev);return -ENOMEM ; } + lrg_buf_cb->skb = skb;dma_unmap_addr_set (lrg_buf_cb, mapaddr, map); dma_unmap_len_set(lrg_buf_cb, maplen, qdev->lrg_buffer_len -
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +15 -1
@@ -2388,6 +2388,20 @@ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)return ret; } +static int stmmac_set_mac_address (struct net_device *ndev,void *addr) +{ +struct stmmac_priv *priv =netdev_priv (ndev); +int ret =0 ; + + ret =eth_mac_addr (ndev, addr); +if (ret) +return ret; + + priv->hw->mac->set_umac_addr (priv->ioaddr, ndev->dev_addr,0 ); + +return ret; +} +#ifdef CONFIG_STMMAC_DEBUG_FS static struct dentry *stmmac_fs_dir;static struct dentry *stmmac_rings_status;
@@ -2587,7 +2601,7 @@ static const struct net_device_ops stmmac_netdev_ops = {#ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = stmmac_poll_controller, #endif - .ndo_set_mac_address = eth_mac_addr, + .ndo_set_mac_address = stmmac_set_mac_address, };/**
drivers/net/wireless/mwifiex/cfg80211.c +15 -2
@@ -343,11 +343,20 @@ mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy,struct mwifiex_power_cfg power_cfg;int dbm =MBM_TO_DBM (mbm); -if (type ==NL80211_TX_POWER_FIXED ) { +switch (type) { +case NL80211_TX_POWER_FIXED : power_cfg.is_power_auto =0 ; + power_cfg.is_power_fixed =1 ; power_cfg.power_level = dbm; - }else { +break ; +case NL80211_TX_POWER_LIMITED : + power_cfg.is_power_auto =0 ; + power_cfg.is_power_fixed =0 ; + power_cfg.power_level = dbm; +break ; +case NL80211_TX_POWER_AUTOMATIC : power_cfg.is_power_auto =1 ; +break ; } priv =mwifiex_get_priv (adapter,MWIFIEX_BSS_ROLE_ANY );
@@ -2908,6 +2917,10 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) wiphy->cipher_suites = mwifiex_cipher_suites; wiphy->n_cipher_suites =ARRAY_SIZE (mwifiex_cipher_suites); +if (adapter->region_code) + wiphy->regulatory_flags |=REGULATORY_DISABLE_BEACON_HINTS | +REGULATORY_COUNTRY_IE_IGNORE ; +memcpy (wiphy->perm_addr, priv->curr_addr,ETH_ALEN ); wiphy->signal_type =CFG80211_SIGNAL_TYPE_MBM ; wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
drivers/net/wireless/mwifiex/ioctl.h +1 -0
@@ -245,6 +245,7 @@ struct mwifiex_ds_encrypt_key {struct mwifiex_power_cfg {u32 is_power_auto; +u32 is_power_fixed;u32 power_level; };
drivers/net/wireless/mwifiex/sta_ioctl.c +18 -5
@@ -223,6 +223,14 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv, "11D: skip setting domain info in FW\n");return 0 ; } + +if (country_ie_len > + (IEEE80211_COUNTRY_STRING_LEN +MWIFIEX_MAX_TRIPLET_802_11D )) { +wiphy_dbg (priv->wdev->wiphy, +"11D: country_ie_len overflow!, deauth AP\n" ); +return -EINVAL ; + } +memcpy (priv->adapter->country_code, &country_ie[2 ],2 ); domain_info->country_code[0 ] = country_ie[2 ];
@@ -266,7 +274,9 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, priv->scan_block = false;if (bss) { -mwifiex_process_country_ie (priv, bss); +if (adapter->region_code ==0x00 && +mwifiex_process_country_ie (priv, bss)) +return -EINVAL ;/* Allocate and fill new bss descriptor */ bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor),
@@ -659,6 +669,9 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf; txp_cfg->action =cpu_to_le16 (HostCmd_ACT_GEN_SET);if (!power_cfg->is_power_auto) { +u16 dbm_min = power_cfg->is_power_fixed ? + dbm : priv->min_tx_power_level; + txp_cfg->mode =cpu_to_le32 (1 ); pg_tlv = (struct mwifiex_types_power_group *) (buf +sizeof (struct host_cmd_ds_txpwr_cfg ));
@@ -673,7 +686,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, pg->last_rate_code =0x03 ; pg->modulation_class =MOD_CLASS_HR_DSSS ; pg->power_step =0 ; - pg->power_min = (s8 ) dbm; + pg->power_min = (s8 ) dbm_min; pg->power_max = (s8 ) dbm; pg++;/* Power group for modulation class OFDM */
@@ -681,7 +694,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, pg->last_rate_code =0x07 ; pg->modulation_class =MOD_CLASS_OFDM ; pg->power_step =0 ; - pg->power_min = (s8 ) dbm; + pg->power_min = (s8 ) dbm_min; pg->power_max = (s8 ) dbm; pg++;/* Power group for modulation class HTBW20 */
@@ -689,7 +702,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, pg->last_rate_code =0x20 ; pg->modulation_class =MOD_CLASS_HT ; pg->power_step =0 ; - pg->power_min = (s8 ) dbm; + pg->power_min = (s8 ) dbm_min; pg->power_max = (s8 ) dbm; pg->ht_bandwidth =HT_BW_20 ; pg++;
@@ -698,7 +711,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, pg->last_rate_code =0x20 ; pg->modulation_class =MOD_CLASS_HT ; pg->power_step =0 ; - pg->power_min = (s8 ) dbm; + pg->power_min = (s8 ) dbm_min; pg->power_max = (s8 ) dbm; pg->ht_bandwidth =HT_BW_40 ; }
drivers/scsi/libsas/sas_discover.c +10 -1
@@ -97,12 +97,21 @@ static int sas_get_port_device(struct asd_sas_port *port)else dev->dev_type =SAS_SATA_DEV ; dev->tproto =SAS_PROTOCOL_SATA ; - }else { + }else if (port->oob_mode ==SAS_OOB_MODE ) {struct sas_identify_frame *id = (struct sas_identify_frame *) dev->frame_rcvd; dev->dev_type = id->dev_type; dev->iproto = id->initiator_bits; dev->tproto = id->target_bits; + }else { +/* If the oob mode is OOB_NOT_CONNECTED, the port is +* disconnected due to race with PHY down. We cannot +* continue to discover this port +*/ +sas_put_device (dev); +pr_warn ("Port %016llx is disconnected when discovering\n" , +SAS_ADDR (port->attached_sas_addr)); +return -ENODEV ; }sas_init_dev (dev);
drivers/staging/android/ashmem.c +3 -1
@@ -434,7 +434,9 @@ ashmem_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)if (!(sc->gfp_mask & __GFP_FS))return SHRINK_STOP ; -mutex_lock (&ashmem_mutex); +if (!mutex_trylock (&ashmem_mutex)) +return -1 ; +list_for_each_entry_safe (range, next, &ashmem_lru_list, lru) {loff_t start = range->pgstart *PAGE_SIZE ;loff_t end = (range->pgend +1 ) *PAGE_SIZE ;
drivers/staging/android/ion/ion_carveout_heap.c +1 -1
@@ -168,7 +168,7 @@ struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data)if (!carveout_heap)return ERR_PTR (-ENOMEM ); - carveout_heap->pool =gen_pool_create (12 ,-1 ); + carveout_heap->pool =gen_pool_create (PAGE_SHIFT ,-1 );if (!carveout_heap->pool) {kfree (carveout_heap);return ERR_PTR (-ENOMEM );
drivers/staging/android/uapi/ashmem.h +1 -0
@@ -13,6 +13,7 @@#define _UAPI_LINUX_ASHMEM_H#include <linux/ioctl.h> +#include <linux/types.h> #define ASHMEM_NAME_LEN 256
drivers/staging/goldfish/goldfish_audio.c +1 -0
@@ -26,6 +26,7 @@#include <linux/sched.h> #include <linux/dma-mapping.h> #include <linux/uaccess.h> +#include <linux/slab.h> #include <linux/goldfish.h> MODULE_AUTHOR ("Google, Inc." );
drivers/usb/dwc3/gadget.c +6 -0
@@ -2955,6 +2955,9 @@ void dwc3_gadget_complete(struct dwc3 *dwc)int dwc3_gadget_suspend (struct dwc3 *dwc) { +if (!dwc->gadget_driver) +return 0 ; +__dwc3_gadget_ep_disable (dwc->eps[0 ]);__dwc3_gadget_ep_disable (dwc->eps[1 ]);
@@ -2968,6 +2971,9 @@ int dwc3_gadget_resume(struct dwc3 *dwc)struct dwc3_ep *dep;int ret; +if (!dwc->gadget_driver) +return 0 ; +/* Start with SuperSpeed Default */ dwc3_gadget_ep0_desc.wMaxPacketSize =cpu_to_le16 (512 );
drivers/usb/gadget/composite.c +2 -0
@@ -1729,6 +1729,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)break ;case USB_RECIP_ENDPOINT : +if (!cdev->config) +break ; endp = ((w_index &0x80 ) >>3 ) | (w_index &0x0f );list_for_each_entry (f, &cdev->config->functions, list) {if (test_bit (endp, f->endpoints))
drivers/usb/gadget/configfs.c +2 -0
@@ -1551,7 +1551,9 @@ void unregister_gadget_item(struct config_item *item) {struct gadget_info *gi =to_gadget_info (item); +mutex_lock (&gi->lock);unregister_gadget (gi); +mutex_unlock (&gi->lock); }EXPORT_SYMBOL_GPL (unregister_gadget_item);
drivers/usb/gadget/rndis.c +6 -0
@@ -686,6 +686,12 @@ static int rndis_reset_response(int configNr, rndis_reset_msg_type *buf)rndis_reset_cmplt_type *resp;rndis_resp_t *r;struct rndis_params *params = rndis_per_dev_params + configNr; +u8 *xbuf; +u32 length; + +/* drain the response queue */ +while ((xbuf =rndis_get_next_response (configNr, &length))) +rndis_free_response (configNr, xbuf); r =rndis_add_response (configNr,sizeof (rndis_reset_cmplt_type));if (!r)
drivers/usb/gadget/u_serial.c +10 -2
@@ -116,6 +116,7 @@ struct gs_port {int write_allocated;struct gs_buf port_write_buf;wait_queue_head_t drain_wait;/* wait while writes drain */ +bool write_busy;/* REVISIT this state ... */ struct usb_cdc_line_coding port_line_coding;/* 8-N-1 etc */
@@ -362,11 +363,16 @@ __acquires(&port->port_lock)*/ {struct list_head *pool = &port->write_pool; -struct usb_ep *in = port->port_usb->in; +struct usb_ep *in;int status =0 ;bool do_tty_wake = false; -while (!list_empty (pool)) { +if (!port->port_usb) +return status; + + in = port->port_usb->in; + +while (!port->write_busy && !list_empty (pool)) {struct usb_request *req;int len;
@@ -396,9 +402,11 @@ __acquires(&port->port_lock)* NOTE that we may keep sending data for a while after * the TTY closed (dev->ioport->port_tty is NULL). */ + port->write_busy = true;spin_unlock (&port->port_lock); status =usb_ep_queue (in, req,GFP_ATOMIC );spin_lock (&port->port_lock); + port->write_busy = false;if (status) { pr_debug("%s: %s %s err %d\n",
drivers/usb/host/xhci-hub.c +8 -0
@@ -612,6 +612,14 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, status |=USB_PORT_STAT_C_BH_RESET <<16 ;if ((raw_port_status &PORT_CEC )) status |=USB_PORT_STAT_C_CONFIG_ERROR <<16 ; + +/* USB3 remote wake resume signaling completed */ +if (bus_state->port_remote_wakeup & (1 << wIndex) && + (raw_port_status &PORT_PLS_MASK ) !=XDEV_RESUME && + (raw_port_status &PORT_PLS_MASK ) !=XDEV_RECOVERY ) { + bus_state->port_remote_wakeup &= ~(1 << wIndex); +usb_hcd_end_port_resume (&hcd->self, wIndex); + } }if (hcd->speed !=HCD_USB3 ) {
drivers/usb/host/xhci-ring.c +7 -8
@@ -1605,9 +1605,6 @@ static void handle_port_status(struct xhci_hcd *xhci,usb_hcd_resume_root_hub (hcd); } -if (hcd->speed ==HCD_USB3 && (temp &PORT_PLS_MASK ) ==XDEV_INACTIVE ) - bus_state->port_remote_wakeup &= ~(1 << faked_port_index); -if ((temp &PORT_PLC ) && (temp &PORT_PLS_MASK ) ==XDEV_RESUME ) {xhci_dbg (xhci,"port resume event for port %d\n" , port_id);
@@ -1626,6 +1623,7 @@ static void handle_port_status(struct xhci_hcd *xhci, bus_state->port_remote_wakeup |=1 << faked_port_index;xhci_test_and_clear_bit (xhci, port_array, faked_port_index,PORT_PLC ); +usb_hcd_start_port_resume (&hcd->self, faked_port_index);xhci_set_link_state (xhci, port_array, faked_port_index,XDEV_U0 );/* Need to wait until the next link state change
@@ -1645,10 +1643,13 @@ static void handle_port_status(struct xhci_hcd *xhci, } } -if ((temp &PORT_PLC ) && (temp &PORT_PLS_MASK ) ==XDEV_U0 && -DEV_SUPERSPEED (temp)) { +if ((temp &PORT_PLC ) && +DEV_SUPERSPEED (temp) && + ((temp &PORT_PLS_MASK ) ==XDEV_U0 || + (temp &PORT_PLS_MASK ) ==XDEV_U1 || + (temp &PORT_PLS_MASK ) ==XDEV_U2 )) {xhci_dbg (xhci,"resume SS port %d finished\n" , port_id); -/* We've just brought the device into U0 through either the +/* We've just brought the device into U0/1/2 through either the * Resume state after a device remote wakeup, or through the * U3Exit state after a host-initiated resume. If it's a device * initiated remote wake, don't pass up the link state change,
@@ -1660,8 +1661,6 @@ static void handle_port_status(struct xhci_hcd *xhci,if (slot_id && xhci->devs[slot_id])xhci_ring_device (xhci, slot_id);if (bus_state->port_remote_wakeup & (1 << faked_port_index)) { - bus_state->port_remote_wakeup &= - ~(1 << faked_port_index);xhci_test_and_clear_bit (xhci, port_array, faked_port_index,PORT_PLC ); usb_wakeup_notification(hcd->self.root_hub,
drivers/usb/host/xhci.h +2 -0
@@ -283,10 +283,12 @@ struct xhci_op_regs {*/ #define PORT_PLS_MASK (0xf << 5)#define XDEV_U0 (0x0 << 5) +#define XDEV_U1 (0x1 << 5)#define XDEV_U2 (0x2 << 5)#define XDEV_U3 (0x3 << 5)#define XDEV_INACTIVE (0x6 << 5)#define XDEV_POLLING (0x7 << 5) +#define XDEV_RECOVERY (0x8 << 5)#define XDEV_COMP_MODE (0xa << 5)#define XDEV_RESUME (0xf << 5)/* true: port has power (see HCC_PPC) */
drivers/usb/renesas_usbhs/mod_gadget.c +1 -4
@@ -611,14 +611,11 @@ static int usbhsg_ep_disable(struct usb_ep *ep)struct usbhsg_uep *uep =usbhsg_ep_to_uep (ep);struct usbhs_pipe *pipe;unsigned long flags; -int ret =0 ;spin_lock_irqsave (&uep->lock, flags); pipe =usbhsg_uep_to_pipe (uep); -if (!pipe) { - ret = -EINVAL ; +if (!pipe) goto out; - }usbhsg_pipe_disable (uep);usbhs_pipe_free (pipe);
drivers/video/fbdev/goldfishfb.c +1 -1
@@ -234,7 +234,7 @@ static int goldfish_fb_probe(struct platform_device *pdev) fb->fb.var.activate =FB_ACTIVATE_NOW ; fb->fb.var.height =readl (fb->reg_base +FB_GET_PHYS_HEIGHT ); fb->fb.var.width =readl (fb->reg_base +FB_GET_PHYS_WIDTH ); - fb->fb.var.pixclock =10000 ; + fb->fb.var.pixclock =0 ; fb->fb.var.red.offset =11 ; fb->fb.var.red.length =5 ;
fs/ext4/inode.c +15 -0
@@ -5094,10 +5094,25 @@ static int ext4_expand_extra_isize(struct inode *inode, {struct ext4_inode *raw_inode;struct ext4_xattr_ibody_header *header; +unsigned int inode_size =EXT4_INODE_SIZE (inode->i_sb); +struct ext4_inode_info *ei =EXT4_I (inode);if (EXT4_I (inode)->i_extra_isize >= new_extra_isize)return 0 ; +/* this was checked at iget time, but double check for good measure */ +if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) || + (ei->i_extra_isize &3 )) { +EXT4_ERROR_INODE (inode,"bad extra_isize %u (inode size %u)" , + ei->i_extra_isize, +EXT4_INODE_SIZE (inode->i_sb)); +return -EIO ; + } +if ((new_extra_isize < ei->i_extra_isize) || + (new_extra_isize <4 ) || + (new_extra_isize > inode_size -EXT4_GOOD_OLD_INODE_SIZE )) +return -EINVAL ;/* Should never happen */ + raw_inode =ext4_raw_inode (&iloc); header =IHDR (inode, raw_inode);
fs/ext4/super.c +35 -24
71 lines not on this page · raw message
fs/readdir.c +40 -0
@@ -50,6 +50,40 @@ int iterate_dir(struct file *file, struct dir_context *ctx) }EXPORT_SYMBOL (iterate_dir); +/* +* POSIX says that a dirent name cannot contain NULL or a '/'. +* +* It's not 100% clear what we should really do in this case. +* The filesystem is clearly corrupted, but returning a hard +* error means that you now don't see any of the other names +* either, so that isn't a perfect alternative. +* +* And if you return an error, what error do you use? Several +* filesystems seem to have decided on EUCLEAN being the error +* code for EFSCORRUPTED, and that may be the error to use. Or +* just EIO, which is perhaps more obvious to users. +* +* In order to see the other file names in the directory, the +* caller might want to make this a "soft" error: skip the +* entry, and return the error at the end instead. +* +* Note that this should likely do a "memchr(name, 0, len)" +* check too, since that would be filesystem corruption as +* well. However, that case can't actually confuse user space, +* which has to do a strlen() on the name anyway to find the +* filename length, and the above "soft error" worry means +* that it's probably better left alone until we have that +* issue clarified. +*/ +static int verify_dirent_name (const char *name,int len) +{ +if (!len) +return -EIO ; +if (memchr (name,'/' , len)) +return -EIO ; +return 0 ; +} +/* * Traditional linux readdir() handling.. *
@@ -157,6 +191,9 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,int reclen =ALIGN (offsetof(struct linux_dirent , d_name) + namlen +2 ,sizeof (long )); + buf->error =verify_dirent_name (name, namlen); +if (unlikely (buf->error)) +return buf->error; buf->error = -EINVAL ;/* only used if we fail.. */ if (reclen > buf->count)return -EINVAL ;
@@ -240,6 +277,9 @@ static int filldir64(void * __buf, const char * name, int namlen, loff_t offset,int reclen =ALIGN (offsetof(struct linux_dirent64 , d_name) + namlen +1 ,sizeof (u64)); + buf->error =verify_dirent_name (name, namlen); +if (unlikely (buf->error)) +return buf->error; buf->error = -EINVAL ;/* only used if we fail.. */ if (reclen > buf->count)return -EINVAL ;
include/asm-generic/fixmap.h +6 -6
@@ -67,12 +67,12 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)#endif /* Return a pointer with offset calculated */ -#define __set_fixmap_offset (idx, phys, flags) \ -({ \ - unsigned long addr; \ - __set_fixmap(idx, phys, flags); \ - addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ - addr; \ +#define __set_fixmap_offset (idx, phys, flags) \ +({ \ + unsigned long ________addr; \ + __set_fixmap(idx, phys, flags); \ + ________addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ + ________addr; \ })#define set_fixmap_offset (idx, phys) \
include/linux/swap.h +0 -1
@@ -395,7 +395,6 @@ extern void end_swap_bio_write(struct bio *bio, int err);extern int __swap_writepage (struct page *page,struct writeback_control *wbc,void (*end_write_func)(struct bio *,int ));extern int swap_set_page_dirty (struct page *page); -extern void end_swap_bio_read (struct bio *bio,int err);int add_swap_extent (struct swap_info_struct *sis,unsigned long start_page,unsigned long nr_pages,sector_t start_block);
include/net/inet_connection_sock.h +0 -5
@@ -287,11 +287,6 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk)return reqsk_queue_len (&inet_csk (sk)->icsk_accept_queue); } -static inline int inet_csk_reqsk_queue_young (const struct sock *sk) -{ -return reqsk_queue_len_young (&inet_csk (sk)->icsk_accept_queue); -} -static inline int inet_csk_reqsk_queue_is_full (const struct sock *sk) {return reqsk_queue_is_full (&inet_csk (sk)->icsk_accept_queue);
kernel/power/Makefile +1 -2
@@ -7,8 +7,7 @@ obj-$(CONFIG_VT_CONSOLE_SLEEP) += console.o obj-$(CONFIG_FREEZER) += process.o obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_PM_TEST_SUSPEND) += suspend_test.o -obj-$(CONFIG_HIBERNATION) += hibernate.o snapshot.o swap.o user.o \ - block_io.o +obj-$(CONFIG_HIBERNATION) += hibernate.o snapshot.o swap.o user.o obj-$(CONFIG_PM_AUTOSLEEP) += autosleep.o obj-$(CONFIG_PM_WAKELOCKS) += wakelock.o
kernel/power/block_io.c deleted +0 -103
103 lines not on this page · raw message
kernel/power/power.h +0 -9
@@ -163,15 +163,6 @@ extern void swsusp_close(fmode_t);extern int swsusp_unmark (void );#endif -/* kernel/power/block_io.c */ -extern struct block_device *hib_resume_bdev; - -extern int hib_bio_read_page (pgoff_t page_off,void *addr, -struct bio **bio_chain); -extern int hib_bio_write_page (pgoff_t page_off,void *addr, -struct bio **bio_chain); -extern int hib_wait_on_bio_chain (struct bio **bio_chain); -struct timeval ;/* kernel/power/swsusp.c */ extern void swsusp_show_speed(struct timeval *, struct timeval *,
kernel/power/swap.c +138 -39
427 lines not on this page · raw message
kernel/sched/fair.c +6 -8
@@ -3163,7 +3163,6 @@ void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b) now =sched_clock_cpu (smp_processor_id ()); cfs_b->runtime = cfs_b->quota; cfs_b->runtime_expires = now +ktime_to_ns (cfs_b->period); - cfs_b->expires_seq++; }static inline struct cfs_bandwidth *tg_cfs_bandwidth (struct task_group *tg)
@@ -3186,7 +3185,6 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq)struct task_group *tg = cfs_rq->tg;struct cfs_bandwidth *cfs_b =tg_cfs_bandwidth (tg);u64 amount =0 , min_amount, expires; -int expires_seq;/* note: this is a positive sum as runtime_remaining <= 0 */ min_amount =sched_cfs_bandwidth_slice () - cfs_rq->runtime_remaining;
@@ -3212,7 +3210,6 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq) cfs_b->idle =0 ; } } - expires_seq = cfs_b->expires_seq; expires = cfs_b->runtime_expires;raw_spin_unlock (&cfs_b->lock);
@@ -3222,10 +3219,8 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq)* spread between our sched_clock and the one on which runtime was * issued. */ -if (cfs_rq->expires_seq != expires_seq) { - cfs_rq->expires_seq = expires_seq; +if ((s64)(expires - cfs_rq->runtime_expires) >0 ) cfs_rq->runtime_expires = expires; - }return cfs_rq->runtime_remaining >0 ; }
@@ -3251,9 +3246,12 @@ static void expire_cfs_rq_runtime(struct cfs_rq *cfs_rq)* has not truly expired. * * Fortunately we can check determine whether this the case by checking -* whether the global deadline(cfs_b->expires_seq) has advanced. +* whether the global deadline has advanced. It is valid to compare +* cfs_b->runtime_expires without any locks since we only care about +* exact equality, so a partial write will still work. */ -if (cfs_rq->expires_seq == cfs_b->expires_seq) { + +if (cfs_rq->runtime_expires != cfs_b->runtime_expires) {/* extend local deadline, drift is bounded above by 2 ticks */ cfs_rq->runtime_expires +=TICK_NSEC ; }else {
kernel/sched/sched.h +0 -2
@@ -187,7 +187,6 @@ struct cfs_bandwidth {u64 quota, runtime;s64 hierarchal_quota;u64 runtime_expires; -int expires_seq;int idle, timer_active;struct hrtimer period_timer, slack_timer;
@@ -377,7 +376,6 @@ struct cfs_rq {#ifdef CONFIG_CFS_BANDWIDTH int runtime_enabled; -int expires_seq;u64 runtime_expires;s64 runtime_remaining;
kernel/trace/trace_uprobe.c +8 -1
@@ -151,7 +151,14 @@ static void FETCH_FUNC_NAME(memory, string)(struct pt_regs *regs, ret =strncpy_from_user (dst, src, maxlen);if (ret == maxlen) - dst[--ret] ='\0' ; + dst[ret -1 ] ='\0' ; +else if (ret >=0 ) +/* +* Include the terminating null byte. In this case it +* was copied by strncpy_from_user but not accounted +* for in ret. +*/ + ret++;if (ret <0 ) {/* Failed to fetch string */ ((u8 *)get_rloc_data (dest))[0 ] ='\0' ;
mm/page_io.c +1 -1
@@ -69,7 +69,7 @@ void end_swap_bio_write(struct bio *bio, int err)bio_put (bio); } -void end_swap_bio_read (struct bio *bio,int err) +static void end_swap_bio_read (struct bio *bio,int err) {const int uptodate =test_bit (BIO_UPTODATE , &bio->bi_flags);struct page *page = bio->bi_io_vec[0 ].bv_page;
mm/rmap.c +1 -1
@@ -403,7 +403,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma)list_for_each_entry_safe (avc, next, &vma->anon_vma_chain, same_vma) {struct anon_vma *anon_vma = avc->anon_vma; -BUG_ON (anon_vma->degree); +VM_WARN_ON (anon_vma->degree);put_anon_vma (anon_vma);list_del (&avc->same_vma);
net/ceph/messenger.c +8 -4
@@ -1984,15 +1984,19 @@ static int process_connect(struct ceph_connection *con)dout ("process_connect on %p tag %d\n" , con, (int )con->in_tag);if (con->auth_reply_buf) { +int len =le32_to_cpu (con->in_reply.authorizer_len); +/* * Any connection that defines ->get_authorizer() * should also define ->verify_authorizer_reply(). * See get_connect_authorizer(). */ - ret = con->ops->verify_authorizer_reply (con,0 ); -if (ret <0 ) { - con->error_msg ="bad authorize reply" ; -return ret; +if (len) { + ret = con->ops->verify_authorizer_reply (con,0 ); +if (ret <0 ) { + con->error_msg ="bad authorize reply" ; +return ret; + } } }
net/dccp/ipv4.c +1 -7
@@ -621,13 +621,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)if (inet_csk_reqsk_queue_is_full (sk)) goto drop; -/* -* Accept backlog is full. If we have already queued enough -* of warm entries in syn queue, drop request. It is better than -* clogging syn queue with openreqs with exponentially increasing -* timeout. -*/ -if (sk_acceptq_is_full (sk) &&inet_csk_reqsk_queue_young (sk) >1 ) +if (sk_acceptq_is_full (sk)) goto drop; req =inet_reqsk_alloc (&dccp_request_sock_ops);
net/dccp/ipv6.c +1 -1
@@ -391,7 +391,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)if (inet_csk_reqsk_queue_is_full (sk)) goto drop; -if (sk_acceptq_is_full (sk) &&inet_csk_reqsk_queue_young (sk) >1 ) +if (sk_acceptq_is_full (sk)) goto drop; req =inet6_reqsk_alloc (&dccp6_request_sock_ops);
net/ipv4/inet_diag.c +12 -6
@@ -318,12 +318,18 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *in_s }#if IS_ENABLED (CONFIG_IPV6 ) else if (req->sdiag_family == AF_INET6) { - sk =inet6_lookup (net, hashinfo, - (struct in6_addr *)req->id.idiag_dst, - req->id.idiag_dport, - (struct in6_addr *)req->id.idiag_src, - req->id.idiag_sport, - req->id.idiag_if); +if (ipv6_addr_v4mapped ((struct in6_addr *)req->id.idiag_dst) && +ipv6_addr_v4mapped ((struct in6_addr *)req->id.idiag_src)) + sk =inet_lookup (net, hashinfo, req->id.idiag_dst[3 ], + req->id.idiag_dport, req->id.idiag_src[3 ], + req->id.idiag_sport, req->id.idiag_if); +else + sk =inet6_lookup (net, hashinfo, + (struct in6_addr *)req->id.idiag_dst, + req->id.idiag_dport, + (struct in6_addr *)req->id.idiag_src, + req->id.idiag_sport, + req->id.idiag_if); }#endif else {
net/ipv4/tcp_ipv4.c +1 -6
@@ -1292,12 +1292,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) goto drop; } -/* Accept backlog is full. If we have already queued enough -* of warm entries in syn queue, drop request. It is better than -* clogging syn queue with openreqs with exponentially increasing -* timeout. -*/ -if (sk_acceptq_is_full (sk) &&inet_csk_reqsk_queue_young (sk) >1 ) { +if (sk_acceptq_is_full (sk)) {NET_INC_STATS_BH (sock_net (sk),LINUX_MIB_LISTENOVERFLOWS ); goto drop; }
net/ipv6/tcp_ipv6.c +1 -1
@@ -1009,7 +1009,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) goto drop; } -if (sk_acceptq_is_full (sk) &&inet_csk_reqsk_queue_young (sk) >1 ) { +if (sk_acceptq_is_full (sk)) {NET_INC_STATS_BH (sock_net (sk),LINUX_MIB_LISTENOVERFLOWS ); goto drop; }
net/wireless/nl80211.c +8 -8
@@ -10463,7 +10463,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,struct sk_buff *msg;void *hdr; - msg =nlmsg_new (NLMSG_DEFAULT_SIZE , gfp); + msg =nlmsg_new (100 + len, gfp);if (!msg)return ;
@@ -10602,7 +10602,7 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,struct sk_buff *msg;void *hdr; - msg =nlmsg_new (NLMSG_DEFAULT_SIZE , gfp); + msg =nlmsg_new (100 + req_ie_len + resp_ie_len, gfp);if (!msg)return ;
@@ -10642,7 +10642,7 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,struct sk_buff *msg;void *hdr; - msg =nlmsg_new (NLMSG_DEFAULT_SIZE , gfp); + msg =nlmsg_new (100 + req_ie_len + resp_ie_len, gfp);if (!msg)return ;
@@ -10680,7 +10680,7 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,struct sk_buff *msg;void *hdr; - msg =nlmsg_new (NLMSG_DEFAULT_SIZE ,GFP_KERNEL ); + msg =nlmsg_new (100 + ie_len,GFP_KERNEL );if (!msg)return ;
@@ -10757,7 +10757,7 @@ void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr,trace_cfg80211_notify_new_peer_candidate (dev, addr); - msg =nlmsg_new (NLMSG_DEFAULT_SIZE , gfp); + msg =nlmsg_new (100 + ie_len, gfp);if (!msg)return ;
@@ -11133,7 +11133,7 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,struct sk_buff *msg;void *hdr; - msg =nlmsg_new (NLMSG_DEFAULT_SIZE , gfp); + msg =nlmsg_new (100 + len, gfp);if (!msg)return -ENOMEM ;
@@ -11176,7 +11176,7 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,trace_cfg80211_mgmt_tx_status (wdev, cookie, ack); - msg =nlmsg_new (NLMSG_DEFAULT_SIZE , gfp); + msg =nlmsg_new (100 + len, gfp);if (!msg)return ;
@@ -11886,7 +11886,7 @@ void cfg80211_ft_event(struct net_device *netdev,if (!ft_event->target_ap)return ; - msg =nlmsg_new (NLMSG_DEFAULT_SIZE ,GFP_KERNEL ); + msg =nlmsg_new (100 + ft_event->ric_ies_len,GFP_KERNEL );if (!msg)return ;
scripts/setlocalversion +1 -1
@@ -143,7 +143,7 @@ fi if test -e include/config/auto.conf; then . include/config/auto.conf else - echo "Error: kernelrelease not valid - run 'make prepare' to update it" + echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2 exit 1 fi
sound/core/compress_offload.c +13 -0
@@ -38,6 +38,7 @@#include <linux/uio.h> #include <linux/uaccess.h> #include <linux/module.h> +#include <linux/compat.h> #include <sound/core.h> #include <sound/initval.h> #include <sound/compress_params.h>
@@ -864,6 +865,15 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)return retval; } +/* support of 32bit userspace on 64bit platforms */ +#ifdef CONFIG_COMPAT +static long snd_compr_ioctl_compat (struct file *file,unsigned int cmd, +unsigned long arg) +{ +return snd_compr_ioctl (file, cmd, (unsigned long )compat_ptr (arg)); +} +#endif +static const struct file_operations snd_compr_file_ops = { .owner =THIS_MODULE , .open = snd_compr_open,
@@ -871,6 +881,9 @@ static const struct file_operations snd_compr_file_ops = { .write = snd_compr_write, .read = snd_compr_read, .unlocked_ioctl = snd_compr_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = snd_compr_ioctl_compat, +#endif .mmap = snd_compr_mmap, .poll = snd_compr_poll, };