Linux 3.2.91
I'm announcing the release of the 3.2.91 kernel.
All users of the 3.2 kernel series should upgrade.
The updated 3.2.y git tree can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.2.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.2.90 is attached to this message.
Ben.
------------
Makefile | 2 +- arch/mips/kernel/kgdb.c | 48 +++++--- arch/powerpc/kernel/align.c | 27 +++-- arch/s390/boot/compressed/misc.c | 35 +++--- arch/x86/include/asm/elf.h | 2 +- arch/x86/kernel/ftrace.c | 12 ++ arch/x86/mm/init.c | 41 +++++-- arch/x86/pci/xen.c | 23 ++-- drivers/acpi/Makefile | 1 - drivers/acpi/apei/ghes.c | 1 + drivers/acpi/power.c | 2 +- drivers/block/xen-blkback/blkback.c | 23 ++-- drivers/block/xen-blkback/common.h | 19 +-- drivers/char/lp.c | 6 +- drivers/char/mem.c | 82 ++++++++----- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 74 +++++++---- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 +- drivers/hwmon/asus_atk0110.c | 3 + drivers/infiniband/hw/qib/qib_iba7322.c | 2 +- drivers/input/joystick/iforce/iforce-usb.c | 3 + drivers/input/misc/cm109.c | 4 + drivers/input/misc/yealink.c | 4 + drivers/input/serio/i8042-x86ia64io.h | 14 +++ drivers/input/tablet/hanwang.c | 3 + drivers/input/tablet/kbtab.c | 3 + drivers/isdn/gigaset/bas-gigaset.c | 3 + drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | 33 +++-- drivers/mmc/host/sdhci.c | 10 +- drivers/mmc/host/ushc.c | 3 + drivers/mtd/ubi/upd.c | 8 +- drivers/net/ethernet/toshiba/tc35815.c | 2 +- drivers/net/phy/phy.c | 2 +- drivers/net/usb/cx82310_eth.c | 7 +- drivers/net/usb/smsc75xx.c | 8 +- drivers/net/wimax/i2400m/usb.c | 3 + drivers/scsi/aacraid/src.c | 2 +- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/lpfc/lpfc_init.c | 1 + drivers/scsi/sd.c | 20 ++- drivers/scsi/sr.c | 6 +- drivers/target/iscsi/iscsi_target_parameters.c | 16 --- drivers/tty/serial/mxs-auart.c | 10 +- drivers/usb/class/usbtmc.c | 9 +- drivers/usb/core/config.c | 10 ++ drivers/usb/core/quirks.c | 8 ++ drivers/usb/dwc3/gadget.h | 14 +-- drivers/usb/gadget/f_acm.c | 4 +- drivers/usb/host/xhci.c | 56 +++++---- drivers/usb/misc/idmouse.c | 3 + drivers/usb/misc/iowarrior.c | 8 ++ drivers/usb/misc/uss720.c | 5 + drivers/usb/serial/io_ti.c | 6 + drivers/usb/serial/option.c | 17 ++- drivers/usb/serial/safe_serial.c | 5 + drivers/usb/wusbcore/wa-hc.c | 3 + drivers/uwb/hwa-rc.c | 3 + drivers/uwb/i1480/dfu/usb.c | 3 + drivers/video/xen-fbfront.c | 4 +- drivers/virtio/virtio_balloon.c | 4 + fs/exec.c | 28 ++++- include/linux/skbuff.h | 7 ++ include/linux/usb/quirks.h | 6 + include/trace/events/syscalls.h | 1 + kernel/events/core.c | 5 +- kernel/futex.c | 22 ++-- kernel/ptrace.c | 14 ++- kernel/sched.c | 4 +- kernel/trace/ring_buffer.c | 16 ++- net/9p/client.c | 4 + net/ipv4/ip_output.c | 2 +- net/ipv4/netfilter/nf_nat_snmp_basic.c | 19 +-- net/ipv6/ip6_output.c | 2 +- net/ipv6/route.c | 2 + net/key/af_key.c | 42 +++++-- net/l2tp/l2tp_core.c | 162 +++++++++++++++++++------ net/l2tp/l2tp_core.h | 9 +- net/l2tp/l2tp_debugfs.c | 10 +- net/l2tp/l2tp_eth.c | 10 +- net/l2tp/l2tp_ip.c | 17 ++- net/l2tp/l2tp_netlink.c | 46 ++++--- net/l2tp/l2tp_ppp.c | 94 +++++++------- net/mac80211/rx.c | 24 ++++ net/sched/act_csum.c | 8 +- net/sched/act_nat.c | 18 +-- net/sched/sch_dsmark.c | 10 +- net/unix/garbage.c | 18 +-- security/keys/gc.c | 2 +- sound/core/seq/seq_clientmgr.c | 1 + sound/core/seq/seq_fifo.c | 7 ++ sound/core/seq/seq_lock.c | 9 +- sound/core/seq/seq_memory.c | 17 ++- sound/core/seq/seq_memory.h | 1 + sound/core/timer.c | 7 +- sound/pci/ctxfi/cthw20k1.c | 2 +- tools/perf/util/symbol.c | 2 +- tools/power/cpupower/utils/helpers/cpuid.c | 1 + 96 files changed, 933 insertions(+), 452 deletions(-)
Adrian Hunter (1):
mmc: sdhci: Do not disable interrupts while waiting for clock
Al Viro (1):
p9_client_readdir() fix
Alexey Kodanev (1):
udp: avoid ufo handling on IP payload compression packets
Andrey Ulanov (1):
net: unix: properly re-increment inflight counter of GC discarded candidates
Anton Blanchard (1):
scsi: lpfc: Add shutdown method for kexec
Arnd Bergmann (4):
hwmon: (asus_atk0110) fix uninitialized data access IB/qib: fix false-postive maybe-uninitialized warning
virtio_balloon: prevent uninitialized variable use ACPI / power: Avoid maybe-uninitialized warning
Ben Hutchings (2):
cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores Linux 3.2.91
Dan Carpenter (1):
net: tc35815: move free after the dereference
Dan Streetman (1):
xen: do not re-use pirq number cached in pci device msi msg data
Dan Williams (1):
USB: serial: option: add Quectel UC15, UC20, EC21, and EC25 modems
Daniel Borkmann (2):
perf symbols: Fix symbols__fixup_end heuristic for corner cases
bpf: try harder on clones when writing into skb
David Ahern (1):
net: ipv6: set route type for anycast routes
David Howells (1):
KEYS: Change the name of the dead type to ".dead" to prevent user access
Dmitry Torokhov (1):
Input: i8042 - add Clevo P650RS to the i8042 reset list
Eric Dumazet (3):
sch_dsmark: fix invalid skb_cow() usage
smsc75xx: use skb_cow_head() to deal with cloned skbs
cx82310_eth: use skb_cow_head() to deal with cloned skbs
Felipe Balbi (1):
usb: dwc3: gadget: make Set Endpoint Configuration macros safe
Gao Feng (1):
netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register
Guillaume Nault (7):
l2tp: fix race in l2tp_recv_common()
l2tp: ensure session can't get removed during pppol2tp_session_ioctl()
l2tp: fix duplicate session creation
l2tp: take a reference on sessions used in genetlink handlers
l2tp: take reference on sessions being dumped
l2tp: don't mask errors in pppol2tp_setsockopt()
l2tp: don't mask errors in pppol2tp_getsockopt()
Hans de Goede (1):
mmc: sdhci: Disable runtime pm when the sdio_irq is enabled
James Hogan (1):
MIPS: KGDB: Use kernel context for sleeping threads
James Morse (1):
ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal
Jan Beulich (1):
xen-blkback: don't leak stack data via response ring
Johan Hovold (17):
USB: serial: io_ti: fix NULL-deref in interrupt callback
USB: serial: safe_serial: fix information leak in completion handler
USB: iowarrior: fix NULL-deref in write
isdn/gigaset: fix NULL-deref at probe
net: wimax/i2400m: fix NULL-deref at probe
USB: idmouse: fix NULL-deref at probe
USB: uss720: fix NULL-deref at probe
USB: wusbcore: fix NULL-deref at probe
uwb: hwa-rc: fix NULL-deref at probe
uwb: i1480-dfu: fix NULL-deref at probe
mmc: ushc: fix NULL-deref at probe
Input: iforce - validate number of endpoints before using them
Input: cm109 - validate number of endpoints before using them
Input: yealink - validate number of endpoints before using them
Input: hanwang - validate number of endpoints before using them
Input: kbtab - validate number of endpoints before using them
USB: usbtmc: add missing endpoint sanity check
Johannes Berg (1):
mac80211: reject ToDS broadcast data frames
John Garry (1):
scsi: libsas: fix ata xfer length
Josh Poimboeuf (2):
ACPI: Fix incompatibility with mcount-based function graph tracing ftrace/x86: Fix triple fault with graph tracing and suspend-to-ram
Juergen Gross (1):
xen, fbfront: fix connecting to backend
Kai-Heng Feng (1):
Input: i8042 - add noloop quirk for Dell Embedded Box PC 3000
Kees Cook (2):
mm: Tighten x86 /dev/mem with zeroing reads
fs/exec.c: account for argv/envp pointers
Ladi Prosek (1):
virtio_balloon: init 1st buffer in stats vq
Marcelo Henrique Cerri (1):
s390/decompressor: fix initrd corruption caused by bss clear
Martin K. Petersen (2):
scsi: sr: Sanity check returned mode data
scsi: sd: Fix capacity calculation with 32-bit sector_t
Mathias Nyman (1):
xhci: Manually give back cancelled URB if we can't queue it for cancel
Matt Fleming (1):
sched/loadavg: Avoid loadavg spikes caused by delayed NO_HZ accounting
Mauro Carvalho Chehab (1):
dvb-usb: don't use stack for firmware load
Murray McAllister (1):
drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()
Nathan Sullivan (1):
net: phy: handle state correctly in phy_stop_machine
Nicholas Bellinger (1):
iscsi-target: Drop work-around for legacy GlobalSAN initiator
Oliver Neukum (1):
ACM gadget: fix endianness in notifications
Paul Mackerras (1):
powerpc: Don't try to fix up misaligned load-with-reservation instructions
Peter Zijlstra (3):
futex: Fix potential use-after-free in FUTEX_REQUEUE_PI
futex: Add missing error handling to FUTEX_REQUEUE_PI perf/core: Fix event inheritance on fork()
Raghava Aditya Renukunta (1):
scsi: aacraid: Fix typo in blink status
Rik van Riel (1):
tracing: Add #undef to fix compile error
Samuel Thibault (1):
usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk
Sebastian Siewior (1):
ubi/upd: Always flush after prepared for an update
Stefan Brüns (1):
dvb-usb-firmware: don't do DMA on stack
Stefan Wahren (1):
serial: mxs-auart: fix baud rate range
Steven Rostedt (VMware) (1):
ring-buffer: Have ring_buffer_iter_empty() return true when empty
T Makphaibulchoke (1):
x86/mm/init.c: Fix devmem_is_allowed() off by one
Takashi Iwai (6):
ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call
ALSA: seq: Fix racy cell insertions during snd_seq_pool_done()
ALSA: seq: Fix race during FIFO resize
ALSA: seq: Don't break snd_use_lock_sync() loop by timeout
ALSA: timer: Fix race between read and ioctl
ALSA: timer: Fix missing queue indices reset at SNDRV_TIMER_IOCTL_SELECT
Thomas Gleixner (1):
x86/vdso: Plug race between mapping and ELF header setup
Thomas Hellstrom (2):
drm/vmwgfx: Type-check lookups of fence objects drm/vmwgfx: Remove getparam error message
Uwe Kleine-König (1):
serial: mxs-auart: Fix baudrate calculation
Willy Tarreau (1):
char: lp: fix possible integer overflow in lp_setup()
Yuejie Shi (1):
af_key: Add lock to key dump
[email protected] (1):
ptrace: fix PTRACE_LISTEN race corrupting task->state
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 2 -SUBLEVEL = 90 +SUBLEVEL = 91 EXTRAVERSION = NAME = Saber-toothed Squirrel
arch/mips/kernel/kgdb.c +33 -15
67 lines not on this page · raw message
arch/powerpc/kernel/align.c +19 -8
@@ -764,14 +764,25 @@ int fix_alignment(struct pt_regs *regs) nb = aligninfo[instr].len; flags = aligninfo[instr].flags; -/* ldbrx/stdbrx overlap lfs/stfs in the DSISR unfortunately */ -if (IS_XFORM (instruction) && ((instruction >>1 ) &0x3ff ) ==532 ) { - nb =8 ; - flags =LD +SW ; - }else if (IS_XFORM (instruction) && - ((instruction >>1 ) &0x3ff ) ==660 ) { - nb =8 ; - flags =ST +SW ; +/* +* Handle some cases which give overlaps in the DSISR values. +*/ +if (IS_XFORM (instruction)) { +switch ((instruction >>1 ) &0x3ff ) { +case 532 :/* ldbrx */ + nb =8 ; + flags =LD +SW ; +break ; +case 660 :/* stdbrx */ + nb =8 ; + flags =ST +SW ; +break ; +case 20 :/* lwarx */ +case 84 :/* ldarx */ +case 116 :/* lharx */ +case 276 :/* lqarx */ +return 0 ;/* not emulated ever */ + } }/* Byteswap little endian loads and stores */
arch/s390/boot/compressed/misc.c +19 -16
@@ -135,31 +135,34 @@ static void check_ipl_parmblock(void *start, unsigned long size)unsigned long decompress_kernel (void ) { -unsigned long output_addr; -unsigned char *output; +void *output, *kernel_end; - output_addr = ((unsigned long ) &_end +HEAP_SIZE +4095UL ) &-4096UL ; -check_ipl_parmblock ((void *)0 , output_addr + SZ__bss_start); -memset (&_bss,0 , &_ebss - &_bss); - free_mem_ptr = (unsigned long )&_end; - free_mem_end_ptr = free_mem_ptr +HEAP_SIZE ; - output = (unsigned char *) output_addr; + output = (void *)ALIGN ((unsigned long ) &_end +HEAP_SIZE ,PAGE_SIZE ); + kernel_end = output + SZ__bss_start; +check_ipl_parmblock ((void *)0 , (unsigned long ) kernel_end);#ifdef CONFIG_BLK_DEV_INITRD /* * Move the initrd right behind the end of the decompressed -* kernel image. +* kernel image. This also prevents initrd corruption caused by +* bss clearing since kernel_end will always be located behind the +* current bss section.. */ -if (INITRD_START &&INITRD_SIZE && -INITRD_START < (unsigned long ) output + SZ__bss_start) { -check_ipl_parmblock (output + SZ__bss_start, -INITRD_START +INITRD_SIZE ); -memmove (output + SZ__bss_start, - (void *)INITRD_START ,INITRD_SIZE ); -INITRD_START = (unsigned long ) output + SZ__bss_start; +if (INITRD_START &&INITRD_SIZE && kernel_end > (void *)INITRD_START ) { +check_ipl_parmblock (kernel_end,INITRD_SIZE ); +memmove (kernel_end, (void *)INITRD_START ,INITRD_SIZE ); +INITRD_START = (unsigned long ) kernel_end; }#endif +/* +* Clear bss section. free_mem_ptr and free_mem_end_ptr need to be +* initialized afterwards since they reside in bss. +*/ +memset (&_bss,0 , &_ebss - &_bss); + free_mem_ptr = (unsigned long ) &_end; + free_mem_end_ptr = free_mem_ptr +HEAP_SIZE ; +puts ("Uncompressing Linux... " );decompress (input_data, input_len,NULL ,NULL , output,NULL , error);puts ("Ok, booting the kernel.\n" );
arch/x86/include/asm/elf.h +1 -1
@@ -298,7 +298,7 @@ do { \#define AT_SYSINFO 32 -#define COMPAT_ARCH_DLINFO ARCH_DLINFO_IA32(sysctl_vsyscall32) +#define COMPAT_ARCH_DLINFO ARCH_DLINFO_IA32(VDSO_CURRENT_BASE)#define COMPAT_ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000)
arch/x86/kernel/ftrace.c +12 -0
@@ -404,6 +404,18 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,unsigned long return_hooker = (unsigned long ) &return_to_handler; +/* +* When resuming from suspend-to-ram, this function can be indirectly +* called from early CPU startup code while the CPU is in real mode, +* which would fail miserably. Make sure the stack pointer is a +* virtual address. +* +* This check isn't as accurate as virt_addr_valid(), but it should be +* good enough for this purpose, and it's fast. +*/ +if (unlikely ((long )__builtin_frame_address (0 ) >=0 )) +return ; +if (unlikely (atomic_read (¤t->tracing_graph_pause)))return ;
arch/x86/mm/init.c +30 -11
51 lines not on this page · raw message
arch/x86/pci/xen.c +7 -16
@@ -227,23 +227,14 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)return 1 ;list_for_each_entry (msidesc, &dev->msi_list, list) { -__read_msi_msg (msidesc, &msg); - pirq =MSI_ADDR_EXT_DEST_ID (msg.address_hi) | - ((msg.address_lo >>MSI_ADDR_DEST_ID_SHIFT ) &0xff ); -if (msg.data !=XEN_PIRQ_MSI_DATA || -xen_irq_from_pirq (pirq) <0 ) { - pirq =xen_allocate_pirq_msi (dev, msidesc); -if (pirq <0 ) { - irq = -ENODEV ; - goto error; - } -xen_msi_compose_msg (dev, pirq, &msg); -__write_msi_msg (msidesc, &msg); -dev_dbg (&dev->dev,"xen: msi bound to pirq=%d\n" , pirq); - }else { -dev_dbg (&dev->dev, -"xen: msi already bound to pirq=%d\n" , pirq); + pirq =xen_allocate_pirq_msi (dev, msidesc); +if (pirq <0 ) { + irq = -ENODEV ; + goto error; } +xen_msi_compose_msg (dev, pirq, &msg); +__write_msi_msg (msidesc, &msg); +dev_dbg (&dev->dev,"xen: msi bound to pirq=%d\n" , pirq); irq = xen_bind_pirq_msi_to_irq(dev, msidesc, pirq, 0, (type == PCI_CAP_ID_MSIX) ? "msi-x" : "msi",
drivers/acpi/Makefile +0 -1
@@ -2,7 +2,6 @@ # Makefile for the Linux ACPI interpreter # -ccflags-y := -Os ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT #
drivers/acpi/apei/ghes.c +1 -0
@@ -953,6 +953,7 @@ static int __devexit ghes_remove(struct platform_device *ghes_dev)if (list_empty (&ghes_sci))unregister_acpi_hed_notifier (&ghes_notifier_sci);mutex_unlock (&ghes_list_mutex); +synchronize_rcu ();break ;case ACPI_HEST_NOTIFY_NMI :mutex_lock (&ghes_list_mutex);
drivers/acpi/power.c +1 -1
@@ -152,7 +152,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)return -EINVAL ;/* The state of the list is 'on' IFF all resources are 'on'. */ - + cur_state =0 ;for (i =0 ; i < list->count; i++) {struct acpi_power_resource *resource;acpi_handle handle = list->handles[i];
drivers/block/xen-blkback/blkback.c +12 -11
@@ -811,33 +811,34 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,static void make_response (struct xen_blkif *blkif,u64 id,unsigned short op,int st) { -struct blkif_response resp; +struct blkif_response *resp;unsigned long flags;union blkif_back_rings *blk_rings = &blkif->blk_rings;int notify; - resp.id = id; - resp.operation = op; - resp.status = st; -spin_lock_irqsave (&blkif->blk_ring_lock, flags);/* Place on the response ring for the relevant domain. */ switch (blkif->blk_protocol) {case BLKIF_PROTOCOL_NATIVE : -memcpy (RING_GET_RESPONSE (&blk_rings->native, blk_rings->native.rsp_prod_pvt), - &resp,sizeof (resp)); + resp =RING_GET_RESPONSE (&blk_rings->native, + blk_rings->native.rsp_prod_pvt);break ;case BLKIF_PROTOCOL_X86_32 : -memcpy (RING_GET_RESPONSE (&blk_rings->x86_32, blk_rings->x86_32.rsp_prod_pvt), - &resp,sizeof (resp)); + resp =RING_GET_RESPONSE (&blk_rings->x86_32, + blk_rings->x86_32.rsp_prod_pvt);break ;case BLKIF_PROTOCOL_X86_64 : -memcpy (RING_GET_RESPONSE (&blk_rings->x86_64, blk_rings->x86_64.rsp_prod_pvt), - &resp,sizeof (resp)); + resp =RING_GET_RESPONSE (&blk_rings->x86_64, + blk_rings->x86_64.rsp_prod_pvt);break ;default :BUG (); } + + resp->id = id; + resp->operation = op; + resp->status = st; + blk_rings->common.rsp_prod_pvt++;RING_PUSH_RESPONSES_AND_CHECK_NOTIFY (&blk_rings->common, notify);spin_unlock_irqrestore (&blkif->blk_ring_lock, flags);
drivers/block/xen-blkback/common.h +3 -16
@@ -56,9 +56,6 @@struct blkif_common_request {char dummy; }; -struct blkif_common_response { -char dummy; -};/* i386 protocol version */ #pragma pack(push, 4)
@@ -83,11 +80,6 @@ struct blkif_x86_32_request {struct blkif_x86_32_request_discard discard; } u; }; -struct blkif_x86_32_response { -uint64_t id;/* copied from request */ -uint8_t operation;/* copied from request */ -int16_t status;/* BLKIF_RSP_??? */ -};#pragma pack(pop)/* x86_64 protocol version */
@@ -112,18 +104,13 @@ struct blkif_x86_64_request {struct blkif_x86_64_request_discard discard; } u; }; -struct blkif_x86_64_response { -uint64_t __attribute__((__aligned__ (8 ))) id; -uint8_t operation;/* copied from request */ -int16_t status;/* BLKIF_RSP_??? */ -}; DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, - struct blkif_common_response); + struct blkif_response); DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, - struct blkif_x86_32_response); + struct blkif_response __packed); DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, - struct blkif_x86_64_response); + struct blkif_response);union blkif_back_rings {struct blkif_back_ring native;
drivers/char/lp.c +5 -1
@@ -858,7 +858,11 @@ static int __init lp_setup (char *str) }else if (!strcmp (str,"auto" )) { parport_nr[0 ] =LP_PARPORT_AUTO ; }else if (!strcmp (str,"none" )) { - parport_nr[parport_ptr++] =LP_PARPORT_NONE ; +if (parport_ptr <LP_NO ) + parport_nr[parport_ptr++] =LP_PARPORT_NONE ; +else +printk (KERN_INFO "lp: too many ports, %s ignored.\n" , + str); }else if (!strcmp (str,"reset" )) { reset =1 ; }
drivers/char/mem.c +52 -30
117 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +49 -25
123 lines not on this page · raw message
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +1 -3
@@ -69,8 +69,6 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data,break ; }default : -DRM_ERROR ("Illegal vmwgfx get param request: %d\n" , - param->param);return -EINVAL ; }
@@ -90,7 +88,7 @@ int vmw_get_cap_3d_ioctl(struct drm_device *dev, void *data,void *bounce;int ret; -if (unlikely (arg->pad64 !=0 )) { +if (unlikely (arg->pad64 !=0 || arg->max_size ==0 )) {DRM_ERROR ("Illegal GET_3D_CAP argument.\n" );return -EINVAL ; }
drivers/hwmon/asus_atk0110.c +3 -0
@@ -645,6 +645,9 @@ static int atk_read_value(struct atk_sensor_data *sensor, u64 *value)else err =atk_read_value_new (sensor, value); +if (err) +return err; + sensor->is_valid = true; sensor->last_updated = jiffies; sensor->cached_value = *value;
drivers/infiniband/hw/qib/qib_iba7322.c +1 -1
@@ -6614,7 +6614,7 @@ static void qib_7322_txchk_change(struct qib_devdata *dd, u32 start,unsigned long flags;while (wait) { -unsigned long shadow; +unsigned long shadow =0 ;int cstart, previ =-1 ;/*
drivers/input/joystick/iforce/iforce-usb.c +3 -0
@@ -138,6 +138,9 @@ static int iforce_usb_probe(struct usb_interface *intf, interface = intf->cur_altsetting; +if (interface->desc.bNumEndpoints <2 ) +return -ENODEV ; + epirq = &interface->endpoint[0 ].desc; epout = &interface->endpoint[1 ].desc;
drivers/input/misc/cm109.c +4 -0
@@ -663,6 +663,10 @@ static int cm109_usb_probe(struct usb_interface *intf,int error = -ENOMEM ; interface = intf->cur_altsetting; + +if (interface->desc.bNumEndpoints <1 ) +return -ENODEV ; + endpoint = &interface->endpoint[0 ].desc;if (!usb_endpoint_is_int_in (endpoint))
drivers/input/misc/yealink.c +4 -0
@@ -867,6 +867,10 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)int ret, pipe, i; interface = intf->cur_altsetting; + +if (interface->desc.bNumEndpoints <1 ) +return -ENODEV ; + endpoint = &interface->endpoint[0 ].desc;if (!usb_endpoint_is_int_in (endpoint))return -ENODEV ;
drivers/input/serio/i8042-x86ia64io.h +14 -0
@@ -120,6 +120,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { }, }, { +/* Dell Embedded Box PC 3000 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Dell Inc." ), + DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"), + }, + }, + {/* OQO Model 01 */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
@@ -573,6 +580,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"), }, }, + { + /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), + DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"), + }, + }, { } };
drivers/input/tablet/hanwang.c +3 -0
@@ -314,6 +314,9 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_idint error;int i; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + hanwang =kzalloc (sizeof (struct hanwang ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!hanwang || !input_dev) {
drivers/input/tablet/kbtab.c +3 -0
@@ -117,6 +117,9 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *istruct input_dev *input_dev;int error = -ENOMEM ; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + kbtab =kzalloc (sizeof (struct kbtab ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!kbtab || !input_dev)
drivers/isdn/gigaset/bas-gigaset.c +3 -0
@@ -2314,6 +2314,9 @@ static int gigaset_probe(struct usb_interface *interface,return -ENODEV ; } +if (hostif->desc.bNumEndpoints <1 ) +return -ENODEV ; + dev_info(&udev->dev, "%s: Device matched (Vendor: 0x%x, Product: 0x%x)\n", __func__, le16_to_cpu(udev->descriptor.idVendor),
drivers/media/dvb/dvb-usb/dvb-usb-firmware.c +21 -12
@@ -35,42 +35,51 @@ static int usb_cypress_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 leint usb_cypress_load_firmware (struct usb_device *udev,const struct firmware *fw,int type) { -struct hexline hx; -u8 reset; -int ret,pos=0 ; +struct hexline *hx; +u8 *buf; +int ret, pos =0 ; +u16 cpu_cs_register = cypress[type].cpu_cs_register; + + buf =kmalloc (sizeof (*hx),GFP_KERNEL ); +if (!buf) +return -ENOMEM ; + hx = (struct hexline *)buf;/* stop the CPU */ - reset =1 ; -if ((ret =usb_cypress_writemem (udev,cypress[type].cpu_cs_register,&reset,1 )) !=1 ) + buf[0 ] =1 ; +if (usb_cypress_writemem (udev, cpu_cs_register, buf,1 ) !=1 )err ("could not stop the USB controller CPU." ); -while ((ret =dvb_usb_get_hexline (fw,&hx,&pos)) >0 ) { -deb_fw ("writing to address 0x%04x (buffer: 0x%02x %02x)\n" ,hx.addr,hx.len,hx.chk); - ret =usb_cypress_writemem (udev,hx.addr,hx.data,hx.len); +while ((ret =dvb_usb_get_hexline (fw, hx, &pos)) >0 ) { +deb_fw ("writing to address 0x%04x (buffer: 0x%02x %02x)\n" , hx->addr, hx->len, hx->chk); + ret =usb_cypress_writemem (udev, hx->addr, hx->data, hx->len); -if (ret != hx.len) { +if (ret != hx->len) {err ("error while transferring firmware " "(transferred size: %d, block size: %d)" , - ret,hx.len); + ret, hx->len); ret = -EINVAL ;break ; } }if (ret <0 ) {err ("firmware download failed at %d with %d" ,pos,ret); +kfree (buf);return ret; }if (ret ==0 ) {/* restart the CPU */ - reset =0 ; -if (ret ||usb_cypress_writemem (udev,cypress[type].cpu_cs_register,&reset,1 ) !=1 ) { + buf[0 ] =0 ; +if (usb_cypress_writemem (udev, cpu_cs_register, buf,1 ) !=1 ) {err ("could not restart the USB controller CPU." ); ret = -EINVAL ; } }else ret = -EIO ; +kfree (buf); +return ret; }EXPORT_SYMBOL (usb_cypress_load_firmware);
drivers/mmc/host/sdhci.c +9 -1
@@ -1150,7 +1150,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)return ; } timeout--; -mdelay (1 ); +spin_unlock_irq (&host->lock); +usleep_range (900 ,1100 ); +spin_lock_irq (&host->lock); } clk |=SDHCI_CLOCK_CARD_EN ;
@@ -1544,9 +1546,15 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)struct sdhci_host *host =mmc_priv (mmc);unsigned long flags; +if (enable) +pm_runtime_get_noresume (host->mmc->parent); +spin_lock_irqsave (&host->lock, flags);sdhci_enable_sdio_irq_nolock (host, enable);spin_unlock_irqrestore (&host->lock, flags); + +if (!enable) +pm_runtime_put_noidle (host->mmc->parent); } static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
drivers/mmc/host/ushc.c +3 -0
@@ -426,6 +426,9 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *idstruct ushc_data *ushc;int ret; +if (intf->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + mmc =mmc_alloc_host (sizeof (struct ushc_data ), &intf->dev);if (mmc ==NULL )return -ENOMEM ;
drivers/mtd/ubi/upd.c +4 -4
@@ -150,11 +150,11 @@ int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,return err; } -if (bytes ==0 ) { - err =ubi_wl_flush (ubi); -if (err) -return err; + err =ubi_wl_flush (ubi); +if (err) +return err; +if (bytes ==0 ) { err =clear_update_marker (ubi, vol,0 );if (err)return err;
drivers/net/ethernet/toshiba/tc35815.c +1 -1
@@ -1053,8 +1053,8 @@ tc35815_free_queues(struct net_device *dev)BUG_ON (lp->tx_skbs[i].skb != skb);#endif if (skb) { -dev_kfree_skb (skb);pci_unmap_single (lp->pci_dev, lp->tx_skbs[i].skb_dma, skb->len,PCI_DMA_TODEVICE ); +dev_kfree_skb (skb); lp->tx_skbs[i].skb =NULL ; lp->tx_skbs[i].skb_dma =0 ; }
drivers/net/phy/phy.c +1 -1
@@ -453,7 +453,7 @@ void phy_stop_machine(struct phy_device *phydev)cancel_delayed_work_sync (&phydev->state_queue);mutex_lock (&phydev->lock); -if (phydev->state >PHY_UP ) +if (phydev->state >PHY_UP && phydev->state !=PHY_HALTED ) phydev->state =PHY_UP ;mutex_unlock (&phydev->lock);
drivers/net/usb/cx82310_eth.c +2 -5
@@ -277,12 +277,9 @@ static struct sk_buff *cx82310_tx_fixup(struct usbnet *dev, struct sk_buff *skb, {int len = skb->len; -if (skb_headroom (skb) <2 ) { -struct sk_buff *skb2 =skb_copy_expand (skb,2 ,0 , flags); +if (skb_cow_head (skb,2 )) {dev_kfree_skb_any (skb); - skb = skb2; -if (!skb) -return NULL ; +return NULL ; }skb_push (skb,2 );
drivers/net/usb/smsc75xx.c +2 -6
@@ -1170,13 +1170,9 @@ static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev, {u32 tx_cmd_a, tx_cmd_b; -if (skb_headroom (skb) <SMSC75XX_TX_OVERHEAD ) { -struct sk_buff *skb2 = -skb_copy_expand (skb,SMSC75XX_TX_OVERHEAD ,0 , flags); +if (skb_cow_head (skb,SMSC75XX_TX_OVERHEAD )) {dev_kfree_skb_any (skb); - skb = skb2; -if (!skb) -return NULL ; +return NULL ; } tx_cmd_a = (u32)(skb->len &TX_CMD_A_LEN ) |TX_CMD_A_FCS ;
drivers/net/wimax/i2400m/usb.c +3 -0
@@ -449,6 +449,9 @@ int i2400mu_probe(struct usb_interface *iface,struct i2400mu *i2400mu;struct usb_device *usb_dev =interface_to_usbdev (iface); +if (iface->cur_altsetting->desc.bNumEndpoints <4 ) +return -ENODEV ; +if (usb_dev->speed !=USB_SPEED_HIGH )dev_err (dev,"device not connected as high speed\n" );
drivers/scsi/aacraid/src.c +1 -1
@@ -348,7 +348,7 @@ static int aac_src_check_health(struct aac_dev *dev)return -1 ; err_blink: -return (status >16 ) &0xFF ; +return (status >>16 ) &0xFF ; }/**
drivers/scsi/libsas/sas_ata.c +1 -1
@@ -205,7 +205,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) task->num_scatter = qc->n_elem; }else {for_each_sg (qc->sg, sg, qc->n_elem, si) - xfer += sg->length; + xfer +=sg_dma_len (sg); task->total_xfer_len = xfer; task->num_scatter = si;
drivers/scsi/lpfc/lpfc_init.c +1 -0
@@ -10002,6 +10002,7 @@ static struct pci_driver lpfc_driver = { .id_table = lpfc_id_table, .probe = lpfc_pci_probe_one, .remove = __devexit_p(lpfc_pci_remove_one), + .shutdown = lpfc_pci_remove_one, .suspend = lpfc_pci_suspend_one, .resume = lpfc_pci_resume_one, .err_handler = &lpfc_err_handler,
drivers/scsi/sd.c +18 -2
@@ -1648,6 +1648,22 @@ static void read_capacity_error(struct scsi_disk *sdkp, struct scsi_device *sdp,#define READ_CAPACITY_RETRIES_ON_RESET 10 +/* +* Ensure that we don't overflow sector_t when CONFIG_LBDAF is not set +* and the reported logical block size is bigger than 512 bytes. Note +* that last_sector is a u64 and therefore logical_to_sectors() is not +* applicable. +*/ +static bool sd_addressable_capacity (u64 lba,unsigned int sector_size) +{ +u64 last_sector = (lba +1ULL ) << (ilog2 (sector_size) -9 ); + +if (sizeof (sector_t) ==4 && last_sector >0xffffffffULL ) +return false; + +return true; +} +static int read_capacity_16 (struct scsi_disk *sdkp,struct scsi_device *sdp,unsigned char *buffer) {
@@ -1710,7 +1726,7 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp,sd_read_protection_type (sdkp, buffer); -if ((sizeof (sdkp->capacity) ==4 ) && (lba >=0xffffffffULL )) { +if (!sd_addressable_capacity (lba, sector_size)) {sd_printk (KERN_ERR , sdkp,"Too big for this kernel. Use a " "kernel compiled with support for large block " "devices.\n" );
@@ -1796,7 +1812,7 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp,return sector_size; } -if ((sizeof (sdkp->capacity) ==4 ) && (lba ==0xffffffff )) { +if (!sd_addressable_capacity (lba, sector_size)) {sd_printk (KERN_ERR , sdkp,"Too big for this kernel. Use a " "kernel compiled with support for large block " "devices.\n" );
drivers/scsi/sr.c +4 -2
@@ -815,6 +815,7 @@ static void get_capabilities(struct scsi_cd *cd)unsigned char *buffer;struct scsi_mode_data data;struct scsi_sense_hdr sshdr; +unsigned int ms_len =128 ;int rc, n; static const char *loadmech[] =
@@ -841,10 +842,11 @@ static void get_capabilities(struct scsi_cd *cd)scsi_test_unit_ready (cd->device,SR_TIMEOUT ,MAX_RETRIES , &sshdr);/* ask for mode page 0x2a */ - rc =scsi_mode_sense (cd->device,0 ,0x2a , buffer,128 , + rc =scsi_mode_sense (cd->device,0 ,0x2a , buffer, ms_len,SR_TIMEOUT ,3 , &data,NULL ); -if (!scsi_status_is_good (rc)) { +if (!scsi_status_is_good (rc) || data.length > ms_len || + data.header_length + data.block_descriptor_length > data.length) {/* failed, drive doesn't have capabilities mode page */ cd->cdi.speed =1 ; cd->cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R |
drivers/target/iscsi/iscsi_target_parameters.c +0 -16
@@ -761,22 +761,6 @@ static void iscsi_check_proposer_for_optional_reply(struct iscsi_param *param)if (!strcmp (param->name,MAXRECVDATASEGMENTLENGTH ))SET_PSTATE_REPLY_OPTIONAL (param);/* -* The GlobalSAN iSCSI Initiator for MacOSX does -* not respond to MaxBurstLength, FirstBurstLength, -* DefaultTime2Wait or DefaultTime2Retain parameter keys. -* So, we set them to 'reply optional' here, and assume the -* the defaults from iscsi_parameters.h if the initiator -* is not RFC compliant and the keys are not negotiated. -*/ -if (!strcmp (param->name,MAXBURSTLENGTH )) -SET_PSTATE_REPLY_OPTIONAL (param); -if (!strcmp (param->name,FIRSTBURSTLENGTH )) -SET_PSTATE_REPLY_OPTIONAL (param); -if (!strcmp (param->name,DEFAULTTIME2WAIT )) -SET_PSTATE_REPLY_OPTIONAL (param); -if (!strcmp (param->name,DEFAULTTIME2RETAIN )) -SET_PSTATE_REPLY_OPTIONAL (param); -/* * Required for gPXE iSCSI boot client */ if (!strcmp (param->name,MAXCONNECTIONS ))
drivers/tty/serial/mxs-auart.c +7 -3
@@ -76,6 +76,8 @@#define AUART_CTRL2_TXE (1 << 8)#define AUART_CTRL2_UARTEN (1 << 0) +#define AUART_LINECTRL_BAUD_DIV_MAX 0x003fffc0 +#define AUART_LINECTRL_BAUD_DIV_MIN 0x000000ec#define AUART_LINECTRL_BAUD_DIVINT_SHIFT 16#define AUART_LINECTRL_BAUD_DIVINT_MASK 0xffff0000#define AUART_LINECTRL_BAUD_DIVINT (v) (((v) & 0xffff) << 16)
@@ -285,7 +287,7 @@ static void mxs_auart_settermios(struct uart_port *u, struct ktermios *old) {u32 bm, ctrl, ctrl2, div; -unsigned int cflag, baud; +unsigned int cflag, baud, baud_min, baud_max; cflag = termios->c_cflag;
@@ -361,8 +363,10 @@ static void mxs_auart_settermios(struct uart_port *u, ctrl2 &= ~AUART_CTRL2_CTSEN ;/* set baud rate */ - baud =uart_get_baud_rate (u, termios, old,0 , u->uartclk); - div = u->uartclk *32 / baud; + baud_min =DIV_ROUND_UP (u->uartclk *32 ,AUART_LINECTRL_BAUD_DIV_MAX ); + baud_max = u->uartclk *32 /AUART_LINECTRL_BAUD_DIV_MIN ; + baud =uart_get_baud_rate (u, termios, old, baud_min, baud_max); + div =DIV_ROUND_CLOSEST (u->uartclk *32 , baud); ctrl |=AUART_LINECTRL_BAUD_DIVFRAC (div &0x3F ); ctrl |=AUART_LINECTRL_BAUD_DIVINT (div >>6 );
drivers/usb/class/usbtmc.c +8 -1
@@ -1007,7 +1007,7 @@ static int usbtmc_probe(struct usb_interface *intf,dev_dbg (&intf->dev,"%s called\n" , __func__); - data =kmalloc (sizeof (struct usbtmc_device_data ),GFP_KERNEL ); + data =kzalloc (sizeof (struct usbtmc_device_data ),GFP_KERNEL );if (!data) {dev_err (&intf->dev,"Unable to allocate kernel memory\n" );return -ENOMEM ;
@@ -1053,6 +1053,12 @@ static int usbtmc_probe(struct usb_interface *intf, } } +if (!data->bulk_out || !data->bulk_in) { +dev_err (&intf->dev,"bulk endpoints not found\n" ); + retcode = -ENODEV ; + goto err_put; + } + retcode =get_capabilities (data);if (retcode)dev_err (&intf->dev,"can't read capabilities\n" );
@@ -1076,6 +1082,7 @@ static int usbtmc_probe(struct usb_interface *intf, error_register:sysfs_remove_group (&intf->dev.kobj, &capability_attr_grp);sysfs_remove_group (&intf->dev.kobj, &data_attr_grp); +err_put:kref_put (&data->kref, usbtmc_delete);return retcode; }
drivers/usb/core/config.c +10 -0
@@ -247,6 +247,16 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,/* * Adjust bInterval for quirked devices. +*/ +/* +* This quirk fixes bIntervals reported in ms. +*/ +if (to_usb_device (ddev)->quirks & +USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL ) { + n =clamp (fls (d->bInterval) +3 , i, j); + i = j = n; + } +/* * This quirk fixes bIntervals reported in * linear microframes. */
drivers/usb/core/quirks.c +8 -0
@@ -147,6 +147,14 @@ static const struct usb_device_id usb_quirk_list[] = {/* M-Systems Flash Disk Pioneers */ { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Baum Vario Ultra */ + { USB_DEVICE(0x0904, 0x6101), .driver_info = + USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL }, + { USB_DEVICE(0x0904, 0x6102), .driver_info = + USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL }, + { USB_DEVICE(0x0904, 0x6103), .driver_info = + USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL }, + /* Keytouch QWERTY Panel keyboard */ { USB_DEVICE(0x0926, 0x3333), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
drivers/usb/dwc3/gadget.h +7 -7
@@ -48,23 +48,23 @@ struct dwc3;#define gadget_to_dwc (g) (container_of(g, struct dwc3, gadget))/* DEPCFG parameter 1 */ -#define DWC3_DEPCFG_INT_NUM (n) ((n) << 0) +#define DWC3_DEPCFG_INT_NUM (n) (((n) & 0x1f) << 0)#define DWC3_DEPCFG_XFER_COMPLETE_EN (1 << 8)#define DWC3_DEPCFG_XFER_IN_PROGRESS_EN (1 << 9)#define DWC3_DEPCFG_XFER_NOT_READY_EN (1 << 10)#define DWC3_DEPCFG_FIFO_ERROR_EN (1 << 11)#define DWC3_DEPCFG_STREAM_EVENT_EN (1 << 13) -#define DWC3_DEPCFG_BINTERVAL_M1 (n) ((n) << 16) +#define DWC3_DEPCFG_BINTERVAL_M1 (n) (((n) & 0xff) << 16)#define DWC3_DEPCFG_STREAM_CAPABLE (1 << 24) -#define DWC3_DEPCFG_EP_NUMBER (n) ((n) << 25) +#define DWC3_DEPCFG_EP_NUMBER (n) (((n) & 0x1f) << 25)#define DWC3_DEPCFG_BULK_BASED (1 << 30)#define DWC3_DEPCFG_FIFO_BASED (1 << 31)/* DEPCFG parameter 0 */ -#define DWC3_DEPCFG_EP_TYPE (n) ((n) << 1) -#define DWC3_DEPCFG_MAX_PACKET_SIZE (n) ((n) << 3) -#define DWC3_DEPCFG_FIFO_NUMBER (n) ((n) << 17) -#define DWC3_DEPCFG_BURST_SIZE (n) ((n) << 22) +#define DWC3_DEPCFG_EP_TYPE (n) (((n) & 0x3) << 1) +#define DWC3_DEPCFG_MAX_PACKET_SIZE (n) (((n) & 0x7ff) << 3) +#define DWC3_DEPCFG_FIFO_NUMBER (n) (((n) & 0x1f) << 17) +#define DWC3_DEPCFG_BURST_SIZE (n) (((n) & 0xf) << 22)#define DWC3_DEPCFG_DATA_SEQ_NUM (n) ((n) << 26)#define DWC3_DEPCFG_IGN_SEQ_NUM (1 << 31)
drivers/usb/gadget/f_acm.c +3 -1
@@ -497,13 +497,15 @@ static int acm_notify_serial_state(struct f_acm *acm) {struct usb_composite_dev *cdev = acm->port.func.config->cdev;int status; +__le16 serial_state;spin_lock (&acm->lock);if (acm->notify_req) {DBG (cdev,"acm ttyGS%d serial state %04x\n" , acm->port_num, acm->serial_state); + serial_state =cpu_to_le16 (acm->serial_state); status =acm_cdc_notify (acm,USB_CDC_NOTIFY_SERIAL_STATE , -0 , &acm->serial_state,sizeof (acm->serial_state)); +0 , &serial_state,sizeof (acm->serial_state)); }else { acm->pending = true; status =0 ;
drivers/usb/host/xhci.c +31 -25
86 lines not on this page · raw message
drivers/usb/misc/idmouse.c +3 -0
@@ -346,6 +346,9 @@ static int idmouse_probe(struct usb_interface *interface,if (iface_desc->desc.bInterfaceClass !=0x0A )return -ENODEV ; +if (iface_desc->desc.bNumEndpoints <1 ) +return -ENODEV ; +/* allocate memory for our device state and initialize it */ dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (dev ==NULL )
drivers/usb/misc/iowarrior.c +8 -0
@@ -809,6 +809,14 @@ static int iowarrior_probe(struct usb_interface *interface, goto error; } +if (dev->product_id ==USB_DEVICE_ID_CODEMERCS_IOW56 ) { +if (!dev->int_out_endpoint) { +dev_err (&interface->dev,"no interrupt-out endpoint found\n" ); + retval = -ENODEV ; + goto error; + } + } +/* we have to check the report_size often, so remember it in the endianess suitable for our machine */ dev->report_size =usb_endpoint_maxp (dev->int_in_endpoint); if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&
drivers/usb/misc/uss720.c +5 -0
@@ -704,6 +704,11 @@ static int uss720_probe(struct usb_interface *intf, interface = intf->cur_altsetting; +if (interface->desc.bNumEndpoints <3 ) { +usb_put_dev (usbdev); +return -ENODEV ; + } +/* * Allocate parport interface */
drivers/usb/serial/io_ti.c +6 -0
@@ -1681,6 +1681,12 @@ static void edge_interrupt_callback(struct urb *urb) function =TIUMP_GET_FUNC_FROM_CODE (data[0 ]);dbg ("%s - port_number %d, function %d, info 0x%x" , __func__, port_number, function, data[1 ]); + +if (port_number >= edge_serial->serial->num_ports) { +dev_err (&urb->dev->dev,"bad port number %d\n" , port_number); + goto exit; + } + port = edge_serial->serial->port[port_number]; edge_port =usb_get_serial_port_data (port);if (!edge_port) {
drivers/usb/serial/option.c +16 -1
@@ -234,6 +234,14 @@ static void option_instat_callback(struct urb *urb);#define BANDRICH_PRODUCT_1012 0x1012#define QUALCOMM_VENDOR_ID 0x05C6 +/* These Quectel products use Qualcomm's vendor ID */ +#define QUECTEL_PRODUCT_UC20 0x9003 +#define QUECTEL_PRODUCT_UC15 0x9090 + +#define QUECTEL_VENDOR_ID 0x2c7c +/* These Quectel products use Quectel's vendor ID */ +#define QUECTEL_PRODUCT_EC21 0x0121 +#define QUECTEL_PRODUCT_EC25 0x0125#define CMOTECH_VENDOR_ID 0x16d8#define CMOTECH_PRODUCT_6001 0x6001
@@ -1147,7 +1155,14 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ - { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003), /* Quectel UC20 */ +/* Quectel products using Qualcomm vendor ID */ + { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, + { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, +/* Quectel products using Quectel vendor ID */ + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
drivers/usb/serial/safe_serial.c +5 -0
@@ -232,6 +232,11 @@ static void safe_process_read_urb(struct urb *urb)if (!safe) goto out; +if (length <2 ) { +dev_err (&port->dev,"malformed packet\n" ); +return ; + } + fcs =fcs_compute10 (data, length,CRC10_INITFCS );if (fcs) {dev_err (&port->dev,"%s - bad CRC %x\n" , __func__, fcs);
drivers/usb/wusbcore/wa-hc.c +3 -0
@@ -38,6 +38,9 @@ int wa_create(struct wahc *wa, struct usb_interface *iface)int result;struct device *dev = &iface->dev; +if (iface->cur_altsetting->desc.bNumEndpoints <3 ) +return -ENODEV ; + result =wa_rpipes_create (wa);if (result <0 ) goto error_rpipes_create;
drivers/uwb/hwa-rc.c +3 -0
@@ -811,6 +811,9 @@ static int hwarc_probe(struct usb_interface *iface,struct hwarc *hwarc;struct device *dev = &iface->dev; +if (iface->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + result = -ENOMEM ; uwb_rc =uwb_rc_alloc ();if (uwb_rc ==NULL ) {
drivers/uwb/i1480/dfu/usb.c +3 -0
@@ -362,6 +362,9 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) result); } +if (iface->cur_altsetting->desc.bNumEndpoints <1 ) +return -ENODEV ; + result = -ENOMEM ; i1480_usb =kzalloc (sizeof (*i1480_usb),GFP_KERNEL );if (i1480_usb ==NULL ) {
drivers/video/xen-fbfront.c +2 -2
@@ -640,7 +640,6 @@ static void xenfb_backend_changed(struct xenbus_device *dev,break ;case XenbusStateInitWait: -InitWait:xenbus_switch_state (dev, XenbusStateConnected);break ;
@@ -651,7 +650,8 @@ static void xenfb_backend_changed(struct xenbus_device *dev,* get Connected twice here. */ if (dev->state != XenbusStateConnected) - goto InitWait;/* no InitWait seen yet, fudge it */ +/* no InitWait seen yet, fudge it */ +xenbus_switch_state (dev, XenbusStateConnected);if (xenbus_scanf (XBT_NIL , info->xbdev->otherend,"request-update" ,"%d" , &val) <0 )
drivers/virtio/virtio_balloon.c +4 -0
@@ -180,12 +180,14 @@ static void update_balloon_stats(struct virtio_balloon *vb)all_vm_events (events);si_meminfo (&i); +#ifdef CONFIG_VM_EVENT_COUNTERS update_stat (vb, idx++,VIRTIO_BALLOON_S_SWAP_IN ,pages_to_bytes (events[PSWPIN ]));update_stat (vb, idx++,VIRTIO_BALLOON_S_SWAP_OUT ,pages_to_bytes (events[PSWPOUT ]));update_stat (vb, idx++,VIRTIO_BALLOON_S_MAJFLT , events[PGMAJFAULT ]);update_stat (vb, idx++,VIRTIO_BALLOON_S_MINFLT , events[PGFAULT ]); +#endif update_stat (vb, idx++,VIRTIO_BALLOON_S_MEMFREE ,pages_to_bytes (i.freeram)); update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMTOT,
@@ -320,6 +322,8 @@ static int virtballoon_probe(struct virtio_device *vdev)* Prime this virtqueue with one buffer so the hypervisor can * use it to signal us later. */ +update_balloon_stats (vb); +sg_init_one (&sg, vb->stats,sizeof vb->stats);if (virtqueue_add_buf (vb->stats_vq, &sg,1 ,0 , vb) <0 )BUG ();
fs/exec.c +24 -4
@@ -208,8 +208,26 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,if (write) {unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; +unsigned long ptr_size;struct rlimit *rlim; +/* +* Since the stack will hold pointers to the strings, we +* must account for them as well. +* +* The size calculation is the entire vma while each arg page is +* built, so each time we get here it's calculating how far it +* is currently (rather than each call being just the newly +* added size from the arg page). As a result, we need to +* always add the entire size of the pointers, so that on the +* last call to get_arg_page() we'll actually have the entire +* correct size. +*/ + ptr_size = (bprm->argc + bprm->envc) *sizeof (void *); +if (ptr_size >ULONG_MAX - size) + goto fail; + size += ptr_size; +acct_arg_size (bprm, size /PAGE_SIZE );/*
@@ -227,13 +245,15 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,* to work from. */ rlim = current->signal->rlim; -if (size >ACCESS_ONCE (rlim[RLIMIT_STACK ].rlim_cur) /4 ) { -put_page (page); -return NULL ; - } +if (size >ACCESS_ONCE (rlim[RLIMIT_STACK ].rlim_cur) /4 ) + goto fail; }return page; + +fail: +put_page (page); +return NULL ; }static void put_arg_page (struct page *page)
include/linux/skbuff.h +7 -0
@@ -1926,6 +1926,13 @@ static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int lenskb_headroom (skb) + len <= skb->hdr_len; } +static inline int skb_try_make_writable (struct sk_buff *skb, +unsigned int write_len) +{ +return skb_cloned (skb) && !skb_clone_writable (skb, write_len) && +pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ); +} +static inline int __skb_cow (struct sk_buff *skb,unsigned int headroom,int cloned) {
include/linux/usb/quirks.h +6 -0
@@ -44,4 +44,10 @@/* device generates spurious wakeup, ignore remote wakeup capability */ #define USB_QUIRK_IGNORE_REMOTE_WAKEUP 0x00000200 +/* +* Device reports its bInterval as linear frames instead of the +* USB 2.0 calculation. +*/ +#define USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL BIT(11) +#endif /* __LINUX_USB_QUIRKS_H */
include/trace/events/syscalls.h +1 -0
@@ -1,5 +1,6 @@#undef TRACE_SYSTEM#define TRACE_SYSTEM raw_syscalls +#undef TRACE_INCLUDE_FILE#define TRACE_INCLUDE_FILE syscalls#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ )
kernel/events/core.c +3 -2
@@ -7273,7 +7273,7 @@ int perf_event_init_context(struct task_struct *child, int ctxn) ret =inherit_task_group (event, parent, parent_ctx, child, ctxn, &inherited_all);if (ret) -break ; + goto out_unlock; }/*
@@ -7289,7 +7289,7 @@ int perf_event_init_context(struct task_struct *child, int ctxn) ret =inherit_task_group (event, parent, parent_ctx, child, ctxn, &inherited_all);if (ret) -break ; + goto out_unlock; }raw_spin_lock_irqsave (&parent_ctx->lock, flags);
@@ -7317,6 +7317,7 @@ int perf_event_init_context(struct task_struct *child, int ctxn) }raw_spin_unlock_irqrestore (&parent_ctx->lock, flags); +out_unlock:mutex_unlock (&parent_ctx->mutex);perf_unpin_context (parent_ctx);
kernel/futex.c +13 -9
@@ -2410,7 +2410,6 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, {struct hrtimer_sleeper timeout, *to =NULL ;struct rt_mutex_waiter rt_waiter; -struct rt_mutex *pi_mutex =NULL ;struct futex_hash_bucket *hb;union futex_key key2 =FUTEX_KEY_INIT ;struct futex_q q = futex_q_init;
@@ -2492,6 +2491,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,if (q.pi_state && (q.pi_state->owner != current)) {spin_lock (q.lock_ptr); ret =fixup_pi_state_owner (uaddr2, &q, current); +if (ret &&rt_mutex_owner (&q.pi_state->pi_mutex) == current) +rt_mutex_unlock (&q.pi_state->pi_mutex);/* * Drop the reference to the pi state which * the requeue_pi() code acquired for us.
@@ -2500,6 +2501,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,spin_unlock (q.lock_ptr); } }else { +struct rt_mutex *pi_mutex; +/* * We have been woken up by futex_unlock_pi(), a timeout, or a * signal. futex_unlock_pi() will not destroy the lock_ptr nor
@@ -2523,18 +2526,19 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,if (res) ret = (res <0 ) ? res :0 ; +/* +* If fixup_pi_state_owner() faulted and was unable to handle +* the fault, unlock the rt_mutex and return the fault to +* userspace. +*/ +if (ret &&rt_mutex_owner (pi_mutex) == current) +rt_mutex_unlock (pi_mutex); +/* Unqueue and drop the lock. */ unqueue_me_pi (&q); } -/* -* If fixup_pi_state_owner() faulted and was unable to handle the -* fault, unlock the rt_mutex and return the fault to userspace. -*/ -if (ret == -EFAULT ) { -if (pi_mutex &&rt_mutex_owner (pi_mutex) == current) -rt_mutex_unlock (pi_mutex); - }else if (ret == -EINTR ) { +if (ret == -EINTR ) {/* * We've already been requeued, but cannot restart by calling * futex_lock_pi() directly. We could restart this syscall, but
kernel/ptrace.c +10 -4
@@ -148,11 +148,17 @@ static void ptrace_unfreeze_traced(struct task_struct *task)WARN_ON (!task->ptrace || task->parent != current); +/* +* PTRACE_LISTEN can allow ptrace_trap_notify to wake us up remotely. +* Recheck state under the lock to close this race. +*/ spin_lock_irq (&task->sighand->siglock); -if (__fatal_signal_pending (task)) -wake_up_state (task, __TASK_TRACED); -else - task->state =TASK_TRACED ; +if (task->state == __TASK_TRACED) { +if (__fatal_signal_pending (task)) +wake_up_state (task, __TASK_TRACED); +else + task->state =TASK_TRACED ; + }spin_unlock_irq (&task->sighand->siglock); }
kernel/sched.c +2 -2
@@ -3617,8 +3617,9 @@ void calc_load_exit_idle(void)struct rq *this_rq =this_rq ();/* -* If we're still before the sample window, we're done. +* If we're still before the pending sample window, we're done. */ + this_rq->calc_load_update = calc_load_update;if (time_before (jiffies, this_rq->calc_load_update))return ;
@@ -3627,7 +3628,6 @@ void calc_load_exit_idle(void)* accounted through the nohz accounting, so skip the entire deal and * sync up for the next window. */ - this_rq->calc_load_update = calc_load_update;if (time_before (jiffies, this_rq->calc_load_update +10 )) this_rq->calc_load_update +=LOAD_FREQ ; }
kernel/trace/ring_buffer.c +14 -2
@@ -2879,11 +2879,23 @@ EXPORT_SYMBOL_GPL(ring_buffer_iter_reset);int ring_buffer_iter_empty (struct ring_buffer_iter *iter) {struct ring_buffer_per_cpu *cpu_buffer; +struct buffer_page *reader; +struct buffer_page *head_page; +struct buffer_page *commit_page; +unsigned commit; cpu_buffer = iter->cpu_buffer; -return iter->head_page == cpu_buffer->commit_page && - iter->head ==rb_commit_index (cpu_buffer); +/* Remember, trace recording is off when iterator is in use */ + reader = cpu_buffer->reader_page; + head_page = cpu_buffer->head_page; + commit_page = cpu_buffer->commit_page; + commit =rb_page_commit (commit_page); + +return ((iter->head_page == commit_page && iter->head == commit) || + (iter->head_page == reader && commit_page == head_page && + head_page->read == commit && + iter->head ==rb_page_commit (cpu_buffer->reader_page))); }EXPORT_SYMBOL_GPL (ring_buffer_iter_empty);
net/9p/client.c +4 -0
@@ -2056,6 +2056,10 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)trace_9p_protocol_dump (clnt, req->rc); goto free_and_error; } +if (rsize < count) { +pr_err ("bogus RREADDIR count (%d > %d)\n" , count, rsize); + count = rsize; + }P9_DPRINTK (P9_DEBUG_9P ,"<<< RREADDIR count %d\n" , count);
net/ipv4/ip_output.c +1 -1
@@ -834,7 +834,7 @@ static int __ip_append_data(struct sock *sk, cork->length += length;if (((length > mtu) || (skb &&skb_has_frags (skb))) && (sk->sk_protocol ==IPPROTO_UDP ) && - (rt->dst.dev->features &NETIF_F_UFO ) && !rt->dst.header_len && + (rt->dst.dev->features &NETIF_F_UFO ) && !dst_xfrm (&rt->dst) && (sk->sk_type ==SOCK_DGRAM )) { err = ip_ufo_append_data(sk, queue, getfrag, from, length, hh_len, fragheaderlen, transhdrlen,
net/ipv4/netfilter/nf_nat_snmp_basic.c +1 -18
@@ -1261,16 +1261,6 @@ static const struct nf_conntrack_expect_policy snmp_exp_policy = { .timeout = 180, }; -static struct nf_conntrack_helper snmp_helper__read_mostly = { - .me =THIS_MODULE , - .help = help, - .expect_policy = &snmp_exp_policy, - .name ="snmp" , - .tuple.src.l3num =AF_INET , - .tuple.src.u.udp.port =cpu_to_be16 (SNMP_PORT ), - .tuple.dst.protonum =IPPROTO_UDP , -}; -static struct nf_conntrack_helper snmp_trap_helper__read_mostly = { .me =THIS_MODULE , .help = help,
@@ -1289,17 +1279,10 @@ static struct nf_conntrack_helper snmp_trap_helper __read_mostly = {static int __init nf_nat_snmp_basic_init (void ) { -int ret =0 ; -BUG_ON (nf_nat_snmp_hook !=NULL );RCU_INIT_POINTER (nf_nat_snmp_hook, help); - ret =nf_conntrack_helper_register (&snmp_trap_helper); -if (ret <0 ) { -nf_conntrack_helper_unregister (&snmp_helper); -return ret; - } -return ret; +return nf_conntrack_helper_register (&snmp_trap_helper); } static void __exit nf_nat_snmp_basic_fini(void)
net/ipv6/ip6_output.c +1 -1
@@ -1343,7 +1343,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,if (((length > mtu) || (skb &&skb_has_frags (skb))) && (sk->sk_protocol ==IPPROTO_UDP ) && - (rt->dst.dev->features &NETIF_F_UFO ) && !rt->dst.header_len && + (rt->dst.dev->features &NETIF_F_UFO ) && !dst_xfrm (&rt->dst) && (sk->sk_type ==SOCK_DGRAM )) { err = ip6_ufo_append_data(sk, getfrag, from, length, hh_len, fragheaderlen, exthdrlen,
net/ipv6/route.c +2 -0
@@ -2384,6 +2384,8 @@ static int rt6_fill_node(struct net *net, rtm->rtm_type =RTN_UNREACHABLE ; else if (rt->rt6i_flags&RTF_LOCAL) rtm->rtm_type = RTN_LOCAL; + else if (rt->rt6i_flags & RTF_ANYCAST) + rtm->rtm_type = RTN_ANYCAST; else if (rt->rt6i_dev && (rt->rt6i_dev->flags&IFF_LOOPBACK)) rtm->rtm_type = RTN_LOCAL; else
net/key/af_key.c +35 -7
104 lines not on this page · raw message
net/l2tp/l2tp_core.c +128 -34
257 lines not on this page · raw message
net/l2tp/l2tp_core.h +7 -2
@@ -222,9 +222,14 @@ static inline struct l2tp_tunnel *l2tp_sock_to_tunnel(struct sock *sk)return tunnel; } +struct l2tp_session *l2tp_session_get (struct net *net, +struct l2tp_tunnel *tunnel, +u32 session_id,bool do_ref);extern struct l2tp_session *l2tp_session_find (struct net *net,struct l2tp_tunnel *tunnel,u32 session_id); -extern struct l2tp_session *l2tp_session_find_nth (struct l2tp_tunnel *tunnel,int nth); -extern struct l2tp_session *l2tp_session_find_by_ifname (struct net *net,char *ifname); +struct l2tp_session *l2tp_session_get_nth (struct l2tp_tunnel *tunnel,int nth, +bool do_ref); +struct l2tp_session *l2tp_session_get_by_ifname (struct net *net,char *ifname, +bool do_ref);extern struct l2tp_tunnel *l2tp_tunnel_find (struct net *net,u32 tunnel_id);extern struct l2tp_tunnel *l2tp_tunnel_find_nth (struct net *net,int nth);
net/l2tp/l2tp_debugfs.c +7 -3
@@ -51,7 +51,7 @@ static void l2tp_dfs_next_tunnel(struct l2tp_dfs_seq_data *pd)static void l2tp_dfs_next_session (struct l2tp_dfs_seq_data *pd) { - pd->session =l2tp_session_find_nth (pd->tunnel, pd->session_idx); + pd->session =l2tp_session_get_nth (pd->tunnel, pd->session_idx, true); pd->session_idx++;if (pd->session ==NULL ) {
@@ -227,10 +227,14 @@ static int l2tp_dfs_seq_show(struct seq_file *m, void *v) }/* Show the tunnel or session context */ -if (pd->session ==NULL ) +if (!pd->session) {l2tp_dfs_seq_tunnel_show (m, pd->tunnel); -else + }else {l2tp_dfs_seq_session_show (m, pd->session); +if (pd->session->deref) + pd->session->deref (pd->session); +l2tp_session_dec_refcount (pd->session); + } out:return 0 ;
net/l2tp/l2tp_eth.c +2 -8
@@ -200,12 +200,6 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p goto out; } - session =l2tp_session_find (net, tunnel, session_id); -if (session) { - rc = -EEXIST ; - goto out; - } -if (cfg->ifname) { dev =dev_get_by_name (net, cfg->ifname);if (dev) {
@@ -219,8 +213,8 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p session =l2tp_session_create (sizeof (*spriv), tunnel, session_id, peer_session_id, cfg); -if (!session) { - rc = -ENOMEM ; +if (IS_ERR (session)) { + rc =PTR_ERR (session); goto out; }
net/l2tp/l2tp_ip.c +12 -5
@@ -148,19 +148,19 @@ static int l2tp_ip_recv(struct sk_buff *skb) }/* Ok, this is a data packet. Lookup the session. */ - session =l2tp_session_find (&init_net,NULL , session_id); -if (session ==NULL ) + session =l2tp_session_get (&init_net,NULL , session_id, true); +if (!session) goto discard; tunnel = session->tunnel; -if (tunnel ==NULL ) - goto discard; +if (!tunnel) + goto discard_sess;/* Trace packet contents, if enabled */ if (tunnel->debug &L2TP_MSG_DATA ) { length =min (32u , skb->len);if (!pskb_may_pull (skb, length)) - goto discard; + goto discard_sess;/* Point to L2TP header */ optr = ptr = skb->data;
@@ -176,6 +176,7 @@ static int l2tp_ip_recv(struct sk_buff *skb) }l2tp_recv_common (session, skb, ptr, optr,0 , skb->len, tunnel->recv_payload_hook); +l2tp_session_dec_refcount (session);return 0 ;
@@ -211,6 +212,12 @@ static int l2tp_ip_recv(struct sk_buff *skb)return sk_receive_skb (sk, skb,1 ); +discard_sess: +if (session->deref) + session->deref (session); +l2tp_session_dec_refcount (session); + goto discard; + discard_put:sock_put (sk);
net/l2tp/l2tp_netlink.c +31 -15
122 lines not on this page · raw message
net/l2tp/l2tp_ppp.c +53 -41
169 lines not on this page · raw message
net/mac80211/rx.c +24 -0
@@ -2842,6 +2842,30 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, sdata->vif.p2p))return 0 ; status->rx_flags &= ~IEEE80211_RX_RA_MATCH ; + }else { +/* +* 802.11-2016 Table 9-26 says that for data frames, +* A1 must be the BSSID - we've checked that already +* but may have accepted the wildcard +* (ff:ff:ff:ff:ff:ff). +* +* It also says: +* The BSSID of the Data frame is determined as +* follows: +* a) If the STA is contained within an AP or is +* associated with an AP, the BSSID is the +* address currently in use by the STA +* contained in the AP. +* +* So we should not accept data frames with an address +* that's multicast. +* +* Accepting it also opens a security problem because +* stations could encrypt it with the GTK and inject +* traffic that way. +*/ +if (ieee80211_is_data (hdr->frame_control) && multicast) +return 0 ; }break ;case NL80211_IFTYPE_WDS :
net/sched/act_csum.c +2 -6
@@ -122,9 +122,7 @@ static void *tcf_csum_skb_nextlayer(struct sk_buff *skb,int hl = ihl + jhl;if (!pskb_may_pull (skb, ipl + ntkoff) || (ipl < hl) || - (skb_cloned (skb) && - !skb_clone_writable (skb, hl + ntkoff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ))) +skb_try_make_writable (skb, hl + ntkoff))return NULL ;else return (void *)(skb_network_header (skb) + ihl);
@@ -372,9 +370,7 @@ static int tcf_csum_ipv4(struct sk_buff *skb, u32 update_flags) }if (update_flags &TCA_CSUM_UPDATE_FLAG_IPV4HDR ) { -if (skb_cloned (skb) && - !skb_clone_writable (skb,sizeof (*iph) + ntkoff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_try_make_writable (skb,sizeof (*iph) + ntkoff)) goto fail;ip_send_check (iph);
net/sched/act_nat.c +5 -13
@@ -144,9 +144,7 @@ static int tcf_nat(struct sk_buff *skb, const struct tc_action *a, addr = iph->daddr;if (!((old_addr ^ addr) & mask)) { -if (skb_cloned (skb) && - !skb_clone_writable (skb,sizeof (*iph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_try_make_writable (skb,sizeof (*iph) + noff)) goto drop; new_addr &= mask;
@@ -174,9 +172,7 @@ static int tcf_nat(struct sk_buff *skb, const struct tc_action *a,struct tcphdr *tcph;if (!pskb_may_pull (skb, ihl +sizeof (*tcph) + noff) || - (skb_cloned (skb) && - !skb_clone_writable (skb, ihl +sizeof (*tcph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ))) +skb_try_make_writable (skb, ihl +sizeof (*tcph) + noff)) goto drop; tcph = (void *)(skb_network_header (skb) + ihl);
@@ -188,9 +184,7 @@ static int tcf_nat(struct sk_buff *skb, const struct tc_action *a,struct udphdr *udph;if (!pskb_may_pull (skb, ihl +sizeof (*udph) + noff) || - (skb_cloned (skb) && - !skb_clone_writable (skb, ihl +sizeof (*udph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC ))) +skb_try_make_writable (skb, ihl +sizeof (*udph) + noff)) goto drop; udph = (void *)(skb_network_header (skb) + ihl);
@@ -230,10 +224,8 @@ static int tcf_nat(struct sk_buff *skb, const struct tc_action *a,if ((old_addr ^ addr) & mask)break ; -if (skb_cloned (skb) && - !skb_clone_writable (skb, ihl +sizeof (*icmph) + -sizeof (*iph) + noff) && -pskb_expand_head (skb,0 ,0 ,GFP_ATOMIC )) +if (skb_try_make_writable (skb, ihl +sizeof (*icmph) + +sizeof (*iph) + noff)) goto drop; icmph = (void *)(skb_network_header (skb) + ihl);
net/sched/sch_dsmark.c +8 -2
@@ -202,9 +202,13 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)pr_debug ("dsmark_enqueue(skb %p,sch %p,[qdisc %p])\n" , skb, sch, p);if (p->set_tc_index) { +int wlen =skb_network_offset (skb); +switch (skb->protocol) {case htons (ETH_P_IP ): -if (skb_cow_head (skb,sizeof (struct iphdr ))) + wlen +=sizeof (struct iphdr ); +if (!pskb_may_pull (skb, wlen) || +skb_try_make_writable (skb, wlen)) goto drop; skb->tc_index =ipv4_get_dsfield (ip_hdr (skb))
@@ -212,7 +216,9 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)break ;case htons (ETH_P_IPV6 ): -if (skb_cow_head (skb,sizeof (struct ipv6hdr ))) + wlen +=sizeof (struct ipv6hdr ); +if (!pskb_may_pull (skb, wlen) || +skb_try_make_writable (skb, wlen)) goto drop; skb->tc_index =ipv6_get_dsfield (ipv6_hdr (skb))
net/unix/garbage.c +9 -9
@@ -150,6 +150,7 @@ void unix_notinflight(struct user_struct *user, struct file *fp)if (s) {struct unix_sock *u =unix_sk (s); +BUG_ON (!atomic_long_read (&u->inflight));BUG_ON (list_empty (&u->link));if (atomic_long_dec_and_test (&u->inflight))list_del_init (&u->link);
@@ -356,6 +357,14 @@ void unix_gc(void) }list_del (&cursor); +/* Now gc_candidates contains only garbage. Restore original +* inflight counters for these as well, and remove the skbuffs +* which are creating the cycle(s). +*/ +skb_queue_head_init (&hitlist); +list_for_each_entry (u, &gc_candidates, link) +scan_children (&u->sk, inc_inflight, &hitlist); +/* * not_cycle_list contains those sockets which do not make up a * cycle. Restore these to the inflight list.
@@ -366,15 +375,6 @@ void unix_gc(void)list_move_tail (&u->link, &gc_inflight_list); } -/* -* Now gc_candidates contains only garbage. Restore original -* inflight counters for these as well, and remove the skbuffs -* which are creating the cycle(s). -*/ -skb_queue_head_init (&hitlist); -list_for_each_entry (u, &gc_candidates, link) -scan_children (&u->sk, inc_inflight, &hitlist); -spin_unlock (&unix_gc_lock);/* Here we are. Hitlist is filled. Die. */
security/keys/gc.c +1 -1
@@ -46,7 +46,7 @@ static unsigned long key_gc_flags;* immediately unlinked. */ struct key_type key_type_dead = { - .name ="dead" , + .name =".dead" , };/*
sound/core/seq/seq_clientmgr.c +1 -0
@@ -1909,6 +1909,7 @@ static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client, info.output_pool != client->pool->size)) {if (snd_seq_write_pool_allocated (client)) {/* remove all existing cells */ +snd_seq_pool_mark_closing (client->pool);snd_seq_queue_client_leave_cells (client->number);snd_seq_pool_done (client->pool); }
sound/core/seq/seq_fifo.c +7 -0
@@ -72,6 +72,9 @@ void snd_seq_fifo_delete(struct snd_seq_fifo **fifo)return ; *fifo =NULL ; +if (f->pool) +snd_seq_pool_mark_closing (f->pool); +snd_seq_fifo_clear (f);/* wake up clients if any */
@@ -264,6 +267,10 @@ int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize)/* NOTE: overflow flag is not cleared */ spin_unlock_irqrestore (&f->lock, flags); +/* close the old pool and wait until all users are gone */ +snd_seq_pool_mark_closing (oldpool); +snd_use_lock_sync (&f->use_lock); +/* release cells in old pool */ for (cell = oldhead; cell; cell = next) { next = cell->next;
sound/core/seq/seq_lock.c +3 -6
@@ -28,19 +28,16 @@/* wait until all locks are released */ void snd_use_lock_sync_helper (snd_use_lock_t *lockp,const char *file,int line) { -int max_count =5 *HZ ; +int warn_count =5 *HZ ;if (atomic_read (lockp) <0 ) {printk (KERN_WARNING "seq_lock: lock trouble [counter = %d] in %s:%d\n" ,atomic_read (lockp), file, line);return ; }while (atomic_read (lockp) >0 ) { -if (max_count ==0 ) { -snd_printk (KERN_WARNING "seq_lock: timeout [%d left] in %s:%d\n" ,atomic_read (lockp), file, line); -break ; - } +if (warn_count-- ==0 ) +pr_warn ("ALSA: seq_lock: waiting [%d left] in %s:%d\n" ,atomic_read (lockp), file, line);schedule_timeout_uninterruptible (1 ); - max_count--; } }
sound/core/seq/seq_memory.c +13 -4
@@ -416,6 +416,18 @@ int snd_seq_pool_init(struct snd_seq_pool *pool)return 0 ; } +/* refuse the further insertion to the pool */ +void snd_seq_pool_mark_closing (struct snd_seq_pool *pool) +{ +unsigned long flags; + +if (snd_BUG_ON (!pool)) +return ; +spin_lock_irqsave (&pool->lock, flags); + pool->closing =1 ; +spin_unlock_irqrestore (&pool->lock, flags); +} +/* remove events */ int snd_seq_pool_done (struct snd_seq_pool *pool) {
@@ -426,10 +438,6 @@ int snd_seq_pool_done(struct snd_seq_pool *pool)return -EINVAL ;/* wait for closing all threads */ -spin_lock_irqsave (&pool->lock, flags); - pool->closing =1 ; -spin_unlock_irqrestore (&pool->lock, flags); -if (waitqueue_active (&pool->output_sleep))wake_up (&pool->output_sleep);
@@ -488,6 +496,7 @@ int snd_seq_pool_delete(struct snd_seq_pool **ppool) *ppool =NULL ;if (pool ==NULL )return 0 ; +snd_seq_pool_mark_closing (pool);snd_seq_pool_done (pool);kfree (pool);return 0 ;
sound/core/seq/seq_memory.h +1 -0
@@ -84,6 +84,7 @@ static inline int snd_seq_total_cells(struct snd_seq_pool *pool)int snd_seq_pool_init (struct snd_seq_pool *pool);/* done pool - free events */ +void snd_seq_pool_mark_closing (struct snd_seq_pool *pool);int snd_seq_pool_done (struct snd_seq_pool *pool);/* create pool */
sound/core/timer.c +5 -2
@@ -1590,6 +1590,7 @@ static int snd_timer_user_tselect(struct file *file,if (err <0 ) goto __err; + tu->qhead = tu->qtail = tu->qused =0 ;kfree (tu->queue); tu->queue =NULL ;kfree (tu->tqueue);
@@ -1930,6 +1931,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, tu = file->private_data; unit = tu->tread ?sizeof (struct snd_timer_tread ) :sizeof (struct snd_timer_read ); +mutex_lock (&tu->ioctl_lock);spin_lock_irq (&tu->qlock);while ((long )count - result >= unit) {while (!tu->qused) {
@@ -1945,7 +1947,9 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,add_wait_queue (&tu->qchange_sleep, &wait);spin_unlock_irq (&tu->qlock); +mutex_unlock (&tu->ioctl_lock);schedule (); +mutex_lock (&tu->ioctl_lock);spin_lock_irq (&tu->qlock);remove_wait_queue (&tu->qchange_sleep, &wait);
@@ -1961,7 +1965,6 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, tu->qused--;spin_unlock_irq (&tu->qlock); -mutex_lock (&tu->ioctl_lock);if (tu->tread) {if (copy_to_user (buffer, &tu->tqueue[qhead],sizeof (struct snd_timer_tread )))
@@ -1971,7 +1974,6 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, sizeof(struct snd_timer_read))) err = -EFAULT ; } -mutex_unlock (&tu->ioctl_lock);spin_lock_irq (&tu->qlock);if (err <0 )
@@ -1981,6 +1983,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, } _error:spin_unlock_irq (&tu->qlock); +mutex_unlock (&tu->ioctl_lock);return result >0 ? result : err; }
sound/pci/ctxfi/cthw20k1.c +1 -1
@@ -1904,7 +1904,7 @@ static int hw_card_start(struct hw *hw)return err;/* Set DMA transfer mask */ -if (dma_set_mask (&pci->dev,DMA_BIT_MASK (dma_bits))) { +if (!dma_set_mask (&pci->dev,DMA_BIT_MASK (dma_bits))) {dma_set_coherent_mask (&pci->dev,DMA_BIT_MASK (dma_bits)); }else {dma_set_mask (&pci->dev,DMA_BIT_MASK (32 ));
tools/perf/util/symbol.c +1 -1
@@ -193,7 +193,7 @@ static void symbols__fixup_end(struct rb_root *symbols)/* Last entry */ if (curr->end == curr->start) - curr->end =roundup (curr->start,4096 ); + curr->end =roundup (curr->start,4096 ) +4096 ; }static void __map_groups__fixup_end (struct map_groups *mg,enum map_type type)
tools/power/cpupower/utils/helpers/cpuid.c +1 -0
@@ -156,6 +156,7 @@ int get_cpu_info(unsigned int cpu, struct cpupower_cpu_info *cpu_info)*/ case 0x2C :/* Westmere EP - Gulftown */ cpu_info->caps |=CPUPOWER_CAP_HAS_TURBO_RATIO ; +break ;case 0x2A :/* SNB */ case 0x2D :/* SNB Xeon */ cpu_info->caps |=CPUPOWER_CAP_HAS_TURBO_RATIO ;