Linux 3.18.53
Greg KH
maintainerI'm announcing the release of the 3.18.53 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/kernel/Makefile | 1 arch/arm/kernel/pj4-cp0.c | 4 + arch/powerpc/platforms/powernv/opal-wrappers.S | 2 arch/x86/kernel/kprobes/common.h | 2 arch/x86/kernel/kprobes/core.c | 6 +- arch/x86/kernel/kprobes/opt.c | 2 arch/x86/kernel/pci-calgary_64.c | 2 arch/x86/kvm/cpuid.c | 6 -- arch/x86/kvm/vmx.c | 2 arch/x86/platform/intel-mid/device_libs/platform_wdt.c | 2 drivers/gpu/drm/ttm/ttm_bo_vm.c | 12 ++++ drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | 23 ++------ drivers/net/wireless/mwifiex/debugfs.c | 3 - drivers/net/wireless/mwifiex/sta_ioctl.c | 2 drivers/power/bq24190_charger.c | 3 - drivers/staging/emxx_udc/emxx_udc.c | 4 - drivers/tty/sysrq.c | 19 ------ drivers/usb/host/ehci-exynos.c | 2 drivers/usb/host/ohci-exynos.c | 2 drivers/usb/serial/ark3116.c | 25 ++++++-- drivers/usb/serial/digi_acceleport.c | 38 ++++++++----- drivers/usb/serial/ftdi_sio.c | 7 +- drivers/usb/serial/io_edgeport.c | 48 +++++++++++------ drivers/usb/serial/keyspan_pda.c | 19 ++++-- drivers/usb/serial/mct_u232.c | 6 +- drivers/usb/serial/quatech2.c | 24 ++++---- drivers/usb/serial/ssu100.c | 31 ++++++++-- drivers/usb/serial/ti_usb_3410_5052.c | 12 +--- fs/9p/acl.c | 2 fs/f2fs/super.c | 7 ++ include/linux/f2fs_fs.h | 6 ++ include/linux/mtd/map.h | 12 +++- include/net/addrconf.h | 2 include/net/ip6_route.h | 1 net/ipv4/raw.c | 3 + net/ipv4/tcp_lp.c | 6 +- net/ipv4/tcp_output.c | 19 ++++-- net/ipv6/addrconf.c | 3 + net/ipv6/raw.c | 2 net/ipv6/route.c | 39 +++++++++---- tools/power/cpupower/utils/helpers/cpuid.c | 1 42 files changed, 264 insertions(+), 150 deletions(-)
Alexander Potapenko (1):
ipv4, ipv6: ensure raw socket message is big enough to hold an IP header
Andy Shevchenko (1):
x86/platform/intel-mid: Correct MSI IRQ line for watchdog device
Ard Biesheuvel (1):
ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
Arnd Bergmann (3):
tty: remove platform_sysrq_reset_seq
mtd: cfi: reduce stack size
staging: emxx_udc: remove incorrect __init annotations
Ben Hutchings (1):
cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores
Brian Norris (1):
mwifiex: debugfs: Fix (sometimes) off-by-1 SSID print
Cong Wang (1):
9p: fix a potential acl leak
Eric Dumazet (2):
tcp: do not underestimate skb->truesize in tcp_trim_head()
tcp: fix wraparound issue in tcp_lp
Ganapathi Bhat (1):
mwifiex: Avoid skipping WEP key deletion for AP
Greg Kroah-Hartman (1):
Linux 3.18.53
James Hughes (2):
brcmfmac: Ensure pointer correctly set if skb data location changes
brcmfmac: Make skb header writable before use
Jim Mattson (1):
Revert "KVM: nested VMX: disable perf cpuid reporting"
Jin Qian (1):
f2fs: sanity check segment count
Johan Hovold (10):
USB: serial: keyspan_pda: fix receive sanity checks
USB: serial: digi_acceleport: fix incomplete rx sanity check
USB: serial: ssu100: fix control-message error handling
USB: serial: io_edgeport: fix epic-descriptor handling
USB: serial: ti_usb_3410_5052: fix control-message error handling
USB: serial: ark3116: fix open error handling
USB: serial: ftdi_sio: fix latency-timer error handling
USB: serial: quatech2: fix control-message error handling
USB: serial: mct_u232: fix modem-status error handling
USB: serial: io_edgeport: fix descriptor error handling
Krzysztof Kozlowski (2):
usb: host: ehci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
usb: host: ohci-exynos: Decrese node refcount on exynos_ehci_get_phy() error paths
Liam Breck (2):
power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLING
power: supply: bq24190_charger: Call set_mode_host() on pm_resume()
Masami Hiramatsu (1):
kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed
Michael Ellerman (1):
powerpc/powernv: Fix opal_exit tracepoint opcode
Nicolai Hähnle (1):
drm/ttm: fix use-after-free races in vm fault handling
Nikola Pajkovsky (1):
x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0
WANG Cong (2):
ipv6: initialize route null entry in addrconf_init()
ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 52 +SUBLEVEL = 53 EXTRAVERSION = NAME = Diseased Newt
arch/arm/kernel/Makefile +0 -1
@@ -84,7 +84,6 @@ obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_PERF_EVENTS) += perf_regs.o obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o -CFLAGS_pj4-cp0.o := -marm AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
arch/arm/kernel/pj4-cp0.c +4 -0
@@ -66,9 +66,13 @@ static void __init pj4_cp_access_write(u32 value) __asm__ __volatile__ ( "mcr p15, 0, %1, c1, c0, 2\n\t" +#ifdef CONFIG_THUMB2_KERNEL + "isb\n\t" +#else"mrc p15, 0, %0, c1, c0, 2\n\t" "mov %0, %0\n\t" "sub pc, pc, #4\n\t" +#endif :"=r" (temp) :"r" (value)); }
arch/powerpc/platforms/powernv/opal-wrappers.S +1 -1
@@ -148,7 +148,7 @@ opal_tracepoint_entry: opal_tracepoint_return: std r3,STK_REG(R31)(r1) mr r4,r3 - ld r0,STK_REG(R23)(r1) + ld r3,STK_REG(R23)(r1) bl __trace_opal_exit ld r3,STK_REG(R31)(r1) addi r1,r1,STACKFRAMESIZE
arch/x86/kernel/kprobes/common.h +1 -1
@@ -67,7 +67,7 @@#endif /* Ensure if the instruction can be boostable */ -extern int can_boost (kprobe_opcode_t *instruction); +extern int can_boost (kprobe_opcode_t *instruction,void *addr);/* Recover instruction if given address is probed */ extern unsigned long recover_probed_instruction (kprobe_opcode_t *buf,unsigned long addr);
arch/x86/kernel/kprobes/core.c +3 -3
@@ -163,12 +163,12 @@ NOKPROBE_SYMBOL(skip_prefixes);* Returns non-zero if opcode is boostable. * RIP relative instructions are adjusted at copying time in 64 bits mode */ -int can_boost (kprobe_opcode_t *opcodes) +int can_boost (kprobe_opcode_t *opcodes,void *addr) {kprobe_opcode_t opcode;kprobe_opcode_t *orig_opcodes = opcodes; -if (search_exception_tables ((unsigned long )opcodes)) +if (search_exception_tables ((unsigned long )addr))return 0 ;/* Page fault may occur on this address. */ retry:
@@ -385,7 +385,7 @@ static int arch_copy_kprobe(struct kprobe *p)* __copy_instruction can modify the displacement of the instruction, * but it doesn't affect boostable check. */ -if (can_boost (p->ainsn.insn)) +if (can_boost (p->ainsn.insn, p->addr)) p->ainsn.boostable =0 ;else p->ainsn.boostable =-1 ;
arch/x86/kernel/kprobes/opt.c +1 -1
@@ -177,7 +177,7 @@ static int copy_optimized_instructions(u8 *dest, u8 *src)while (len <RELATIVEJUMP_SIZE ) { ret =__copy_instruction (dest + len, src + len); -if (!ret || !can_boost (dest + len)) +if (!ret || !can_boost (dest + len, src + len))return -EINVAL ; len += ret; }
arch/x86/kernel/pci-calgary_64.c +1 -1
@@ -296,7 +296,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,/* were we called with bad_dma_address? */ badend =DMA_ERROR_CODE + (EMERGENCY_PAGES *PAGE_SIZE ); -if (unlikely ((dma_addr >=DMA_ERROR_CODE ) && (dma_addr < badend))) { +if (unlikely (dma_addr < badend)) {WARN (1 ,KERN_ERR "Calgary: driver tried unmapping bad DMA " "address 0x%Lx\n" , dma_addr);return ;
arch/x86/kvm/cpuid.c +0 -6
@@ -787,12 +787,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)if (!best) best =check_cpuid_limit (vcpu, function, index); -/* -* Perfmon not yet supported for L2 guest. -*/ -if (is_guest_mode (vcpu) && function ==0xa ) - best =NULL ; -if (best) { *eax = best->eax; *ebx = best->ebx;
arch/x86/kvm/vmx.c +0 -2
@@ -7047,8 +7047,6 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)case EXIT_REASON_TASK_SWITCH :return 1 ;case EXIT_REASON_CPUID : -if (kvm_register_read (vcpu,VCPU_REGS_RAX ) ==0xa ) -return 0 ;return 1 ;case EXIT_REASON_HLT :return nested_cpu_has (vmcs12,CPU_BASED_HLT_EXITING );
arch/x86/platform/intel-mid/device_libs/platform_wdt.c +1 -1
@@ -17,7 +17,7 @@#include <asm/intel-mid.h> #include <asm/io_apic.h> -#define TANGIER_EXT_TIMER0_MSI 15 +#define TANGIER_EXT_TIMER0_MSI 12static struct platform_device wdt_dev = { .name ="intel_mid_wdt" ,
drivers/gpu/drm/ttm/ttm_bo_vm.c +12 -0
@@ -66,8 +66,11 @@ static int ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,if (vmf->flags &FAULT_FLAG_RETRY_NOWAIT ) goto out_unlock; +ttm_bo_reference (bo);up_read (&vma->vm_mm->mmap_sem); (void )ttm_bo_wait (bo, false, true, false); +ttm_bo_unreserve (bo); +ttm_bo_unref (&bo); goto out_unlock; }
@@ -114,8 +117,10 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)if (vmf->flags &FAULT_FLAG_ALLOW_RETRY ) {if (!(vmf->flags &FAULT_FLAG_RETRY_NOWAIT )) { +ttm_bo_reference (bo);up_read (&vma->vm_mm->mmap_sem); (void )ttm_bo_wait_unreserved (bo); +ttm_bo_unref (&bo); }return VM_FAULT_RETRY ;
@@ -160,6 +165,13 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ret =ttm_bo_vm_fault_idle (bo, vma, vmf);if (unlikely (ret !=0 )) { retval = ret; + +if (retval ==VM_FAULT_RETRY && + !(vmf->flags &FAULT_FLAG_RETRY_NOWAIT )) { +/* The BO has already been unreserved. */ +return retval; + } + goto out_unlock; }
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +8 -15
@@ -192,7 +192,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,int ret;struct brcmf_if *ifp =netdev_priv (ndev);struct brcmf_pub *drvr = ifp->drvr; -struct ethhdr *eh = (struct ethhdr *)(skb->data); +struct ethhdr *eh;brcmf_dbg (DATA ,"Enter, idx=%d\n" , ifp->bssidx);
@@ -213,22 +213,13 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, goto done; } -/* Make sure there's enough room for any header */ -if (skb_headroom (skb) < drvr->hdrlen) { -struct sk_buff *skb2; - -brcmf_dbg (INFO ,"%s: insufficient headroom\n" , +/* Make sure there's enough writable headroom*/ + ret =skb_cow_head (skb, drvr->hdrlen); +if (ret <0 ) { +brcmf_err ("%s: skb_cow_head failed\n" ,brcmf_ifname (drvr, ifp->bssidx)); - drvr->bus_if->tx_realloc++; - skb2 =skb_realloc_headroom (skb, drvr->hdrlen);dev_kfree_skb (skb); - skb = skb2; -if (skb ==NULL ) { -brcmf_err ("%s: skb_realloc_headroom failed\n" , -brcmf_ifname (drvr, ifp->bssidx)); - ret = -ENOMEM ; - goto done; - } + goto done; }/* validate length for ether packet */
@@ -238,6 +229,8 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, goto done; } + eh = (struct ethhdr *)(skb->data); +if (eh->h_proto ==htons (ETH_P_PAE ))atomic_inc (&ifp->pend_8021x_cnt);
drivers/net/wireless/mwifiex/debugfs.c +2 -1
@@ -220,7 +220,8 @@ mwifiex_info_read(struct file *file, char __user *ubuf,if (GET_BSS_ROLE (priv) ==MWIFIEX_BSS_ROLE_STA ) { p +=sprintf (p,"multicast_count=\"%d\"\n" ,netdev_mc_count (netdev)); - p +=sprintf (p,"essid=\"%s\"\n" , info.ssid.ssid); + p +=sprintf (p,"essid=\"%.*s\"\n" , info.ssid.ssid_len, + info.ssid.ssid); p +=sprintf (p,"bssid=\"%pM\"\n" , info.bssid); p +=sprintf (p,"channel=\"%d\"\n" , (int ) info.bss_chan); p +=sprintf (p,"country_code = \"%s\"\n" , info.country_code);
drivers/net/wireless/mwifiex/sta_ioctl.c +0 -2
@@ -1074,8 +1074,6 @@ int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp, encrypt_key.is_rx_seq_valid = true; } }else { -if (GET_BSS_ROLE (priv) ==MWIFIEX_BSS_ROLE_UAP ) -return 0 ; encrypt_key.key_disable = true;if (mac_addr)memcpy (encrypt_key.mac_addr, mac_addr,ETH_ALEN );
drivers/power/bq24190_charger.c +2 -1
@@ -1400,7 +1400,7 @@ static int bq24190_probe(struct i2c_client *client, ret =devm_request_threaded_irq (dev, bdi->irq,NULL , bq24190_irq_handler_thread, -IRQF_TRIGGER_RISING |IRQF_ONESHOT , +IRQF_TRIGGER_FALLING |IRQF_ONESHOT ,"bq24190-charger" , bdi);if (ret <0 ) {dev_err (dev,"Can't set up irq handler\n" );
@@ -1496,6 +1496,7 @@ static int bq24190_pm_resume(struct device *dev)pm_runtime_get_sync (bdi->dev);bq24190_register_reset (bdi); +bq24190_set_mode_host (bdi);pm_runtime_put_sync (bdi->dev);/* Things may have changed while suspended so alert upper layer */
drivers/staging/emxx_udc/emxx_udc.c +2 -2
@@ -3286,7 +3286,7 @@ static void __init nbu2ss_drv_set_ep_info( }/*-------------------------------------------------------------------------*/ -static void __init nbu2ss_drv_ep_init (struct nbu2ss_udc *udc) +static void nbu2ss_drv_ep_init (struct nbu2ss_udc *udc) {int i;
@@ -3302,7 +3302,7 @@ static void __init nbu2ss_drv_ep_init(struct nbu2ss_udc *udc)/*-------------------------------------------------------------------------*/ /* platform_driver */ -static int __init nbu2ss_drv_contest_init ( +static int nbu2ss_drv_contest_init (struct platform_device *pdev,struct nbu2ss_udc *udc) {
drivers/tty/sysrq.c +1 -18
@@ -55,9 +55,6 @@static int __read_mostly sysrq_enabled =CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE ;static bool __read_mostly sysrq_always_enabled; -unsigned short platform_sysrq_reset_seq[]__weak = {KEY_RESERVED }; -int sysrq_reset_downtime_ms__weak ; -static bool sysrq_on (void ) {return sysrq_enabled || sysrq_always_enabled;
@@ -567,6 +564,7 @@ void handle_sysrq(int key)EXPORT_SYMBOL (handle_sysrq);#ifdef CONFIG_INPUT +static int sysrq_reset_downtime_ms;/* Simple translation table for the SysRq keys */ static const unsigned char sysrq_xlate[KEY_CNT] =
@@ -947,23 +945,8 @@ static bool sysrq_handler_registered;static inline void sysrq_register_handler (void ) { -unsigned short key;int error; -int i; - -/* First check if a __weak interface was instantiated. */ -for (i =0 ; i <ARRAY_SIZE (sysrq_reset_seq); i++) { - key = platform_sysrq_reset_seq[i]; -if (key ==KEY_RESERVED || key >KEY_MAX ) -break ; - - sysrq_reset_seq[sysrq_reset_seq_len++] = key; - } -/* -* DT configuration takes precedence over anything that would -* have been defined via the __weak interface. -*/ sysrq_of_get_keyreset_config (); error =input_register_handler (&sysrq_handler);
drivers/usb/host/ehci-exynos.c +2 -0
@@ -78,10 +78,12 @@ static int exynos_ehci_get_phy(struct device *dev,if (IS_ERR (phy)) { ret =PTR_ERR (phy);if (ret == -EPROBE_DEFER ) { +of_node_put (child);return ret; }else if (ret != -ENOSYS && ret != -ENODEV ) {dev_err (dev,"Error retrieving usb2 phy: %d\n" , ret); +of_node_put (child);return ret; } }
drivers/usb/host/ohci-exynos.c +2 -0
@@ -67,10 +67,12 @@ static int exynos_ohci_get_phy(struct device *dev,if (IS_ERR (phy)) { ret =PTR_ERR (phy);if (ret == -EPROBE_DEFER ) { +of_node_put (child);return ret; }else if (ret != -ENOSYS && ret != -ENODEV ) {dev_err (dev,"Error retrieving usb2 phy: %d\n" , ret); +of_node_put (child);return ret; } }
drivers/usb/serial/ark3116.c +19 -6
@@ -366,23 +366,29 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)dev_dbg (&port->dev,"%s - usb_serial_generic_open failed: %d\n" , __func__, result); - goto err_out; + goto err_free; }/* remove any data still left: also clears error state */ ark3116_read_reg (serial,UART_RX , buf);/* read modem status */ - priv->msr =ark3116_read_reg (serial,UART_MSR , buf); + result =ark3116_read_reg (serial,UART_MSR , buf); +if (result <0 ) + goto err_close; + priv->msr = *buf; +/* read line status */ - priv->lsr =ark3116_read_reg (serial,UART_LSR , buf); + result =ark3116_read_reg (serial,UART_LSR , buf); +if (result <0 ) + goto err_close; + priv->lsr = *buf; result =usb_submit_urb (port->interrupt_in_urb,GFP_KERNEL );if (result) {dev_err (&port->dev,"submit irq_in urb failed %d\n" , result); -ark3116_close (port); - goto err_out; + goto err_close; }/* activate interrupts */
@@ -395,8 +401,15 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)if (tty)ark3116_set_termios (tty, port,NULL ); -err_out:kfree (buf); + +return 0 ; + +err_close: +usb_serial_generic_close (port); +err_free: +kfree (buf); +return result; }
drivers/usb/serial/digi_acceleport.c +23 -15
@@ -1399,25 +1399,30 @@ static int digi_read_inb_callback(struct urb *urb) {struct usb_serial_port *port = urb->context;struct digi_port *priv =usb_get_serial_port_data (port); -int opcode = ((unsigned char *)urb->transfer_buffer)[0 ]; -int len = ((unsigned char *)urb->transfer_buffer)[1 ]; -int port_status = ((unsigned char *)urb->transfer_buffer)[2 ]; -unsigned char *data = ((unsigned char *)urb->transfer_buffer) +3 ; +unsigned char *buf = urb->transfer_buffer; +int opcode; +int len; +int port_status; +unsigned char *data;int flag, throttled; -int status = urb->status; - -/* do not process callbacks on closed ports */ -/* but do continue the read chain */ -if (urb->status == -ENOENT ) -return 0 ;/* short/multiple packet check */ +if (urb->actual_length <2 ) { +dev_warn (&port->dev,"short packet received\n" ); +return -1 ; + } + + opcode = buf[0 ]; + len = buf[1 ]; +if (urb->actual_length != len +2 ) { -dev_err (&port->dev,"%s: INCOMPLETE OR MULTIPLE PACKET, " -"status=%d, port=%d, opcode=%d, len=%d, " -"actual_length=%d, status=%d\n" , __func__, status, - priv->dp_port_num, opcode, len, urb->actual_length, - port_status); +dev_err (&port->dev,"malformed packet received: port=%d, opcode=%d, len=%d, actual_length=%u\n" , + priv->dp_port_num, opcode, len, urb->actual_length); +return -1 ; + } + +if (opcode ==DIGI_CMD_RECEIVE_DATA && len <1 ) { +dev_err (&port->dev,"malformed data packet received\n" );return -1 ; }
@@ -1431,6 +1436,9 @@ static int digi_read_inb_callback(struct urb *urb)/* receive data */ if (opcode ==DIGI_CMD_RECEIVE_DATA ) { + port_status = buf[2 ]; + data = &buf[3 ]; +/* get flag from port_status */ flag =0 ;
drivers/usb/serial/ftdi_sio.c +5 -2
@@ -1437,10 +1437,13 @@ static int read_latency_timer(struct usb_serial_port *port)FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE ,0 , priv->interface, buf, 1, WDR_TIMEOUT); -if (rv <0 ) +if (rv <1 ) {dev_err (&port->dev,"Unable to read latency timer: %i\n" , rv); -else +if (rv >=0 ) + rv = -EIO ; + }else { priv->latency = buf[0 ]; + }kfree (buf);
drivers/usb/serial/io_edgeport.c +33 -15
106 lines not on this page · raw message
drivers/usb/serial/keyspan_pda.c +14 -5
@@ -139,6 +139,7 @@ static void keyspan_pda_rx_interrupt(struct urb *urb) {struct usb_serial_port *port = urb->context;unsigned char *data = urb->transfer_buffer; +unsigned int len = urb->actual_length;int retval;int status = urb->status;struct keyspan_pda_private *priv;
@@ -159,18 +160,26 @@ static void keyspan_pda_rx_interrupt(struct urb *urb) goto exit; } +if (len <1 ) { +dev_warn (&port->dev,"short message received\n" ); + goto exit; + } +/* see if the message is data or a status interrupt */ switch (data[0 ]) {case 0 :/* rest of message is rx data */ -if (urb->actual_length) { -tty_insert_flip_string (&port->port, data +1 , - urb->actual_length -1 ); -tty_flip_buffer_push (&port->port); - } +if (len <2 ) +break ; +tty_insert_flip_string (&port->port, data +1 , len -1 ); +tty_flip_buffer_push (&port->port);break ;case 1 :/* status interrupt */ +if (len <3 ) { +dev_warn (&port->dev,"short interrupt message received\n" ); +break ; + }dev_dbg (&port->dev,"rx int, d1=%d, d2=%d\n" , data[1 ], data[2 ]);switch (data[1 ]) {case 1 :/* modemline change */
drivers/usb/serial/mct_u232.c +5 -1
@@ -322,8 +322,12 @@ static int mct_u232_get_modem_stat(struct usb_serial_port *port,MCT_U232_GET_REQUEST_TYPE ,0 ,0 , buf,MCT_U232_GET_MODEM_STAT_SIZE , WDR_TIMEOUT); -if (rc <0 ) { +if (rc <MCT_U232_GET_MODEM_STAT_SIZE ) {dev_err (&port->dev,"Get MODEM STATus failed (error = %d)\n" , rc); + +if (rc >=0 ) + rc = -EIO ; + *msr =0 ; }else { *msr = buf[0 ];
drivers/usb/serial/quatech2.c +13 -11
@@ -188,22 +188,22 @@ static inline int qt2_setdevice(struct usb_device *dev, u8 *data) } -static inline int qt2_getdevice (struct usb_device *dev,u8 *data) -{ -return usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), -QT_SET_GET_DEVICE ,0xc0 ,0 ,0 , - data,3 ,QT2_USB_TIMEOUT ); -} -static inline int qt2_getregister (struct usb_device *dev,u8 uart,u8 reg,u8 *data) { -return usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), -QT_SET_GET_REGISTER ,0xc0 , reg, - uart, data,sizeof (*data),QT2_USB_TIMEOUT ); +int ret; + + ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), +QT_SET_GET_REGISTER ,0xc0 , reg, + uart, data,sizeof (*data),QT2_USB_TIMEOUT ); +if (ret <sizeof (*data)) { +if (ret >=0 ) + ret = -EIO ; + } +return ret; } static inline int qt2_setregister(struct usb_device *dev,
@@ -372,9 +372,11 @@ static int qt2_open(struct tty_struct *tty, struct usb_serial_port *port)0xc0 ,0 , device_port, data, 2, QT2_USB_TIMEOUT); -if (status <0 ) { +if (status <2 ) {dev_err (&port->dev,"%s - open port failed %i\n" , __func__, status); +if (status >=0 ) + status = -EIO ;kfree (data);return status; }
drivers/usb/serial/ssu100.c +24 -7
@@ -80,9 +80,17 @@ static inline int ssu100_setdevice(struct usb_device *dev, u8 *data)static inline int ssu100_getdevice (struct usb_device *dev,u8 *data) { -return usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), -QT_SET_GET_DEVICE ,0xc0 ,0 ,0 , - data,3 ,300 ); +int ret; + + ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), +QT_SET_GET_DEVICE ,0xc0 ,0 ,0 , + data,3 ,300 ); +if (ret <3 ) { +if (ret >=0 ) + ret = -EIO ; + } + +return ret; } static inline int ssu100_getregister(struct usb_device *dev,
@@ -90,10 +98,17 @@ static inline int ssu100_getregister(struct usb_device *dev,unsigned short reg, u8 *data) { - return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), - QT_SET_GET_REGISTER, 0xc0, reg, - uart, data, sizeof(*data), 300); + int ret; + + ret =usb_control_msg (dev,usb_rcvctrlpipe (dev,0 ), +QT_SET_GET_REGISTER ,0xc0 , reg, + uart, data,sizeof (*data),300 ); +if (ret <sizeof (*data)) { +if (ret >=0 ) + ret = -EIO ; + } +return ret; }
@@ -289,8 +304,10 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port)QT_OPEN_CLOSE_CHANNEL ,QT_TRANSFER_IN ,0x01 , 0, data, 2, 300); -if (result <0 ) { +if (result <2 ) {dev_dbg (&port->dev,"%s - open failed %i\n" , __func__, result); +if (result >=0 ) + result = -EIO ;kfree (data);return result; }
drivers/usb/serial/ti_usb_3410_5052.c +4 -8
@@ -1343,13 +1343,10 @@ static int ti_command_out_sync(struct ti_device *tdev, __u8 command, (USB_TYPE_VENDOR |USB_RECIP_DEVICE |USB_DIR_OUT ), value, moduleid, data, size, 1000); -if (status == size) - status =0 ; - -if (status >0 ) - status = -ECOMM ; +if (status <0 ) +return status; -return status; +return 0 ; }
@@ -1365,8 +1362,7 @@ static int ti_command_in_sync(struct ti_device *tdev, __u8 command,if (status == size) status =0 ; - -if (status >0 ) +else if (status >=0 ) status = -ECOMM ;return status;
fs/9p/acl.c +2 -0
@@ -321,6 +321,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name, name =POSIX_ACL_XATTR_ACCESS ;if (acl) {struct iattr iattr; +struct posix_acl *old_acl = acl; retval =posix_acl_update_mode (inode, &iattr.ia_mode, &acl);if (retval)
@@ -331,6 +332,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,* by the mode bits. So don't * update ACL. */ +posix_acl_release (old_acl); value =NULL ; size =0 ; }
fs/f2fs/super.c +7 -0
@@ -913,6 +913,13 @@ static int sanity_check_raw_super(struct super_block *sb,return 1 ; } +if (le32_to_cpu (raw_super->segment_count) >F2FS_MAX_SEGMENT ) { +f2fs_msg (sb,KERN_INFO , +"Invalid segment count (%u)" , +le32_to_cpu (raw_super->segment_count)); +return 1 ; + } +/* check CP/SIT/NAT/SSA/MAIN_AREA area boundary */ if (sanity_check_area_boundary (sb, raw_super))return 1 ;
include/linux/f2fs_fs.h +6 -0
@@ -269,6 +269,12 @@ struct f2fs_nat_block {#define SIT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_sit_entry))/* +* F2FS uses 4 bytes to represent block address. As a result, supported size of +* disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments. +*/ +#define F2FS_MAX_SEGMENT ((16 * 1024 * 1024) / 2) + +/* * Note that f2fs_sit_entry->vblocks has the following bit-field information. * [15:10] : allocation type such as CURSEG_XXXX_TYPE * [9:0] : valid block count
include/linux/mtd/map.h +11 -1
@@ -309,7 +309,17 @@ static inline map_word map_word_or(struct map_info *map, map_word val1, map_wordreturn r; } -#define map_word_andequal (m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b)) +static inline int map_word_andequal (struct map_info *map,map_word val1,map_word val2,map_word val3) +{ +int i; + +for (i =0 ; i <map_words (map); i++) { +if ((val1.x[i] & val2.x[i]) != val3.x[i]) +return 0 ; + } + +return 1 ; +}static inline int map_word_bitsset (struct map_info *map,map_word val1,map_word val2) {
include/net/addrconf.h +2 -0
@@ -19,6 +19,8 @@#define ADDRCONF_TIMER_FUZZ (HZ / 4)#define ADDRCONF_TIMER_FUZZ_MAX (HZ) +#define ADDRCONF_NOTIFY_PRIORITY 0 +#include <linux/in.h> #include <linux/in6.h>
include/net/ip6_route.h +1 -0
@@ -69,6 +69,7 @@ struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk,struct dst_entry *ip6_route_lookup (struct net *net,struct flowi6 *fl6,int flags); +void ip6_route_init_special_entries (void );int ip6_route_init (void );void ip6_route_cleanup (void );
net/ipv4/raw.c +3 -0
@@ -345,6 +345,9 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4, rt->dst.dev->mtu);return -EMSGSIZE ; } +if (length <sizeof (struct iphdr )) +return -EINVAL ; +if (flags&MSG_PROBE ) goto out;
net/ipv4/tcp_lp.c +4 -2
@@ -264,13 +264,15 @@ static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, s32 rtt_us) {struct tcp_sock *tp =tcp_sk (sk);struct lp *lp =inet_csk_ca (sk); +u32 delta;if (rtt_us >0 )tcp_lp_rtt_sample (sk, rtt_us);/* calc inference */ -if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) - lp->inference =3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr); + delta = tcp_time_stamp - tp->rx_opt.rcv_tsecr; +if ((s32 )delta >0 ) + lp->inference =3 * delta;/* test if within inference */ if (lp->last_drop && (tcp_time_stamp - lp->last_drop < lp->inference))
net/ipv4/tcp_output.c +12 -7
@@ -1212,7 +1212,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,* eventually). The difference is that pulled data not copied, but * immediately discarded. */ -static void __pskb_trim_head (struct sk_buff *skb,int len) +static int __pskb_trim_head (struct sk_buff *skb,int len) {struct skb_shared_info *shinfo;int i, k, eat;
@@ -1222,7 +1222,7 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)__skb_pull (skb, eat); len -= eat;if (!len) -return ; +return 0 ; } eat = len; k =0 ;
@@ -1248,23 +1248,28 @@ static void __pskb_trim_head(struct sk_buff *skb, int len)skb_reset_tail_pointer (skb); skb->data_len -= len; skb->len = skb->data_len; +return len; }/* Remove acked data from a packet in the transmit queue. */ int tcp_trim_head (struct sock *sk,struct sk_buff *skb,u32 len) { +u32 delta_truesize; +if (skb_unclone (skb,GFP_ATOMIC ))return -ENOMEM ; -__pskb_trim_head (skb, len); + delta_truesize =__pskb_trim_head (skb, len);TCP_SKB_CB (skb)->seq += len; skb->ip_summed =CHECKSUM_PARTIAL ; - skb->truesize -= len; - sk->sk_wmem_queued -= len; -sk_mem_uncharge (sk, len); -sock_set_flag (sk,SOCK_QUEUE_SHRUNK ); +if (delta_truesize) { + skb->truesize -= delta_truesize; + sk->sk_wmem_queued -= delta_truesize; +sk_mem_uncharge (sk, delta_truesize); +sock_set_flag (sk,SOCK_QUEUE_SHRUNK ); + }/* Any change of skb->len requires recalculation of tso factor. */ if (tcp_skb_pcount (skb) >1 )
net/ipv6/addrconf.c +3 -0
@@ -2984,6 +2984,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,*/ static struct notifier_block ipv6_dev_notf = { .notifier_call = addrconf_notify, + .priority =ADDRCONF_NOTIFY_PRIORITY , };static void addrconf_type_change (struct net_device *dev,unsigned long event)
@@ -5441,6 +5442,8 @@ int __init addrconf_init(void) goto errlo; } +ip6_route_init_special_entries (); +for (i =0 ; i <IN6_ADDR_HSIZE ; i++)INIT_HLIST_HEAD (&inet6_addr_lst[i]);
net/ipv6/raw.c +2 -0
@@ -624,6 +624,8 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,ipv6_local_error (sk,EMSGSIZE , fl6, rt->dst.dev->mtu);return -EMSGSIZE ; } +if (length <sizeof (struct ipv6hdr )) +return -EINVAL ;if (flags&MSG_PROBE ) goto out;
net/ipv6/route.c +26 -13
@@ -2815,7 +2815,10 @@ static int ip6_route_dev_notify(struct notifier_block *this,struct net_device *dev =netdev_notifier_info_to_dev (ptr);struct net *net =dev_net (dev); -if (event ==NETDEV_REGISTER && (dev->flags &IFF_LOOPBACK )) { +if (!(dev->flags &IFF_LOOPBACK )) +return NOTIFY_OK ; + +if (event ==NETDEV_REGISTER ) { net->ipv6.ip6_null_entry->dst.dev = dev; net->ipv6.ip6_null_entry->rt6i_idev =in6_dev_get (dev);#ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -2824,6 +2827,12 @@ static int ip6_route_dev_notify(struct notifier_block *this, net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev =in6_dev_get (dev);#endif + }else if (event ==NETDEV_UNREGISTER ) { +in6_dev_put (net->ipv6.ip6_null_entry->rt6i_idev); +#ifdef CONFIG_IPV6_MULTIPLE_TABLES +in6_dev_put (net->ipv6.ip6_prohibit_entry->rt6i_idev); +in6_dev_put (net->ipv6.ip6_blk_hole_entry->rt6i_idev); +#endif }return NOTIFY_OK ;
@@ -3130,9 +3139,24 @@ static struct pernet_operations ip6_route_net_late_ops = {static struct notifier_block ip6_route_dev_notifier = { .notifier_call = ip6_route_dev_notify, - .priority =0 , + .priority =ADDRCONF_NOTIFY_PRIORITY -10 , }; +void __init ip6_route_init_special_entries (void ) +{ +/* Registering of the loopback is done before this portion of code, +* the loopback reference in rt6_info will not be taken, do it +* manually for init_net */ + init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_null_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_prohibit_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); + init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_blk_hole_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); +#endif +} +int __init ip6_route_init (void ) {int ret;
@@ -3158,17 +3182,6 @@ int __init ip6_route_init(void) ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep; -/* Registering of the loopback is done before this portion of code, -* the loopback reference in rt6_info will not be taken, do it -* manually for init_net */ - init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev; - init_net.ipv6.ip6_null_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); -#ifdef CONFIG_IPV6_MULTIPLE_TABLES - init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev; - init_net.ipv6.ip6_prohibit_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); - init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; - init_net.ipv6.ip6_blk_hole_entry->rt6i_idev =in6_dev_get (init_net.loopback_dev); -#endif ret =fib6_init ();if (ret) goto out_register_subsys;
tools/power/cpupower/utils/helpers/cpuid.c +1 -0
@@ -156,6 +156,7 @@ out:*/ case 0x2C :/* Westmere EP - Gulftown */ cpu_info->caps |=CPUPOWER_CAP_HAS_TURBO_RATIO ; +break ;case 0x2A :/* SNB */ case 0x2D :/* SNB Xeon */ case 0x3A :/* IVB */