Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net

+850 -534
+4 -3
Documentation/kernel-parameters.txt
··· 2706 2706 functions are at fixed addresses, they make nice 2707 2707 targets for exploits that can control RIP. 2708 2708 2709 - emulate [default] Vsyscalls turn into traps and are 2710 - emulated reasonably safely. 2709 + emulate Vsyscalls turn into traps and are emulated 2710 + reasonably safely. 2711 2711 2712 - native Vsyscalls are native syscall instructions. 2712 + native [default] Vsyscalls are native syscall 2713 + instructions. 2713 2714 This is a little bit faster than trapping 2714 2715 and makes a few dynamic recompilers work 2715 2716 better than they would in emulation mode.
+3 -3
MAINTAINERS
··· 2468 2468 F: drivers/infiniband/hw/ehca/ 2469 2469 2470 2470 EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER 2471 - M: Breno Leitao <leitao@linux.vnet.ibm.com> 2471 + M: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> 2472 2472 L: netdev@vger.kernel.org 2473 2473 S: Maintained 2474 2474 F: drivers/net/ethernet/ibm/ehea/ ··· 6374 6374 6375 6375 TEGRA SUPPORT 6376 6376 M: Colin Cross <ccross@android.com> 6377 - M: Erik Gilling <konkers@android.com> 6378 6377 M: Olof Johansson <olof@lixom.net> 6378 + M: Stephen Warren <swarren@nvidia.com> 6379 6379 L: linux-tegra@vger.kernel.org 6380 - T: git git://android.git.kernel.org/kernel/tegra.git 6380 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git 6381 6381 S: Supported 6382 6382 F: arch/arm/mach-tegra 6383 6383
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 1 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc9 4 + EXTRAVERSION = -rc10 5 5 NAME = "Divemaster Edition" 6 6 7 7 # *DOCUMENTATION*
-1
arch/arm/common/vic.c
··· 259 259 writel(0, base + VIC_INT_SELECT); 260 260 writel(0, base + VIC_INT_ENABLE); 261 261 writel(~0, base + VIC_INT_ENABLE_CLEAR); 262 - writel(0, base + VIC_IRQ_STATUS); 263 262 writel(0, base + VIC_ITCR); 264 263 writel(~0, base + VIC_INT_SOFT_CLEAR); 265 264 }
+2
arch/arm/include/asm/localtimer.h
··· 10 10 #ifndef __ASM_ARM_LOCALTIMER_H 11 11 #define __ASM_ARM_LOCALTIMER_H 12 12 13 + #include <linux/errno.h> 14 + 13 15 struct clock_event_device; 14 16 15 17 /*
+2 -2
arch/arm/kernel/perf_event_v7.c
··· 321 321 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES, 322 322 [PERF_COUNT_HW_INSTRUCTIONS] = 323 323 ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE, 324 - [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_COHERENT_LINE_HIT, 325 - [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_COHERENT_LINE_MISS, 324 + [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_DCACHE_ACCESS, 325 + [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_DCACHE_REFILL, 326 326 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE, 327 327 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED, 328 328 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
+2 -1
arch/arm/mach-omap2/board-2430sdp.c
··· 193 193 { 194 194 omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo, 195 195 ARRAY_SIZE(sdp2430_i2c1_boardinfo)); 196 - omap2_pmic_init("twl4030", &sdp2430_twldata); 196 + omap_pmic_init(2, 100, "twl4030", INT_24XX_SYS_NIRQ, 197 + &sdp2430_twldata); 197 198 return 0; 198 199 } 199 200
+4 -8
arch/arm/mach-omap2/hsmmc.c
··· 137 137 */ 138 138 reg = omap4_ctrl_pad_readl(control_pbias_offset); 139 139 reg &= ~(OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | 140 - OMAP4_MMC1_PWRDNZ_MASK | 141 - OMAP4_USBC1_ICUSB_PWRDNZ_MASK); 140 + OMAP4_MMC1_PWRDNZ_MASK); 142 141 omap4_ctrl_pad_writel(reg, control_pbias_offset); 143 142 } 144 143 ··· 155 156 else 156 157 reg |= OMAP4_MMC1_PBIASLITE_VMODE_MASK; 157 158 reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | 158 - OMAP4_MMC1_PWRDNZ_MASK | 159 - OMAP4_USBC1_ICUSB_PWRDNZ_MASK); 159 + OMAP4_MMC1_PWRDNZ_MASK); 160 160 omap4_ctrl_pad_writel(reg, control_pbias_offset); 161 161 162 162 timeout = jiffies + msecs_to_jiffies(5); ··· 169 171 if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) { 170 172 pr_err("Pbias Voltage is not same as LDO\n"); 171 173 /* Caution : On VMODE_ERROR Power Down MMC IO */ 172 - reg &= ~(OMAP4_MMC1_PWRDNZ_MASK | 173 - OMAP4_USBC1_ICUSB_PWRDNZ_MASK); 174 + reg &= ~(OMAP4_MMC1_PWRDNZ_MASK); 174 175 omap4_ctrl_pad_writel(reg, control_pbias_offset); 175 176 } 176 177 } else { 177 178 reg = omap4_ctrl_pad_readl(control_pbias_offset); 178 179 reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK | 179 180 OMAP4_MMC1_PWRDNZ_MASK | 180 - OMAP4_MMC1_PBIASLITE_VMODE_MASK | 181 - OMAP4_USBC1_ICUSB_PWRDNZ_MASK); 181 + OMAP4_MMC1_PBIASLITE_VMODE_MASK); 182 182 omap4_ctrl_pad_writel(reg, control_pbias_offset); 183 183 } 184 184 }
-3
arch/arm/mach-omap2/usb-musb.c
··· 137 137 musb_plat.mode = board_data->mode; 138 138 musb_plat.extvbus = board_data->extvbus; 139 139 140 - if (cpu_is_omap44xx()) 141 - omap4430_phy_init(dev); 142 - 143 140 if (cpu_is_omap3517() || cpu_is_omap3505()) { 144 141 oh_name = "am35x_otg_hs"; 145 142 name = "musb-am35x";
-1
arch/arm/mach-tegra/cpu-tegra.c
··· 32 32 33 33 #include <asm/system.h> 34 34 35 - #include <mach/hardware.h> 36 35 #include <mach/clk.h> 37 36 38 37 /* Frequency table index must be sequential starting at 0 */
+1
arch/arm/mach-ux500/Kconfig
··· 6 6 select ARM_GIC 7 7 select HAS_MTU 8 8 select ARM_ERRATA_753970 9 + select ARM_ERRATA_754322 9 10 10 11 menu "Ux500 SoC" 11 12
+7
arch/arm/mm/init.c
··· 496 496 */ 497 497 bank_start = min(bank_start, 498 498 ALIGN(prev_bank_end, PAGES_PER_SECTION)); 499 + #else 500 + /* 501 + * Align down here since the VM subsystem insists that the 502 + * memmap entries are valid from the bank start aligned to 503 + * MAX_ORDER_NR_PAGES. 504 + */ 505 + bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES); 499 506 #endif 500 507 /* 501 508 * If we had a previous bank, and there is a space
+6
arch/mips/Kconfig
··· 24 24 select GENERIC_IRQ_PROBE 25 25 select GENERIC_IRQ_SHOW 26 26 select HAVE_ARCH_JUMP_LABEL 27 + select IRQ_FORCED_THREADING 27 28 28 29 menu "Machine selection" 29 30 ··· 716 715 select SYS_SUPPORTS_HIGHMEM 717 716 select SYS_SUPPORTS_HOTPLUG_CPU 718 717 select SYS_HAS_CPU_CAVIUM_OCTEON 718 + select HOLES_IN_ZONE 719 719 help 720 720 The Octeon simulator is software performance model of the Cavium 721 721 Octeon Processor. It supports simulating Octeon processors on x86 ··· 739 737 select ZONE_DMA32 740 738 select USB_ARCH_HAS_OHCI 741 739 select USB_ARCH_HAS_EHCI 740 + select HOLES_IN_ZONE 742 741 help 743 742 This option supports all of the Octeon reference boards from Cavium 744 743 Networks. It builds a kernel that dynamically determines the Octeon ··· 968 965 bool 969 966 970 967 config GENERIC_GPIO 968 + bool 969 + 970 + config HOLES_IN_ZONE 971 971 bool 972 972 973 973 #
+1 -1
arch/mips/alchemy/common/platform.c
··· 492 492 memcpy(au1xxx_eth0_platform_data.mac, ethaddr, 6); 493 493 494 494 ret = platform_device_register(&au1xxx_eth0_device); 495 - if (!ret) 495 + if (ret) 496 496 printk(KERN_INFO "Alchemy: failed to register MAC0\n"); 497 497 498 498
+14 -8
arch/mips/alchemy/common/power.c
··· 158 158 159 159 void au_sleep(void) 160 160 { 161 - int cpuid = alchemy_get_cputype(); 162 - if (cpuid != ALCHEMY_CPU_UNKNOWN) { 163 - save_core_regs(); 164 - if (cpuid <= ALCHEMY_CPU_AU1500) 165 - alchemy_sleep_au1000(); 166 - else if (cpuid <= ALCHEMY_CPU_AU1200) 167 - alchemy_sleep_au1550(); 168 - restore_core_regs(); 161 + save_core_regs(); 162 + 163 + switch (alchemy_get_cputype()) { 164 + case ALCHEMY_CPU_AU1000: 165 + case ALCHEMY_CPU_AU1500: 166 + case ALCHEMY_CPU_AU1100: 167 + alchemy_sleep_au1000(); 168 + break; 169 + case ALCHEMY_CPU_AU1550: 170 + case ALCHEMY_CPU_AU1200: 171 + alchemy_sleep_au1550(); 172 + break; 169 173 } 174 + 175 + restore_core_regs(); 170 176 } 171 177 172 178 #endif /* CONFIG_PM */
+4
arch/mips/alchemy/devboards/bcsr.c
··· 89 89 { 90 90 unsigned short bisr = __raw_readw(bcsr_virt + BCSR_REG_INTSTAT); 91 91 92 + disable_irq_nosync(irq); 93 + 92 94 for ( ; bisr; bisr &= bisr - 1) 93 95 generic_handle_irq(bcsr_csc_base + __ffs(bisr)); 96 + 97 + enable_irq(irq); 94 98 } 95 99 96 100 /* NOTE: both the enable and mask bits must be cleared, otherwise the
-7
arch/mips/alchemy/devboards/db1200/setup.c
··· 23 23 unsigned long freq0, clksrc, div, pfc; 24 24 unsigned short whoami; 25 25 26 - /* Set Config[OD] (disable overlapping bus transaction): 27 - * This gets rid of a _lot_ of spurious interrupts (especially 28 - * wrt. IDE); but incurs ~10% performance hit in some 29 - * cpu-bound applications. 30 - */ 31 - set_c0_config(1 << 19); 32 - 33 26 bcsr_init(DB1200_BCSR_PHYS_ADDR, 34 27 DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS); 35 28
+2 -1
arch/mips/ar7/irq.c
··· 98 98 99 99 static struct irqaction ar7_cascade_action = { 100 100 .handler = no_action, 101 - .name = "AR7 cascade interrupt" 101 + .name = "AR7 cascade interrupt", 102 + .flags = IRQF_NO_THREAD, 102 103 }; 103 104 104 105 static void __init ar7_irq_init(int base)
+1
arch/mips/bcm63xx/irq.c
··· 222 222 static struct irqaction cpu_ip2_cascade_action = { 223 223 .handler = no_action, 224 224 .name = "cascade_ip2", 225 + .flags = IRQF_NO_THREAD, 225 226 }; 226 227 227 228 void __init arch_init_irq(void)
+1
arch/mips/cobalt/irq.c
··· 48 48 static struct irqaction cascade = { 49 49 .handler = no_action, 50 50 .name = "cascade", 51 + .flags = IRQF_NO_THREAD, 51 52 }; 52 53 53 54 void __init arch_init_irq(void)
+4
arch/mips/dec/setup.c
··· 101 101 static struct irqaction ioirq = { 102 102 .handler = no_action, 103 103 .name = "cascade", 104 + .flags = IRQF_NO_THREAD, 104 105 }; 105 106 static struct irqaction fpuirq = { 106 107 .handler = no_action, 107 108 .name = "fpu", 109 + .flags = IRQF_NO_THREAD, 108 110 }; 109 111 110 112 static struct irqaction busirq = { 111 113 .flags = IRQF_DISABLED, 112 114 .name = "bus error", 115 + .flags = IRQF_NO_THREAD, 113 116 }; 114 117 115 118 static struct irqaction haltirq = { 116 119 .handler = dec_intr_halt, 117 120 .name = "halt", 121 + .flags = IRQF_NO_THREAD, 118 122 }; 119 123 120 124
+1 -1
arch/mips/emma/markeins/irq.c
··· 169 169 170 170 static struct irqaction irq_cascade = { 171 171 .handler = no_action, 172 - .flags = 0, 172 + .flags = IRQF_NO_THREAD, 173 173 .name = "cascade", 174 174 .dev_id = NULL, 175 175 .next = NULL,
-1
arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
··· 54 54 #define cpu_has_mips_r2_exec_hazard 0 55 55 #define cpu_has_dsp 0 56 56 #define cpu_has_mipsmt 0 57 - #define cpu_has_userlocal 0 58 57 #define cpu_has_vint 0 59 58 #define cpu_has_veic 0 60 59 #define cpu_hwrena_impl_bits 0xc0000000
-1
arch/mips/include/asm/mach-powertv/dma-coherence.h
··· 13 13 #define __ASM_MACH_POWERTV_DMA_COHERENCE_H 14 14 15 15 #include <linux/sched.h> 16 - #include <linux/version.h> 17 16 #include <linux/device.h> 18 17 #include <asm/mach-powertv/asic.h> 19 18
+2 -2
arch/mips/include/asm/stackframe.h
··· 195 195 * to cover the pipeline delay. 196 196 */ 197 197 .set mips32 198 - mfc0 v1, CP0_TCSTATUS 198 + mfc0 k0, CP0_TCSTATUS 199 199 .set mips0 200 - LONG_S v1, PT_TCSTATUS(sp) 200 + LONG_S k0, PT_TCSTATUS(sp) 201 201 #endif /* CONFIG_MIPS_MT_SMTC */ 202 202 LONG_S $4, PT_R4(sp) 203 203 LONG_S $5, PT_R5(sp)
+24 -32
arch/mips/jz4740/gpio.c
··· 18 18 #include <linux/init.h> 19 19 20 20 #include <linux/spinlock.h> 21 - #include <linux/sysdev.h> 21 + #include <linux/syscore_ops.h> 22 22 #include <linux/io.h> 23 23 #include <linux/gpio.h> 24 24 #include <linux/delay.h> ··· 86 86 spinlock_t lock; 87 87 88 88 struct gpio_chip gpio_chip; 89 - struct sys_device sysdev; 90 89 }; 91 90 92 91 static struct jz_gpio_chip jz4740_gpio_chips[]; ··· 458 459 JZ4740_GPIO_CHIP(D), 459 460 }; 460 461 461 - static inline struct jz_gpio_chip *sysdev_to_chip(struct sys_device *dev) 462 + static void jz4740_gpio_suspend_chip(struct jz_gpio_chip *chip) 462 463 { 463 - return container_of(dev, struct jz_gpio_chip, sysdev); 464 - } 465 - 466 - static int jz4740_gpio_suspend(struct sys_device *dev, pm_message_t state) 467 - { 468 - struct jz_gpio_chip *chip = sysdev_to_chip(dev); 469 - 470 464 chip->suspend_mask = readl(chip->base + JZ_REG_GPIO_MASK); 471 465 writel(~(chip->wakeup), chip->base + JZ_REG_GPIO_MASK_SET); 472 466 writel(chip->wakeup, chip->base + JZ_REG_GPIO_MASK_CLEAR); 467 + } 468 + 469 + static int jz4740_gpio_suspend(void) 470 + { 471 + int i; 472 + 473 + for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); i++) 474 + jz4740_gpio_suspend_chip(&jz4740_gpio_chips[i]); 473 475 474 476 return 0; 475 477 } 476 478 477 - static int jz4740_gpio_resume(struct sys_device *dev) 479 + static void jz4740_gpio_resume_chip(struct jz_gpio_chip *chip) 478 480 { 479 - struct jz_gpio_chip *chip = sysdev_to_chip(dev); 480 481 uint32_t mask = chip->suspend_mask; 481 482 482 483 writel(~mask, chip->base + JZ_REG_GPIO_MASK_CLEAR); 483 484 writel(mask, chip->base + JZ_REG_GPIO_MASK_SET); 484 - 485 - return 0; 486 485 } 487 486 488 - static struct sysdev_class jz4740_gpio_sysdev_class = { 489 - .name = "gpio", 487 + static void jz4740_gpio_resume(void) 488 + { 489 + int i; 490 + 491 + for (i = ARRAY_SIZE(jz4740_gpio_chips) - 1; i >= 0 ; i--) 492 + jz4740_gpio_resume_chip(&jz4740_gpio_chips[i]); 493 + } 494 + 495 + static struct syscore_ops jz4740_gpio_syscore_ops = { 490 496 .suspend = jz4740_gpio_suspend, 491 497 .resume = jz4740_gpio_resume, 492 498 }; 493 499 494 - static int jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id) 500 + static void jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id) 495 501 { 496 - int ret, irq; 497 - 498 - chip->sysdev.id = id; 499 - chip->sysdev.cls = &jz4740_gpio_sysdev_class; 500 - ret = sysdev_register(&chip->sysdev); 501 - 502 - if (ret) 503 - return ret; 502 + int irq; 504 503 505 504 spin_lock_init(&chip->lock); 506 505 ··· 516 519 irq_set_chip_and_handler(irq, &jz_gpio_irq_chip, 517 520 handle_level_irq); 518 521 } 519 - 520 - return 0; 521 522 } 522 523 523 524 static int __init jz4740_gpio_init(void) 524 525 { 525 526 unsigned int i; 526 - int ret; 527 - 528 - ret = sysdev_class_register(&jz4740_gpio_sysdev_class); 529 - if (ret) 530 - return ret; 531 527 532 528 for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); ++i) 533 529 jz4740_gpio_chip_init(&jz4740_gpio_chips[i], i); 530 + 531 + register_syscore_ops(&jz4740_gpio_syscore_ops); 534 532 535 533 printk(KERN_INFO "JZ4740 GPIO initialized\n"); 536 534
+20 -19
arch/mips/kernel/ftrace.c
··· 19 19 20 20 #include <asm-generic/sections.h> 21 21 22 + #if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT) 23 + #define MCOUNT_OFFSET_INSNS 5 24 + #else 25 + #define MCOUNT_OFFSET_INSNS 4 26 + #endif 27 + 28 + /* 29 + * Check if the address is in kernel space 30 + * 31 + * Clone core_kernel_text() from kernel/extable.c, but doesn't call 32 + * init_kernel_text() for Ftrace doesn't trace functions in init sections. 33 + */ 34 + static inline int in_kernel_space(unsigned long ip) 35 + { 36 + if (ip >= (unsigned long)_stext && 37 + ip <= (unsigned long)_etext) 38 + return 1; 39 + return 0; 40 + } 41 + 22 42 #ifdef CONFIG_DYNAMIC_FTRACE 23 43 24 44 #define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */ ··· 72 52 buf = (u32 *)&insn_j_ftrace_graph_caller; 73 53 uasm_i_j(&buf, (unsigned long)ftrace_graph_caller & JUMP_RANGE_MASK); 74 54 #endif 75 - } 76 - 77 - /* 78 - * Check if the address is in kernel space 79 - * 80 - * Clone core_kernel_text() from kernel/extable.c, but doesn't call 81 - * init_kernel_text() for Ftrace doesn't trace functions in init sections. 82 - */ 83 - static inline int in_kernel_space(unsigned long ip) 84 - { 85 - if (ip >= (unsigned long)_stext && 86 - ip <= (unsigned long)_etext) 87 - return 1; 88 - return 0; 89 55 } 90 56 91 57 static int ftrace_modify_code(unsigned long ip, unsigned int new_code) ··· 118 112 * 1: offset = 4 instructions 119 113 */ 120 114 121 - #if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT) 122 - #define MCOUNT_OFFSET_INSNS 5 123 - #else 124 - #define MCOUNT_OFFSET_INSNS 4 125 - #endif 126 115 #define INSN_B_1F (0x10000000 | MCOUNT_OFFSET_INSNS) 127 116 128 117 int ftrace_make_nop(struct module *mod,
+2 -1
arch/mips/kernel/i8259.c
··· 229 229 */ 230 230 if (i8259A_auto_eoi >= 0) { 231 231 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ 232 - outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */ 232 + outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ 233 233 } 234 234 } 235 235 ··· 295 295 static struct irqaction irq2 = { 296 296 .handler = no_action, 297 297 .name = "cascade", 298 + .flags = IRQF_NO_THREAD, 298 299 }; 299 300 300 301 static struct resource pic1_io_resource = {
+7
arch/mips/kernel/linux32.c
··· 349 349 return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), 350 350 dfd, pathname); 351 351 } 352 + 353 + SYSCALL_DEFINE6(32_futex, u32 __user *, uaddr, int, op, u32, val, 354 + struct compat_timespec __user *, utime, u32 __user *, uaddr2, 355 + u32, val3) 356 + { 357 + return compat_sys_futex(uaddr, op, val, utime, uaddr2, val3); 358 + }
+1 -1
arch/mips/kernel/scall64-n32.S
··· 315 315 PTR sys_fremovexattr 316 316 PTR sys_tkill 317 317 PTR sys_ni_syscall 318 - PTR compat_sys_futex 318 + PTR sys_32_futex 319 319 PTR compat_sys_sched_setaffinity /* 6195 */ 320 320 PTR compat_sys_sched_getaffinity 321 321 PTR sys_cacheflush
+1 -1
arch/mips/kernel/scall64-o32.S
··· 441 441 PTR sys_fremovexattr /* 4235 */ 442 442 PTR sys_tkill 443 443 PTR sys_sendfile64 444 - PTR compat_sys_futex 444 + PTR sys_32_futex 445 445 PTR compat_sys_sched_setaffinity 446 446 PTR compat_sys_sched_getaffinity /* 4240 */ 447 447 PTR compat_sys_io_setup
+3
arch/mips/kernel/signal.c
··· 8 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 9 9 */ 10 10 #include <linux/cache.h> 11 + #include <linux/irqflags.h> 11 12 #include <linux/sched.h> 12 13 #include <linux/mm.h> 13 14 #include <linux/personality.h> ··· 659 658 asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, 660 659 __u32 thread_info_flags) 661 660 { 661 + local_irq_enable(); 662 + 662 663 /* deal with pending signal delivery */ 663 664 if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) 664 665 do_signal(regs);
+12 -4
arch/mips/kernel/traps.c
··· 14 14 #include <linux/bug.h> 15 15 #include <linux/compiler.h> 16 16 #include <linux/init.h> 17 + #include <linux/kernel.h> 17 18 #include <linux/mm.h> 18 19 #include <linux/module.h> 19 20 #include <linux/sched.h> ··· 365 364 return (regs->cp0_cause >> 2) & 0x1f; 366 365 } 367 366 368 - static DEFINE_SPINLOCK(die_lock); 367 + static DEFINE_RAW_SPINLOCK(die_lock); 369 368 370 369 void __noreturn die(const char *str, struct pt_regs *regs) 371 370 { 372 371 static int die_counter; 373 372 int sig = SIGSEGV; 374 373 #ifdef CONFIG_MIPS_MT_SMTC 375 - unsigned long dvpret = dvpe(); 374 + unsigned long dvpret; 376 375 #endif /* CONFIG_MIPS_MT_SMTC */ 376 + 377 + oops_enter(); 377 378 378 379 if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) == NOTIFY_STOP) 379 380 sig = 0; 380 381 381 382 console_verbose(); 382 - spin_lock_irq(&die_lock); 383 + raw_spin_lock_irq(&die_lock); 384 + #ifdef CONFIG_MIPS_MT_SMTC 385 + dvpret = dvpe(); 386 + #endif /* CONFIG_MIPS_MT_SMTC */ 383 387 bust_spinlocks(1); 384 388 #ifdef CONFIG_MIPS_MT_SMTC 385 389 mips_mt_regdump(dvpret); ··· 393 387 printk("%s[#%d]:\n", str, ++die_counter); 394 388 show_registers(regs); 395 389 add_taint(TAINT_DIE); 396 - spin_unlock_irq(&die_lock); 390 + raw_spin_unlock_irq(&die_lock); 391 + 392 + oops_exit(); 397 393 398 394 if (in_interrupt()) 399 395 panic("Fatal exception in interrupt");
+1 -1
arch/mips/kernel/vpe.c
··· 192 192 } 193 193 spin_unlock(&vpecontrol.tc_list_lock); 194 194 195 - return NULL; 195 + return res; 196 196 } 197 197 198 198 /* allocate a vpe and associate it with this minor (or index) */
+2 -4
arch/mips/lantiq/irq.c
··· 123 123 static unsigned int ltq_startup_eiu_irq(struct irq_data *d) 124 124 { 125 125 int i; 126 - int irq_nr = d->irq - INT_NUM_IRQ0; 127 126 128 127 ltq_enable_irq(d); 129 128 for (i = 0; i < MAX_EIU; i++) { 130 - if (irq_nr == ltq_eiu_irq[i]) { 129 + if (d->irq == ltq_eiu_irq[i]) { 131 130 /* low level - we should really handle set_type */ 132 131 ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_C) | 133 132 (0x6 << (i * 4)), LTQ_EIU_EXIN_C); ··· 146 147 static void ltq_shutdown_eiu_irq(struct irq_data *d) 147 148 { 148 149 int i; 149 - int irq_nr = d->irq - INT_NUM_IRQ0; 150 150 151 151 ltq_disable_irq(d); 152 152 for (i = 0; i < MAX_EIU; i++) { 153 - if (irq_nr == ltq_eiu_irq[i]) { 153 + if (d->irq == ltq_eiu_irq[i]) { 154 154 /* disable */ 155 155 ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~(1 << i), 156 156 LTQ_EIU_EXIN_INEN);
-1
arch/mips/lantiq/xway/ebu.c
··· 10 10 11 11 #include <linux/kernel.h> 12 12 #include <linux/module.h> 13 - #include <linux/version.h> 14 13 #include <linux/ioport.h> 15 14 16 15 #include <lantiq_soc.h>
-1
arch/mips/lantiq/xway/pmu.c
··· 8 8 9 9 #include <linux/kernel.h> 10 10 #include <linux/module.h> 11 - #include <linux/version.h> 12 11 #include <linux/ioport.h> 13 12 14 13 #include <lantiq_soc.h>
+1
arch/mips/lasat/interrupt.c
··· 105 105 static struct irqaction cascade = { 106 106 .handler = no_action, 107 107 .name = "cascade", 108 + .flags = IRQF_NO_THREAD, 108 109 }; 109 110 110 111 void __init arch_init_irq(void)
+1
arch/mips/loongson/fuloong-2e/irq.c
··· 42 42 static struct irqaction cascade_irqaction = { 43 43 .handler = no_action, 44 44 .name = "cascade", 45 + .flags = IRQF_NO_THREAD, 45 46 }; 46 47 47 48 void __init mach_init_irq(void)
+2 -1
arch/mips/loongson/lemote-2f/irq.c
··· 96 96 struct irqaction ip6_irqaction = { 97 97 .handler = ip6_action, 98 98 .name = "cascade", 99 - .flags = IRQF_SHARED, 99 + .flags = IRQF_SHARED | IRQF_NO_THREAD, 100 100 }; 101 101 102 102 struct irqaction cascade_irqaction = { 103 103 .handler = no_action, 104 104 .name = "cascade", 105 + .flags = IRQF_NO_THREAD, 105 106 }; 106 107 107 108 void __init mach_init_irq(void)
+25 -23
arch/mips/mm/mmap.c
··· 6 6 * Copyright (C) 2011 Wind River Systems, 7 7 * written by Ralf Baechle <ralf@linux-mips.org> 8 8 */ 9 + #include <linux/compiler.h> 9 10 #include <linux/errno.h> 10 11 #include <linux/mm.h> 11 12 #include <linux/mman.h> ··· 16 15 #include <linux/sched.h> 17 16 18 17 unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ 19 - 20 18 EXPORT_SYMBOL(shm_align_mask); 21 19 22 20 /* gap between mmap and stack */ 23 21 #define MIN_GAP (128*1024*1024UL) 24 - #define MAX_GAP ((TASK_SIZE)/6*5) 22 + #define MAX_GAP ((TASK_SIZE)/6*5) 25 23 26 24 static int mmap_is_legacy(void) 27 25 { ··· 57 57 return base - off; 58 58 } 59 59 60 - #define COLOUR_ALIGN(addr,pgoff) \ 60 + #define COLOUR_ALIGN(addr, pgoff) \ 61 61 ((((addr) + shm_align_mask) & ~shm_align_mask) + \ 62 62 (((pgoff) << PAGE_SHIFT) & shm_align_mask)) 63 63 64 64 enum mmap_allocation_direction {UP, DOWN}; 65 65 66 - static unsigned long arch_get_unmapped_area_foo(struct file *filp, 66 + static unsigned long arch_get_unmapped_area_common(struct file *filp, 67 67 unsigned long addr0, unsigned long len, unsigned long pgoff, 68 68 unsigned long flags, enum mmap_allocation_direction dir) 69 69 { ··· 103 103 104 104 vma = find_vma(mm, addr); 105 105 if (TASK_SIZE - len >= addr && 106 - (!vma || addr + len <= vma->vm_start)) 106 + (!vma || addr + len <= vma->vm_start)) 107 107 return addr; 108 108 } 109 109 110 110 if (dir == UP) { 111 111 addr = mm->mmap_base; 112 - if (do_color_align) 113 - addr = COLOUR_ALIGN(addr, pgoff); 114 - else 115 - addr = PAGE_ALIGN(addr); 112 + if (do_color_align) 113 + addr = COLOUR_ALIGN(addr, pgoff); 114 + else 115 + addr = PAGE_ALIGN(addr); 116 116 117 117 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) { 118 118 /* At this point: (!vma || addr < vma->vm_end). */ ··· 131 131 mm->free_area_cache = mm->mmap_base; 132 132 } 133 133 134 - /* either no address requested or can't fit in requested address hole */ 134 + /* 135 + * either no address requested, or the mapping can't fit into 136 + * the requested address hole 137 + */ 135 138 addr = mm->free_area_cache; 136 - if (do_color_align) { 137 - unsigned long base = 138 - COLOUR_ALIGN_DOWN(addr - len, pgoff); 139 - 139 + if (do_color_align) { 140 + unsigned long base = 141 + COLOUR_ALIGN_DOWN(addr - len, pgoff); 140 142 addr = base + len; 141 - } 143 + } 142 144 143 145 /* make sure it can fit in the remaining address space */ 144 146 if (likely(addr > len)) { 145 147 vma = find_vma(mm, addr - len); 146 148 if (!vma || addr <= vma->vm_start) { 147 - /* remember the address as a hint for next time */ 148 - return mm->free_area_cache = addr-len; 149 + /* cache the address as a hint for next time */ 150 + return mm->free_area_cache = addr - len; 149 151 } 150 152 } 151 153 152 154 if (unlikely(mm->mmap_base < len)) 153 155 goto bottomup; 154 156 155 - addr = mm->mmap_base-len; 157 + addr = mm->mmap_base - len; 156 158 if (do_color_align) 157 159 addr = COLOUR_ALIGN_DOWN(addr, pgoff); 158 160 ··· 165 163 * return with success: 166 164 */ 167 165 vma = find_vma(mm, addr); 168 - if (likely(!vma || addr+len <= vma->vm_start)) { 169 - /* remember the address as a hint for next time */ 166 + if (likely(!vma || addr + len <= vma->vm_start)) { 167 + /* cache the address as a hint for next time */ 170 168 return mm->free_area_cache = addr; 171 169 } 172 170 ··· 175 173 mm->cached_hole_size = vma->vm_start - addr; 176 174 177 175 /* try just below the current vma->vm_start */ 178 - addr = vma->vm_start-len; 176 + addr = vma->vm_start - len; 179 177 if (do_color_align) 180 178 addr = COLOUR_ALIGN_DOWN(addr, pgoff); 181 179 } while (likely(len < vma->vm_start)); ··· 203 201 unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr0, 204 202 unsigned long len, unsigned long pgoff, unsigned long flags) 205 203 { 206 - return arch_get_unmapped_area_foo(filp, 204 + return arch_get_unmapped_area_common(filp, 207 205 addr0, len, pgoff, flags, UP); 208 206 } 209 207 ··· 215 213 unsigned long addr0, unsigned long len, unsigned long pgoff, 216 214 unsigned long flags) 217 215 { 218 - return arch_get_unmapped_area_foo(filp, 216 + return arch_get_unmapped_area_common(filp, 219 217 addr0, len, pgoff, flags, DOWN); 220 218 } 221 219
+3 -3
arch/mips/mm/tlbex.c
··· 1759 1759 u32 *p = handle_tlbm; 1760 1760 struct uasm_label *l = labels; 1761 1761 struct uasm_reloc *r = relocs; 1762 - struct work_registers wr; 1763 1762 1764 1763 memset(handle_tlbm, 0, sizeof(handle_tlbm)); 1765 1764 memset(labels, 0, sizeof(labels)); 1766 1765 memset(relocs, 0, sizeof(relocs)); 1767 1766 1768 1767 build_r3000_tlbchange_handler_head(&p, K0, K1); 1769 - build_pte_modifiable(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbm); 1768 + build_pte_modifiable(&p, &r, K0, K1, -1, label_nopage_tlbm); 1770 1769 uasm_i_nop(&p); /* load delay */ 1771 1770 build_make_write(&p, &r, K0, K1); 1772 1771 build_r3000_pte_reload_tlbwi(&p, K0, K1); ··· 1962 1963 uasm_i_andi(&p, wr.r3, wr.r3, 2); 1963 1964 uasm_il_beqz(&p, &r, wr.r3, label_tlbl_goaround2); 1964 1965 } 1965 - 1966 + if (PM_DEFAULT_MASK == 0) 1967 + uasm_i_nop(&p); 1966 1968 /* 1967 1969 * We clobbered C0_PAGEMASK, restore it. On the other branch 1968 1970 * it is restored in build_huge_tlb_write_entry.
+4 -2
arch/mips/mti-malta/malta-int.c
··· 350 350 351 351 static struct irqaction i8259irq = { 352 352 .handler = no_action, 353 - .name = "XT-PIC cascade" 353 + .name = "XT-PIC cascade", 354 + .flags = IRQF_NO_THREAD, 354 355 }; 355 356 356 357 static struct irqaction corehi_irqaction = { 357 358 .handler = no_action, 358 - .name = "CoreHi" 359 + .name = "CoreHi", 360 + .flags = IRQF_NO_THREAD, 359 361 }; 360 362 361 363 static msc_irqmap_t __initdata msc_irqmap[] = {
+1 -1
arch/mips/netlogic/xlr/Makefile
··· 2 2 obj-$(CONFIG_SMP) += smp.o smpboot.o 3 3 obj-$(CONFIG_EARLY_PRINTK) += xlr_console.o 4 4 5 - EXTRA_CFLAGS += -Werror 5 + ccflags-y += -Werror
+7 -2
arch/mips/pci/pci-lantiq.c
··· 171 171 u32 temp_buffer; 172 172 173 173 /* set clock to 33Mhz */ 174 - ltq_cgu_w32(ltq_cgu_r32(LTQ_CGU_IFCCR) & ~0xf00000, LTQ_CGU_IFCCR); 175 - ltq_cgu_w32(ltq_cgu_r32(LTQ_CGU_IFCCR) | 0x800000, LTQ_CGU_IFCCR); 174 + if (ltq_is_ar9()) { 175 + ltq_cgu_w32(ltq_cgu_r32(LTQ_CGU_IFCCR) & ~0x1f00000, LTQ_CGU_IFCCR); 176 + ltq_cgu_w32(ltq_cgu_r32(LTQ_CGU_IFCCR) | 0xe00000, LTQ_CGU_IFCCR); 177 + } else { 178 + ltq_cgu_w32(ltq_cgu_r32(LTQ_CGU_IFCCR) & ~0xf00000, LTQ_CGU_IFCCR); 179 + ltq_cgu_w32(ltq_cgu_r32(LTQ_CGU_IFCCR) | 0x800000, LTQ_CGU_IFCCR); 180 + } 176 181 177 182 /* external or internal clock ? */ 178 183 if (conf->clock) {
+1 -1
arch/mips/pci/pci-rc32434.c
··· 215 215 rc32434_pcibridge_init(); 216 216 217 217 io_map_base = ioremap(rc32434_res_pci_io1.start, 218 - resource_size(&rcrc32434_res_pci_io1)); 218 + resource_size(&rc32434_res_pci_io1)); 219 219 220 220 if (!io_map_base) 221 221 return -ENOMEM;
+4 -2
arch/mips/pmc-sierra/msp71xx/msp_irq.c
··· 108 108 109 109 static struct irqaction cic_cascade_msp = { 110 110 .handler = no_action, 111 - .name = "MSP CIC cascade" 111 + .name = "MSP CIC cascade", 112 + .flags = IRQF_NO_THREAD, 112 113 }; 113 114 114 115 static struct irqaction per_cascade_msp = { 115 116 .handler = no_action, 116 - .name = "MSP PER cascade" 117 + .name = "MSP PER cascade", 118 + .flags = IRQF_NO_THREAD, 117 119 }; 118 120 119 121 void __init arch_init_irq(void)
+1 -1
arch/mips/pnx8550/common/int.c
··· 167 167 168 168 static struct irqaction gic_action = { 169 169 .handler = no_action, 170 - .flags = IRQF_DISABLED, 170 + .flags = IRQF_DISABLED | IRQF_NO_THREAD, 171 171 .name = "GIC", 172 172 }; 173 173
+5 -5
arch/mips/sgi-ip22/ip22-int.c
··· 155 155 156 156 static struct irqaction local0_cascade = { 157 157 .handler = no_action, 158 - .flags = IRQF_DISABLED, 158 + .flags = IRQF_DISABLED | IRQF_NO_THREAD, 159 159 .name = "local0 cascade", 160 160 }; 161 161 162 162 static struct irqaction local1_cascade = { 163 163 .handler = no_action, 164 - .flags = IRQF_DISABLED, 164 + .flags = IRQF_DISABLED | IRQF_NO_THREAD, 165 165 .name = "local1 cascade", 166 166 }; 167 167 168 168 static struct irqaction buserr = { 169 169 .handler = no_action, 170 - .flags = IRQF_DISABLED, 170 + .flags = IRQF_DISABLED | IRQF_NO_THREAD, 171 171 .name = "Bus Error", 172 172 }; 173 173 174 174 static struct irqaction map0_cascade = { 175 175 .handler = no_action, 176 - .flags = IRQF_DISABLED, 176 + .flags = IRQF_DISABLED | IRQF_NO_THREAD, 177 177 .name = "mapable0 cascade", 178 178 }; 179 179 180 180 #ifdef USE_LIO3_IRQ 181 181 static struct irqaction map1_cascade = { 182 182 .handler = no_action, 183 - .flags = IRQF_DISABLED, 183 + .flags = IRQF_DISABLED | IRQF_NO_THREAD, 184 184 .name = "mapable1 cascade", 185 185 }; 186 186 #define SGI_INTERRUPTS SGINT_END
+1
arch/mips/sni/rm200.c
··· 359 359 static struct irqaction sni_rm200_irq2 = { 360 360 .handler = no_action, 361 361 .name = "cascade", 362 + .flags = IRQF_NO_THREAD, 362 363 }; 363 364 364 365 static struct resource sni_rm200_pic1_resource = {
+1
arch/mips/vr41xx/common/irq.c
··· 34 34 static struct irqaction cascade_irqaction = { 35 35 .handler = no_action, 36 36 .name = "cascade", 37 + .flags = IRQF_NO_THREAD, 37 38 }; 38 39 39 40 int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int))
+1 -1
arch/sparc/include/asm/pgtsrmmu.h
··· 280 280 return retval; 281 281 } 282 282 #else 283 - #define srmmu_hwprobe(addr) (srmmu_swprobe(addr, 0) & SRMMU_PTE_PMASK) 283 + #define srmmu_hwprobe(addr) srmmu_swprobe(addr, 0) 284 284 #endif 285 285 286 286 static inline int
+2 -1
arch/sparc/kernel/pci.c
··· 230 230 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2]; 231 231 } else if (i == dev->rom_base_reg) { 232 232 res = &dev->resource[PCI_ROM_RESOURCE]; 233 - flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE; 233 + flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE 234 + | IORESOURCE_SIZEALIGN; 234 235 } else { 235 236 printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i); 236 237 continue;
+7 -14
arch/sparc/kernel/signal32.c
··· 273 273 case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32); 274 274 } 275 275 sigdelsetmask(&set, ~_BLOCKABLE); 276 - spin_lock_irq(&current->sighand->siglock); 277 - current->blocked = set; 278 - recalc_sigpending(); 279 - spin_unlock_irq(&current->sighand->siglock); 276 + set_current_blocked(&set); 280 277 return; 281 278 282 279 segv: ··· 374 377 case 1: set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32); 375 378 } 376 379 sigdelsetmask(&set, ~_BLOCKABLE); 377 - spin_lock_irq(&current->sighand->siglock); 378 - current->blocked = set; 379 - recalc_sigpending(); 380 - spin_unlock_irq(&current->sighand->siglock); 380 + set_current_blocked(&set); 381 381 return; 382 382 segv: 383 383 force_sig(SIGSEGV, current); ··· 776 782 siginfo_t *info, 777 783 sigset_t *oldset, struct pt_regs *regs) 778 784 { 785 + sigset_t blocked; 779 786 int err; 780 787 781 788 if (ka->sa.sa_flags & SA_SIGINFO) ··· 787 792 if (err) 788 793 return err; 789 794 790 - spin_lock_irq(&current->sighand->siglock); 791 - sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 795 + sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask); 792 796 if (!(ka->sa.sa_flags & SA_NOMASK)) 793 - sigaddset(&current->blocked,signr); 794 - recalc_sigpending(); 795 - spin_unlock_irq(&current->sighand->siglock); 797 + sigaddset(&blocked, signr); 798 + set_current_blocked(&blocked); 796 799 797 800 tracehook_signal_handler(signr, info, ka, regs, 0); 798 801 ··· 874 881 */ 875 882 if (current_thread_info()->status & TS_RESTORE_SIGMASK) { 876 883 current_thread_info()->status &= ~TS_RESTORE_SIGMASK; 877 - sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 884 + set_current_blocked(&current->saved_sigmask); 878 885 } 879 886 } 880 887
+13 -19
arch/sparc/kernel/signal_32.c
··· 62 62 63 63 static int _sigpause_common(old_sigset_t set) 64 64 { 65 - set &= _BLOCKABLE; 66 - spin_lock_irq(&current->sighand->siglock); 65 + sigset_t blocked; 66 + 67 67 current->saved_sigmask = current->blocked; 68 - siginitset(&current->blocked, set); 69 - recalc_sigpending(); 70 - spin_unlock_irq(&current->sighand->siglock); 68 + 69 + set &= _BLOCKABLE; 70 + siginitset(&blocked, set); 71 + set_current_blocked(&blocked); 71 72 72 73 current->state = TASK_INTERRUPTIBLE; 73 74 schedule(); ··· 140 139 goto segv_and_exit; 141 140 142 141 sigdelsetmask(&set, ~_BLOCKABLE); 143 - spin_lock_irq(&current->sighand->siglock); 144 - current->blocked = set; 145 - recalc_sigpending(); 146 - spin_unlock_irq(&current->sighand->siglock); 142 + set_current_blocked(&set); 147 143 return; 148 144 149 145 segv_and_exit: ··· 207 209 } 208 210 209 211 sigdelsetmask(&set, ~_BLOCKABLE); 210 - spin_lock_irq(&current->sighand->siglock); 211 - current->blocked = set; 212 - recalc_sigpending(); 213 - spin_unlock_irq(&current->sighand->siglock); 212 + set_current_blocked(&set); 214 213 return; 215 214 segv: 216 215 force_sig(SIGSEGV, current); ··· 465 470 handle_signal(unsigned long signr, struct k_sigaction *ka, 466 471 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) 467 472 { 473 + sigset_t blocked; 468 474 int err; 469 475 470 476 if (ka->sa.sa_flags & SA_SIGINFO) ··· 476 480 if (err) 477 481 return err; 478 482 479 - spin_lock_irq(&current->sighand->siglock); 480 - sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 483 + sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask); 481 484 if (!(ka->sa.sa_flags & SA_NOMASK)) 482 - sigaddset(&current->blocked, signr); 483 - recalc_sigpending(); 484 - spin_unlock_irq(&current->sighand->siglock); 485 + sigaddset(&blocked, signr); 486 + set_current_blocked(&blocked); 485 487 486 488 tracehook_signal_handler(signr, info, ka, regs, 0); 487 489 ··· 575 581 */ 576 582 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 577 583 clear_thread_flag(TIF_RESTORE_SIGMASK); 578 - sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 584 + set_current_blocked(&current->saved_sigmask); 579 585 } 580 586 } 581 587
+13 -19
arch/sparc/kernel/signal_64.c
··· 70 70 goto do_sigsegv; 71 71 } 72 72 sigdelsetmask(&set, ~_BLOCKABLE); 73 - spin_lock_irq(&current->sighand->siglock); 74 - current->blocked = set; 75 - recalc_sigpending(); 76 - spin_unlock_irq(&current->sighand->siglock); 73 + set_current_blocked(&set); 77 74 } 78 75 if (test_thread_flag(TIF_32BIT)) { 79 76 pc &= 0xffffffff; ··· 239 242 240 243 static long _sigpause_common(old_sigset_t set) 241 244 { 242 - set &= _BLOCKABLE; 243 - spin_lock_irq(&current->sighand->siglock); 245 + sigset_t blocked; 246 + 244 247 current->saved_sigmask = current->blocked; 245 - siginitset(&current->blocked, set); 246 - recalc_sigpending(); 247 - spin_unlock_irq(&current->sighand->siglock); 248 + 249 + set &= _BLOCKABLE; 250 + siginitset(&blocked, set); 251 + set_current_blocked(&blocked); 248 252 249 253 current->state = TASK_INTERRUPTIBLE; 250 254 schedule(); ··· 325 327 pt_regs_clear_syscall(regs); 326 328 327 329 sigdelsetmask(&set, ~_BLOCKABLE); 328 - spin_lock_irq(&current->sighand->siglock); 329 - current->blocked = set; 330 - recalc_sigpending(); 331 - spin_unlock_irq(&current->sighand->siglock); 330 + set_current_blocked(&set); 332 331 return; 333 332 segv: 334 333 force_sig(SIGSEGV, current); ··· 479 484 siginfo_t *info, 480 485 sigset_t *oldset, struct pt_regs *regs) 481 486 { 487 + sigset_t blocked; 482 488 int err; 483 489 484 490 err = setup_rt_frame(ka, regs, signr, oldset, 485 491 (ka->sa.sa_flags & SA_SIGINFO) ? info : NULL); 486 492 if (err) 487 493 return err; 488 - spin_lock_irq(&current->sighand->siglock); 489 - sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 494 + sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask); 490 495 if (!(ka->sa.sa_flags & SA_NOMASK)) 491 - sigaddset(&current->blocked,signr); 492 - recalc_sigpending(); 493 - spin_unlock_irq(&current->sighand->siglock); 496 + sigaddset(&blocked, signr); 497 + set_current_blocked(&blocked); 494 498 495 499 tracehook_signal_handler(signr, info, ka, regs, 0); 496 500 ··· 595 601 */ 596 602 if (current_thread_info()->status & TS_RESTORE_SIGMASK) { 597 603 current_thread_info()->status &= ~TS_RESTORE_SIGMASK; 598 - sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 604 + set_current_blocked(&current->saved_sigmask); 599 605 } 600 606 } 601 607
+1 -1
arch/sparc/mm/leon_mm.c
··· 162 162 printk(KERN_INFO "swprobe: padde %x\n", paddr_calc); 163 163 if (paddr) 164 164 *paddr = paddr_calc; 165 - return paddrbase; 165 + return pte; 166 166 } 167 167 168 168 void leon_flush_icache_all(void)
+1 -1
arch/tile/kernel/intvec_32.S
··· 21 21 #include <asm/ptrace.h> 22 22 #include <asm/thread_info.h> 23 23 #include <asm/irqflags.h> 24 - #include <linux/atomic.h> 24 + #include <asm/atomic_32.h> 25 25 #include <asm/asm-offsets.h> 26 26 #include <hv/hypervisor.h> 27 27 #include <arch/abi.h>
+1 -1
arch/tile/lib/atomic_asm_32.S
··· 70 70 */ 71 71 72 72 #include <linux/linkage.h> 73 - #include <linux/atomic.h> 73 + #include <asm/atomic_32.h> 74 74 #include <asm/page.h> 75 75 #include <asm/processor.h> 76 76
+1 -1
arch/x86/kernel/vsyscall_64.c
··· 56 56 .lock = __SEQLOCK_UNLOCKED(__vsyscall_gtod_data.lock), 57 57 }; 58 58 59 - static enum { EMULATE, NATIVE, NONE } vsyscall_mode = EMULATE; 59 + static enum { EMULATE, NATIVE, NONE } vsyscall_mode = NATIVE; 60 60 61 61 static int __init vsyscall_setup(char *str) 62 62 {
+12 -10
arch/x86/platform/mrst/mrst.c
··· 678 678 pentry = (struct sfi_device_table_entry *)sb->pentry; 679 679 680 680 for (i = 0; i < num; i++, pentry++) { 681 - if (pentry->irq != (u8)0xff) { /* native RTE case */ 681 + int irq = pentry->irq; 682 + 683 + if (irq != (u8)0xff) { /* native RTE case */ 682 684 /* these SPI2 devices are not exposed to system as PCI 683 685 * devices, but they have separate RTE entry in IOAPIC 684 686 * so we have to enable them one by one here 685 687 */ 686 - ioapic = mp_find_ioapic(pentry->irq); 688 + ioapic = mp_find_ioapic(irq); 687 689 irq_attr.ioapic = ioapic; 688 - irq_attr.ioapic_pin = pentry->irq; 690 + irq_attr.ioapic_pin = irq; 689 691 irq_attr.trigger = 1; 690 692 irq_attr.polarity = 1; 691 - io_apic_set_pci_routing(NULL, pentry->irq, &irq_attr); 693 + io_apic_set_pci_routing(NULL, irq, &irq_attr); 692 694 } else 693 - pentry->irq = 0; /* No irq */ 695 + irq = 0; /* No irq */ 694 696 695 697 switch (pentry->type) { 696 698 case SFI_DEV_TYPE_IPC: 697 699 /* ID as IRQ is a hack that will go away */ 698 - pdev = platform_device_alloc(pentry->name, pentry->irq); 700 + pdev = platform_device_alloc(pentry->name, irq); 699 701 if (pdev == NULL) { 700 702 pr_err("out of memory for SFI platform device '%s'.\n", 701 703 pentry->name); 702 704 continue; 703 705 } 704 - install_irq_resource(pdev, pentry->irq); 706 + install_irq_resource(pdev, irq); 705 707 pr_debug("info[%2d]: IPC bus, name = %16.16s, " 706 - "irq = 0x%2x\n", i, pentry->name, pentry->irq); 708 + "irq = 0x%2x\n", i, pentry->name, irq); 707 709 sfi_handle_ipc_dev(pdev); 708 710 break; 709 711 case SFI_DEV_TYPE_SPI: 710 712 memset(&spi_info, 0, sizeof(spi_info)); 711 713 strncpy(spi_info.modalias, pentry->name, SFI_NAME_LEN); 712 - spi_info.irq = pentry->irq; 714 + spi_info.irq = irq; 713 715 spi_info.bus_num = pentry->host_num; 714 716 spi_info.chip_select = pentry->addr; 715 717 spi_info.max_speed_hz = pentry->max_freq; ··· 728 726 memset(&i2c_info, 0, sizeof(i2c_info)); 729 727 bus = pentry->host_num; 730 728 strncpy(i2c_info.type, pentry->name, SFI_NAME_LEN); 731 - i2c_info.irq = pentry->irq; 729 + i2c_info.irq = irq; 732 730 i2c_info.addr = pentry->addr; 733 731 pr_debug("info[%2d]: I2C bus = %d, name = %16.16s, " 734 732 "irq = 0x%2x, addr = 0x%x\n", i, bus,
+1 -1
drivers/gpio/gpio-omap.c
··· 34 34 u16 irq; 35 35 u16 virtual_irq_start; 36 36 int method; 37 - #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 38 37 u32 suspend_wakeup; 38 + #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 39 39 u32 saved_wakeup; 40 40 #endif 41 41 u32 non_wakeup_gpios;
+1
drivers/gpio/gpio-pca953x.c
··· 577 577 void 578 578 pca953x_get_alt_pdata(struct i2c_client *client, int *gpio_base, int *invert) 579 579 { 580 + *gpio_base = -1; 580 581 } 581 582 #endif 582 583
+13 -2
drivers/gpu/drm/radeon/atom.c
··· 277 277 case ATOM_ARG_FB: 278 278 idx = U8(*ptr); 279 279 (*ptr)++; 280 - val = gctx->scratch[((gctx->fb_base + idx) / 4)]; 280 + if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) { 281 + DRM_ERROR("ATOM: fb read beyond scratch region: %d vs. %d\n", 282 + gctx->fb_base + (idx * 4), gctx->scratch_size_bytes); 283 + val = 0; 284 + } else 285 + val = gctx->scratch[(gctx->fb_base / 4) + idx]; 281 286 if (print) 282 287 DEBUG("FB[0x%02X]", idx); 283 288 break; ··· 536 531 case ATOM_ARG_FB: 537 532 idx = U8(*ptr); 538 533 (*ptr)++; 539 - gctx->scratch[((gctx->fb_base + idx) / 4)] = val; 534 + if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) { 535 + DRM_ERROR("ATOM: fb write beyond scratch region: %d vs. %d\n", 536 + gctx->fb_base + (idx * 4), gctx->scratch_size_bytes); 537 + } else 538 + gctx->scratch[(gctx->fb_base / 4) + idx] = val; 540 539 DEBUG("FB[0x%02X]", idx); 541 540 break; 542 541 case ATOM_ARG_PLL: ··· 1379 1370 1380 1371 usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024; 1381 1372 } 1373 + ctx->scratch_size_bytes = 0; 1382 1374 if (usage_bytes == 0) 1383 1375 usage_bytes = 20 * 1024; 1384 1376 /* allocate some scratch memory */ 1385 1377 ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); 1386 1378 if (!ctx->scratch) 1387 1379 return -ENOMEM; 1380 + ctx->scratch_size_bytes = usage_bytes; 1388 1381 return 0; 1389 1382 }
+1
drivers/gpu/drm/radeon/atom.h
··· 137 137 int cs_equal, cs_above; 138 138 int io_mode; 139 139 uint32_t *scratch; 140 + int scratch_size_bytes; 140 141 }; 141 142 142 143 extern int atom_debug;
+1 -1
drivers/gpu/drm/radeon/atombios_crtc.c
··· 466 466 return; 467 467 } 468 468 args.v2.ucEnable = enable; 469 - if ((ss->percentage == 0) || (ss->type & ATOM_EXTERNAL_SS_MASK)) 469 + if ((ss->percentage == 0) || (ss->type & ATOM_EXTERNAL_SS_MASK) || ASIC_IS_DCE41(rdev)) 470 470 args.v2.ucEnable = ATOM_DISABLE; 471 471 } else if (ASIC_IS_DCE3(rdev)) { 472 472 args.v1.usSpreadSpectrumPercentage = cpu_to_le16(ss->percentage);
+9 -3
drivers/gpu/drm/radeon/atombios_dp.c
··· 129 129 for (retry = 0; retry < 4; retry++) { 130 130 ret = radeon_process_aux_ch(dig_connector->dp_i2c_bus, 131 131 msg, msg_bytes, NULL, 0, delay, &ack); 132 - if (ret < 0) 132 + if (ret == -EBUSY) 133 + continue; 134 + else if (ret < 0) 133 135 return ret; 134 136 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK) 135 137 return send_bytes; ··· 162 160 for (retry = 0; retry < 4; retry++) { 163 161 ret = radeon_process_aux_ch(dig_connector->dp_i2c_bus, 164 162 msg, msg_bytes, recv, recv_bytes, delay, &ack); 165 - if (ret < 0) 163 + if (ret == -EBUSY) 164 + continue; 165 + else if (ret < 0) 166 166 return ret; 167 167 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK) 168 168 return ret; ··· 240 236 for (retry = 0; retry < 4; retry++) { 241 237 ret = radeon_process_aux_ch(auxch, 242 238 msg, msg_bytes, reply, reply_bytes, 0, &ack); 243 - if (ret < 0) { 239 + if (ret == -EBUSY) 240 + continue; 241 + else if (ret < 0) { 244 242 DRM_DEBUG_KMS("aux_ch failed %d\n", ret); 245 243 return ret; 246 244 }
+6 -15
drivers/gpu/drm/radeon/radeon_connectors.c
··· 1303 1303 /* get the DPCD from the bridge */ 1304 1304 radeon_dp_getdpcd(radeon_connector); 1305 1305 1306 - if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) 1307 - ret = connector_status_connected; 1308 - else { 1309 - /* need to setup ddc on the bridge */ 1310 - if (encoder) 1311 - radeon_atom_ext_encoder_setup_ddc(encoder); 1306 + if (encoder) { 1307 + /* setup ddc on the bridge */ 1308 + radeon_atom_ext_encoder_setup_ddc(encoder); 1312 1309 if (radeon_ddc_probe(radeon_connector, 1313 - radeon_connector->requires_extended_probe)) 1310 + radeon_connector->requires_extended_probe)) /* try DDC */ 1314 1311 ret = connector_status_connected; 1315 - } 1316 - 1317 - if ((ret == connector_status_disconnected) && 1318 - radeon_connector->dac_load_detect) { 1319 - struct drm_encoder *encoder = radeon_best_single_encoder(connector); 1320 - struct drm_encoder_helper_funcs *encoder_funcs; 1321 - if (encoder) { 1322 - encoder_funcs = encoder->helper_private; 1312 + else if (radeon_connector->dac_load_detect) { /* try load detection */ 1313 + struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 1323 1314 ret = encoder_funcs->detect(encoder, connector); 1324 1315 } 1325 1316 }
+22 -4
drivers/gpu/drm/radeon/radeon_encoders.c
··· 1638 1638 break; 1639 1639 case 2: 1640 1640 args.v2.ucCRTC = radeon_crtc->crtc_id; 1641 - args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); 1641 + if (radeon_encoder_is_dp_bridge(encoder)) { 1642 + struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); 1643 + 1644 + if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) 1645 + args.v2.ucEncodeMode = ATOM_ENCODER_MODE_LVDS; 1646 + else if (connector->connector_type == DRM_MODE_CONNECTOR_VGA) 1647 + args.v2.ucEncodeMode = ATOM_ENCODER_MODE_CRT; 1648 + else 1649 + args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); 1650 + } else 1651 + args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); 1642 1652 switch (radeon_encoder->encoder_id) { 1643 1653 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: 1644 1654 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: ··· 1765 1755 /* DCE4/5 */ 1766 1756 if (ASIC_IS_DCE4(rdev)) { 1767 1757 dig = radeon_encoder->enc_priv; 1768 - if (ASIC_IS_DCE41(rdev)) 1769 - return radeon_crtc->crtc_id; 1770 - else { 1758 + if (ASIC_IS_DCE41(rdev)) { 1759 + /* ontario follows DCE4 */ 1760 + if (rdev->family == CHIP_PALM) { 1761 + if (dig->linkb) 1762 + return 1; 1763 + else 1764 + return 0; 1765 + } else 1766 + /* llano follows DCE3.2 */ 1767 + return radeon_crtc->crtc_id; 1768 + } else { 1771 1769 switch (radeon_encoder->encoder_id) { 1772 1770 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: 1773 1771 if (dig->linkb)
+1 -1
drivers/gpu/drm/ttm/ttm_bo_util.c
··· 321 321 struct ttm_mem_type_manager *man = &bdev->man[new_mem->mem_type]; 322 322 struct ttm_tt *ttm = bo->ttm; 323 323 struct ttm_mem_reg *old_mem = &bo->mem; 324 - struct ttm_mem_reg old_copy; 324 + struct ttm_mem_reg old_copy = *old_mem; 325 325 void *old_iomap; 326 326 void *new_iomap; 327 327 int ret;
+11 -4
drivers/hwmon/w83627ehf.c
··· 1715 1715 } 1716 1716 1717 1717 /* Get the monitoring functions started */ 1718 - static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data) 1718 + static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data, 1719 + enum kinds kind) 1719 1720 { 1720 1721 int i; 1721 1722 u8 tmp, diode; ··· 1747 1746 w83627ehf_write_value(data, W83627EHF_REG_VBAT, tmp | 0x01); 1748 1747 1749 1748 /* Get thermal sensor types */ 1750 - diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE); 1749 + switch (kind) { 1750 + case w83627ehf: 1751 + diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE); 1752 + break; 1753 + default: 1754 + diode = 0x70; 1755 + } 1751 1756 for (i = 0; i < 3; i++) { 1752 1757 if ((tmp & (0x02 << i))) 1753 - data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 2; 1758 + data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3; 1754 1759 else 1755 1760 data->temp_type[i] = 4; /* thermistor */ 1756 1761 } ··· 2023 2016 } 2024 2017 2025 2018 /* Initialize the chip */ 2026 - w83627ehf_init_device(data); 2019 + w83627ehf_init_device(data, sio_data->kind); 2027 2020 2028 2021 data->vrm = vid_which_vrm(); 2029 2022 superio_enter(sio_data->sioreg);
+12 -12
drivers/ide/Kconfig
··· 327 327 select BLK_DEV_IDEPCI 328 328 help 329 329 This is a driver for the OPTi 82C621 EIDE controller. 330 - Please read the comments at the top of <file:drivers/ide/pci/opti621.c>. 330 + Please read the comments at the top of <file:drivers/ide/opti621.c>. 331 331 332 332 config BLK_DEV_RZ1000 333 333 tristate "RZ1000 chipset bugfix/support" ··· 365 365 normal dual channel support. 366 366 367 367 Please read the comments at the top of 368 - <file:drivers/ide/pci/alim15x3.c>. 368 + <file:drivers/ide/alim15x3.c>. 369 369 370 370 If unsure, say N. 371 371 ··· 528 528 This driver adds detection and support for the NS87415 chip 529 529 (used mainly on SPARC64 and PA-RISC machines). 530 530 531 - Please read the comments at the top of <file:drivers/ide/pci/ns87415.c>. 531 + Please read the comments at the top of <file:drivers/ide/ns87415.c>. 532 532 533 533 config BLK_DEV_PDC202XX_OLD 534 534 tristate "PROMISE PDC202{46|62|65|67} support" ··· 547 547 for more than one card. 548 548 549 549 Please read the comments at the top of 550 - <file:drivers/ide/pci/pdc202xx_old.c>. 550 + <file:drivers/ide/pdc202xx_old.c>. 551 551 552 552 If unsure, say N. 553 553 ··· 593 593 ATA100: SiS635, SiS645, SiS650, SiS730, SiS735, SiS740, 594 594 SiS745, SiS750 595 595 596 - Please read the comments at the top of <file:drivers/ide/pci/sis5513.c>. 596 + Please read the comments at the top of <file:drivers/ide/sis5513.c>. 597 597 598 598 config BLK_DEV_SL82C105 599 599 tristate "Winbond SL82c105 support" ··· 616 616 look-a-like to the PIIX4 it should be a nice addition. 617 617 618 618 Please read the comments at the top of 619 - <file:drivers/ide/pci/slc90e66.c>. 619 + <file:drivers/ide/slc90e66.c>. 620 620 621 621 config BLK_DEV_TRM290 622 622 tristate "Tekram TRM290 chipset support" ··· 625 625 This driver adds support for bus master DMA transfers 626 626 using the Tekram TRM290 PCI IDE chip. Volunteers are 627 627 needed for further tweaking and development. 628 - Please read the comments at the top of <file:drivers/ide/pci/trm290.c>. 628 + Please read the comments at the top of <file:drivers/ide/trm290.c>. 629 629 630 630 config BLK_DEV_VIA82CXXX 631 631 tristate "VIA82CXXX chipset support" ··· 836 836 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster 837 837 I/O speeds to be set as well. 838 838 See the files <file:Documentation/ide/ide.txt> and 839 - <file:drivers/ide/legacy/ali14xx.c> for more info. 839 + <file:drivers/ide/ali14xx.c> for more info. 840 840 841 841 config BLK_DEV_DTC2278 842 842 tristate "DTC-2278 support" ··· 847 847 boot parameter. It enables support for the secondary IDE interface 848 848 of the DTC-2278 card, and permits faster I/O speeds to be set as 849 849 well. See the <file:Documentation/ide/ide.txt> and 850 - <file:drivers/ide/legacy/dtc2278.c> files for more info. 850 + <file:drivers/ide/dtc2278.c> files for more info. 851 851 852 852 config BLK_DEV_HT6560B 853 853 tristate "Holtek HT6560B support" ··· 858 858 boot parameter. It enables support for the secondary IDE interface 859 859 of the Holtek card, and permits faster I/O speeds to be set as well. 860 860 See the <file:Documentation/ide/ide.txt> and 861 - <file:drivers/ide/legacy/ht6560b.c> files for more info. 861 + <file:drivers/ide/ht6560b.c> files for more info. 862 862 863 863 config BLK_DEV_QD65XX 864 864 tristate "QDI QD65xx support" ··· 867 867 help 868 868 This driver is enabled at runtime using the "qd65xx.probe" kernel 869 869 boot parameter. It permits faster I/O speeds to be set. See the 870 - <file:Documentation/ide/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> 870 + <file:Documentation/ide/ide.txt> and <file:drivers/ide/qd65xx.c> 871 871 for more info. 872 872 873 873 config BLK_DEV_UMC8672 ··· 879 879 boot parameter. It enables support for the secondary IDE interface 880 880 of the UMC-8672, and permits faster I/O speeds to be set as well. 881 881 See the files <file:Documentation/ide/ide.txt> and 882 - <file:drivers/ide/legacy/umc8672.c> for more info. 882 + <file:drivers/ide/umc8672.c> for more info. 883 883 884 884 endif 885 885
+1 -1
drivers/media/video/v4l2-dev.c
··· 181 181 * TODO: In the long run all drivers that use v4l2_device should use the 182 182 * v4l2_device release callback. This check will then be unnecessary. 183 183 */ 184 - if (v4l2_dev->release == NULL) 184 + if (v4l2_dev && v4l2_dev->release == NULL) 185 185 v4l2_dev = NULL; 186 186 187 187 /* Release video_device and perform other
+5 -2
drivers/net/bonding/bond_main.c
··· 1432 1432 struct sk_buff *skb = *pskb; 1433 1433 struct slave *slave; 1434 1434 struct bonding *bond; 1435 + void (*recv_probe)(struct sk_buff *, struct bonding *, 1436 + struct slave *); 1435 1437 1436 1438 skb = skb_share_check(skb, GFP_ATOMIC); 1437 1439 if (unlikely(!skb)) ··· 1447 1445 if (bond->params.arp_interval) 1448 1446 slave->dev->last_rx = jiffies; 1449 1447 1450 - if (bond->recv_probe) { 1448 + recv_probe = ACCESS_ONCE(bond->recv_probe); 1449 + if (recv_probe) { 1451 1450 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); 1452 1451 1453 1452 if (likely(nskb)) { 1454 - bond->recv_probe(nskb, bond, slave); 1453 + recv_probe(nskb, bond, slave); 1455 1454 dev_kfree_skb(nskb); 1456 1455 } 1457 1456 }
+8 -3
drivers/net/can/mscan/mscan.c
··· 261 261 void __iomem *data = &regs->tx.dsr1_0; 262 262 u16 *payload = (u16 *)frame->data; 263 263 264 - /* It is safe to write into dsr[dlc+1] */ 265 - for (i = 0; i < (frame->can_dlc + 1) / 2; i++) { 264 + for (i = 0; i < frame->can_dlc / 2; i++) { 266 265 out_be16(data, *payload++); 267 266 data += 2 + _MSCAN_RESERVED_DSR_SIZE; 268 267 } 268 + /* write remaining byte if necessary */ 269 + if (frame->can_dlc & 1) 270 + out_8(data, frame->data[frame->can_dlc - 1]); 269 271 } 270 272 271 273 out_8(&regs->tx.dlr, frame->can_dlc); ··· 332 330 void __iomem *data = &regs->rx.dsr1_0; 333 331 u16 *payload = (u16 *)frame->data; 334 332 335 - for (i = 0; i < (frame->can_dlc + 1) / 2; i++) { 333 + for (i = 0; i < frame->can_dlc / 2; i++) { 336 334 *payload++ = in_be16(data); 337 335 data += 2 + _MSCAN_RESERVED_DSR_SIZE; 338 336 } 337 + /* read remaining byte if necessary */ 338 + if (frame->can_dlc & 1) 339 + frame->data[frame->can_dlc - 1] = in_8(data); 339 340 } 340 341 341 342 out_8(&regs->canrflg, MSCAN_RXF);
+12 -6
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
··· 234 234 * FUNC_N_CLID_X = N * NUM_SPECIAL_CLIENTS + FUNC_0_CLID_X 235 235 * 236 236 */ 237 - /* iSCSI L2 */ 238 - #define BNX2X_ISCSI_ETH_CL_ID_IDX 1 239 - #define BNX2X_ISCSI_ETH_CID 49 237 + enum { 238 + BNX2X_ISCSI_ETH_CL_ID_IDX, 239 + BNX2X_FCOE_ETH_CL_ID_IDX, 240 + BNX2X_MAX_CNIC_ETH_CL_ID_IDX, 241 + }; 240 242 241 - /* FCoE L2 */ 242 - #define BNX2X_FCOE_ETH_CL_ID_IDX 2 243 - #define BNX2X_FCOE_ETH_CID 50 243 + #define BNX2X_CNIC_START_ETH_CID 48 244 + enum { 245 + /* iSCSI L2 */ 246 + BNX2X_ISCSI_ETH_CID = BNX2X_CNIC_START_ETH_CID, 247 + /* FCoE L2 */ 248 + BNX2X_FCOE_ETH_CID, 249 + }; 244 250 245 251 /** Additional rings budgeting */ 246 252 #ifdef BCM_CNIC
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
··· 1297 1297 static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx) 1298 1298 { 1299 1299 return bp->cnic_base_cl_id + cl_idx + 1300 - (bp->pf_num >> 1) * NON_ETH_CONTEXT_USE; 1300 + (bp->pf_num >> 1) * BNX2X_MAX_CNIC_ETH_CL_ID_IDX; 1301 1301 } 1302 1302 1303 1303 static inline u8 bnx2x_cnic_fw_sb_id(struct bnx2x *bp)
+5 -5
drivers/net/ethernet/broadcom/tg3.c
··· 6529 6529 6530 6530 /* Workaround 4GB and 40-bit hardware DMA bugs. */ 6531 6531 static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, 6532 - struct sk_buff *skb, 6532 + struct sk_buff **pskb, 6533 6533 u32 *entry, u32 *budget, 6534 6534 u32 base_flags, u32 mss, u32 vlan) 6535 6535 { 6536 6536 struct tg3 *tp = tnapi->tp; 6537 - struct sk_buff *new_skb; 6537 + struct sk_buff *new_skb, *skb = *pskb; 6538 6538 dma_addr_t new_addr = 0; 6539 6539 int ret = 0; 6540 6540 ··· 6576 6576 } 6577 6577 6578 6578 dev_kfree_skb(skb); 6579 - 6579 + *pskb = new_skb; 6580 6580 return ret; 6581 6581 } 6582 6582 ··· 6803 6803 */ 6804 6804 entry = tnapi->tx_prod; 6805 6805 budget = tg3_tx_avail(tnapi); 6806 - if (tigon3_dma_hwbug_workaround(tnapi, skb, &entry, &budget, 6806 + if (tigon3_dma_hwbug_workaround(tnapi, &skb, &entry, &budget, 6807 6807 base_flags, mss, vlan)) 6808 6808 goto out_unlock; 6809 6809 } ··· 15668 15668 15669 15669 cancel_work_sync(&tp->reset_task); 15670 15670 15671 - if (!tg3_flag(tp, USE_PHYLIB)) { 15671 + if (tg3_flag(tp, USE_PHYLIB)) { 15672 15672 tg3_phy_fini(tp); 15673 15673 tg3_mdio_fini(tp); 15674 15674 }
+6
drivers/net/ethernet/jme.c
··· 3132 3132 struct net_device *netdev = pci_get_drvdata(pdev); 3133 3133 struct jme_adapter *jme = netdev_priv(netdev); 3134 3134 3135 + if (!netif_running(netdev)) 3136 + return 0; 3137 + 3135 3138 atomic_dec(&jme->link_changing); 3136 3139 3137 3140 netif_device_detach(netdev); ··· 3174 3171 struct pci_dev *pdev = to_pci_dev(dev); 3175 3172 struct net_device *netdev = pci_get_drvdata(pdev); 3176 3173 struct jme_adapter *jme = netdev_priv(netdev); 3174 + 3175 + if (!netif_running(netdev)) 3176 + return 0; 3177 3177 3178 3178 jme_clear_pm(jme); 3179 3179 jme_phy_on(jme);
+3 -3
drivers/net/ethernet/mellanox/mlx4/en_tx.c
··· 172 172 memset(ring->buf, 0, ring->buf_size); 173 173 174 174 ring->qp_state = MLX4_QP_STATE_RST; 175 - ring->doorbell_qpn = swab32(ring->qp.qpn << 8); 175 + ring->doorbell_qpn = ring->qp.qpn << 8; 176 176 177 177 mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn, 178 178 ring->cqn, &ring->context); ··· 779 779 skb_orphan(skb); 780 780 781 781 if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) { 782 - *(u32 *) (&tx_desc->ctrl.vlan_tag) |= ring->doorbell_qpn; 782 + *(__be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn); 783 783 op_own |= htonl((bf_index & 0xffff) << 8); 784 784 /* Ensure new descirptor hits memory 785 785 * before setting ownership of this descriptor to HW */ ··· 800 800 wmb(); 801 801 tx_desc->ctrl.owner_opcode = op_own; 802 802 wmb(); 803 - writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL); 803 + iowrite32be(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL); 804 804 } 805 805 806 806 /* Poll CQ here */
+57 -33
drivers/net/ethernet/realtek/r8169.c
··· 2937 2937 rtl_writephy(tp, 0x1f, 0x0004); 2938 2938 rtl_writephy(tp, 0x1f, 0x0007); 2939 2939 rtl_writephy(tp, 0x1e, 0x0020); 2940 - rtl_w1w0_phy(tp, 0x06, 0x0000, 0x0100); 2940 + rtl_w1w0_phy(tp, 0x15, 0x0000, 0x0100); 2941 2941 rtl_writephy(tp, 0x1f, 0x0002); 2942 2942 rtl_writephy(tp, 0x1f, 0x0000); 2943 2943 rtl_writephy(tp, 0x0d, 0x0007); ··· 3491 3491 } 3492 3492 } 3493 3493 3494 + static void rtl_wol_suspend_quirk(struct rtl8169_private *tp) 3495 + { 3496 + void __iomem *ioaddr = tp->mmio_addr; 3497 + 3498 + switch (tp->mac_version) { 3499 + case RTL_GIGA_MAC_VER_29: 3500 + case RTL_GIGA_MAC_VER_30: 3501 + case RTL_GIGA_MAC_VER_32: 3502 + case RTL_GIGA_MAC_VER_33: 3503 + case RTL_GIGA_MAC_VER_34: 3504 + RTL_W32(RxConfig, RTL_R32(RxConfig) | 3505 + AcceptBroadcast | AcceptMulticast | AcceptMyPhys); 3506 + break; 3507 + default: 3508 + break; 3509 + } 3510 + } 3511 + 3512 + static bool rtl_wol_pll_power_down(struct rtl8169_private *tp) 3513 + { 3514 + if (!(__rtl8169_get_wol(tp) & WAKE_ANY)) 3515 + return false; 3516 + 3517 + rtl_writephy(tp, 0x1f, 0x0000); 3518 + rtl_writephy(tp, MII_BMCR, 0x0000); 3519 + 3520 + rtl_wol_suspend_quirk(tp); 3521 + 3522 + return true; 3523 + } 3524 + 3494 3525 static void r810x_phy_power_down(struct rtl8169_private *tp) 3495 3526 { 3496 3527 rtl_writephy(tp, 0x1f, 0x0000); ··· 3536 3505 3537 3506 static void r810x_pll_power_down(struct rtl8169_private *tp) 3538 3507 { 3539 - void __iomem *ioaddr = tp->mmio_addr; 3540 - 3541 - if (__rtl8169_get_wol(tp) & WAKE_ANY) { 3542 - rtl_writephy(tp, 0x1f, 0x0000); 3543 - rtl_writephy(tp, MII_BMCR, 0x0000); 3544 - 3545 - if (tp->mac_version == RTL_GIGA_MAC_VER_29 || 3546 - tp->mac_version == RTL_GIGA_MAC_VER_30) 3547 - RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | 3548 - AcceptMulticast | AcceptMyPhys); 3508 + if (rtl_wol_pll_power_down(tp)) 3549 3509 return; 3550 - } 3551 3510 3552 3511 r810x_phy_power_down(tp); 3553 3512 } ··· 3626 3605 tp->mac_version == RTL_GIGA_MAC_VER_33) 3627 3606 rtl_ephy_write(ioaddr, 0x19, 0xff64); 3628 3607 3629 - if (__rtl8169_get_wol(tp) & WAKE_ANY) { 3630 - rtl_writephy(tp, 0x1f, 0x0000); 3631 - rtl_writephy(tp, MII_BMCR, 0x0000); 3632 - 3633 - if (tp->mac_version == RTL_GIGA_MAC_VER_32 || 3634 - tp->mac_version == RTL_GIGA_MAC_VER_33 || 3635 - tp->mac_version == RTL_GIGA_MAC_VER_34) 3636 - RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | 3637 - AcceptMulticast | AcceptMyPhys); 3608 + if (rtl_wol_pll_power_down(tp)) 3638 3609 return; 3639 - } 3640 3610 3641 3611 r8168_phy_power_down(tp); 3642 3612 ··· 6173 6161 6174 6162 #endif /* !CONFIG_PM */ 6175 6163 6164 + static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp) 6165 + { 6166 + void __iomem *ioaddr = tp->mmio_addr; 6167 + 6168 + /* WoL fails with 8168b when the receiver is disabled. */ 6169 + switch (tp->mac_version) { 6170 + case RTL_GIGA_MAC_VER_11: 6171 + case RTL_GIGA_MAC_VER_12: 6172 + case RTL_GIGA_MAC_VER_17: 6173 + pci_clear_master(tp->pci_dev); 6174 + 6175 + RTL_W8(ChipCmd, CmdRxEnb); 6176 + /* PCI commit */ 6177 + RTL_R8(ChipCmd); 6178 + break; 6179 + default: 6180 + break; 6181 + } 6182 + } 6183 + 6176 6184 static void rtl_shutdown(struct pci_dev *pdev) 6177 6185 { 6178 6186 struct net_device *dev = pci_get_drvdata(pdev); 6179 6187 struct rtl8169_private *tp = netdev_priv(dev); 6180 - void __iomem *ioaddr = tp->mmio_addr; 6181 6188 6182 6189 rtl8169_net_suspend(dev); 6183 6190 ··· 6210 6179 spin_unlock_irq(&tp->lock); 6211 6180 6212 6181 if (system_state == SYSTEM_POWER_OFF) { 6213 - /* WoL fails with 8168b when the receiver is disabled. */ 6214 - if ((tp->mac_version == RTL_GIGA_MAC_VER_11 || 6215 - tp->mac_version == RTL_GIGA_MAC_VER_12 || 6216 - tp->mac_version == RTL_GIGA_MAC_VER_17) && 6217 - (tp->features & RTL_FEATURE_WOL)) { 6218 - pci_clear_master(pdev); 6219 - 6220 - RTL_W8(ChipCmd, CmdRxEnb); 6221 - /* PCI commit */ 6222 - RTL_R8(ChipCmd); 6182 + if (__rtl8169_get_wol(tp) & WAKE_ANY) { 6183 + rtl_wol_suspend_quirk(tp); 6184 + rtl_wol_shutdown_quirk(tp); 6223 6185 } 6224 6186 6225 6187 pci_wake_from_d3(pdev, true);
+2
drivers/net/ethernet/smsc/smsc911x.c
··· 26 26 * LAN9215, LAN9216, LAN9217, LAN9218 27 27 * LAN9210, LAN9211 28 28 * LAN9220, LAN9221 29 + * LAN89218 29 30 * 30 31 */ 31 32 ··· 1988 1987 case 0x01170000: 1989 1988 case 0x01160000: 1990 1989 case 0x01150000: 1990 + case 0x218A0000: 1991 1991 /* LAN911[5678] family */ 1992 1992 pdata->generation = pdata->idrev & 0x0000FFFF; 1993 1993 break;
+5
drivers/net/netconsole.c
··· 307 307 return err; 308 308 if (enabled < 0 || enabled > 1) 309 309 return -EINVAL; 310 + if (enabled == nt->enabled) { 311 + printk(KERN_INFO "netconsole: network logging has already %s\n", 312 + nt->enabled ? "started" : "stopped"); 313 + return -EINVAL; 314 + } 310 315 311 316 if (enabled) { /* 1 */ 312 317
+1 -1
drivers/net/phy/mdio-gpio.c
··· 241 241 242 242 static struct platform_driver mdio_ofgpio_driver = { 243 243 .driver = { 244 - .name = "mdio-gpio", 244 + .name = "mdio-ofgpio", 245 245 .owner = THIS_MODULE, 246 246 .of_match_table = mdio_ofgpio_match, 247 247 },
+14 -8
drivers/net/ppp/pptp.c
··· 285 285 ip_send_check(iph); 286 286 287 287 ip_local_out(skb); 288 + return 1; 288 289 289 290 tx_error: 291 + kfree_skb(skb); 290 292 return 1; 291 293 } 292 294 ··· 307 305 } 308 306 309 307 header = (struct pptp_gre_header *)(skb->data); 308 + headersize = sizeof(*header); 310 309 311 310 /* test if acknowledgement present */ 312 311 if (PPTP_GRE_IS_A(header->ver)) { 313 - __u32 ack = (PPTP_GRE_IS_S(header->flags)) ? 314 - header->ack : header->seq; /* ack in different place if S = 0 */ 312 + __u32 ack; 313 + 314 + if (!pskb_may_pull(skb, headersize)) 315 + goto drop; 316 + header = (struct pptp_gre_header *)(skb->data); 317 + 318 + /* ack in different place if S = 0 */ 319 + ack = PPTP_GRE_IS_S(header->flags) ? header->ack : header->seq; 315 320 316 321 ack = ntohl(ack); 317 322 ··· 327 318 /* also handle sequence number wrap-around */ 328 319 if (WRAPPED(ack, opt->ack_recv)) 329 320 opt->ack_recv = ack; 321 + } else { 322 + headersize -= sizeof(header->ack); 330 323 } 331 - 332 324 /* test if payload present */ 333 325 if (!PPTP_GRE_IS_S(header->flags)) 334 326 goto drop; 335 327 336 - headersize = sizeof(*header); 337 328 payload_len = ntohs(header->payload_len); 338 329 seq = ntohl(header->seq); 339 330 340 - /* no ack present? */ 341 - if (!PPTP_GRE_IS_A(header->ver)) 342 - headersize -= sizeof(header->ack); 343 331 /* check for incomplete packet (length smaller than expected) */ 344 - if (skb->len - headersize < payload_len) 332 + if (!pskb_may_pull(skb, headersize + payload_len)) 345 333 goto drop; 346 334 347 335 payload = skb->data + headersize;
+2 -1
drivers/staging/octeon/ethernet-rx.c
··· 411 411 skb->protocol = eth_type_trans(skb, dev); 412 412 skb->dev = dev; 413 413 414 - if (unlikely(work->word2.s.not_IP || work->word2.s.IP_exc || work->word2.s.L4_error)) 414 + if (unlikely(work->word2.s.not_IP || work->word2.s.IP_exc || 415 + work->word2.s.L4_error || !work->word2.s.tcp_or_udp)) 415 416 skb->ip_summed = CHECKSUM_NONE; 416 417 else 417 418 skb->ip_summed = CHECKSUM_UNNECESSARY;
+3 -1
drivers/tty/serial/lantiq.c
··· 478 478 spin_unlock_irqrestore(&ltq_asc_lock, flags); 479 479 480 480 /* Don't rewrite B0 */ 481 - if (tty_termios_baud_rate(new)) 481 + if (tty_termios_baud_rate(new)) 482 482 tty_termios_encode_baud_rate(new, baud, baud); 483 + 484 + uart_update_timeout(port, cflag, baud); 483 485 } 484 486 485 487 static const char*
+10 -1
fs/btrfs/ioctl.c
··· 1047 1047 if (!max_to_defrag) 1048 1048 max_to_defrag = last_index - 1; 1049 1049 1050 - while (i <= last_index && defrag_count < max_to_defrag) { 1050 + /* 1051 + * make writeback starts from i, so the defrag range can be 1052 + * written sequentially. 1053 + */ 1054 + if (i < inode->i_mapping->writeback_index) 1055 + inode->i_mapping->writeback_index = i; 1056 + 1057 + while (i <= last_index && defrag_count < max_to_defrag && 1058 + (i < (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> 1059 + PAGE_CACHE_SHIFT)) { 1051 1060 /* 1052 1061 * make sure we stop running if someone unmounts 1053 1062 * the FS
+1 -1
fs/cifs/connect.c
··· 2018 2018 warned_on_ntlm = true; 2019 2019 cERROR(1, "default security mechanism requested. The default " 2020 2020 "security mechanism will be upgraded from ntlm to " 2021 - "ntlmv2 in kernel release 3.1"); 2021 + "ntlmv2 in kernel release 3.2"); 2022 2022 } 2023 2023 ses->overrideSecFlg = volume_info->secFlg; 2024 2024
+2 -1
fs/xfs/xfs_buf_item.c
··· 629 629 * the xfsbufd to get this buffer written. We have to unlock the buffer 630 630 * to allow the xfsbufd to write it, too. 631 631 */ 632 - STATIC void 632 + STATIC bool 633 633 xfs_buf_item_pushbuf( 634 634 struct xfs_log_item *lip) 635 635 { ··· 643 643 644 644 xfs_buf_delwri_promote(bp); 645 645 xfs_buf_relse(bp); 646 + return true; 646 647 } 647 648 648 649 STATIC void
+7 -3
fs/xfs/xfs_dquot_item.c
··· 183 183 * search the buffer cache can be a time consuming thing, and AIL lock is a 184 184 * spinlock. 185 185 */ 186 - STATIC void 186 + STATIC bool 187 187 xfs_qm_dquot_logitem_pushbuf( 188 188 struct xfs_log_item *lip) 189 189 { 190 190 struct xfs_dq_logitem *qlip = DQUOT_ITEM(lip); 191 191 struct xfs_dquot *dqp = qlip->qli_dquot; 192 192 struct xfs_buf *bp; 193 + bool ret = true; 193 194 194 195 ASSERT(XFS_DQ_IS_LOCKED(dqp)); 195 196 ··· 202 201 if (completion_done(&dqp->q_flush) || 203 202 !(lip->li_flags & XFS_LI_IN_AIL)) { 204 203 xfs_dqunlock(dqp); 205 - return; 204 + return true; 206 205 } 207 206 208 207 bp = xfs_incore(dqp->q_mount->m_ddev_targp, qlip->qli_format.qlf_blkno, 209 208 dqp->q_mount->m_quotainfo->qi_dqchunklen, XBF_TRYLOCK); 210 209 xfs_dqunlock(dqp); 211 210 if (!bp) 212 - return; 211 + return true; 213 212 if (XFS_BUF_ISDELAYWRITE(bp)) 214 213 xfs_buf_delwri_promote(bp); 214 + if (xfs_buf_ispinned(bp)) 215 + ret = false; 215 216 xfs_buf_relse(bp); 217 + return ret; 216 218 } 217 219 218 220 /*
+7 -3
fs/xfs/xfs_inode_item.c
··· 708 708 * marked delayed write. If that's the case, we'll promote it and that will 709 709 * allow the caller to write the buffer by triggering the xfsbufd to run. 710 710 */ 711 - STATIC void 711 + STATIC bool 712 712 xfs_inode_item_pushbuf( 713 713 struct xfs_log_item *lip) 714 714 { 715 715 struct xfs_inode_log_item *iip = INODE_ITEM(lip); 716 716 struct xfs_inode *ip = iip->ili_inode; 717 717 struct xfs_buf *bp; 718 + bool ret = true; 718 719 719 720 ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED)); 720 721 ··· 726 725 if (completion_done(&ip->i_flush) || 727 726 !(lip->li_flags & XFS_LI_IN_AIL)) { 728 727 xfs_iunlock(ip, XFS_ILOCK_SHARED); 729 - return; 728 + return true; 730 729 } 731 730 732 731 bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno, ··· 734 733 735 734 xfs_iunlock(ip, XFS_ILOCK_SHARED); 736 735 if (!bp) 737 - return; 736 + return true; 738 737 if (XFS_BUF_ISDELAYWRITE(bp)) 739 738 xfs_buf_delwri_promote(bp); 739 + if (xfs_buf_ispinned(bp)) 740 + ret = false; 740 741 xfs_buf_relse(bp); 742 + return ret; 741 743 } 742 744 743 745 /*
+2
fs/xfs/xfs_linux.h
··· 68 68 #include <linux/ctype.h> 69 69 #include <linux/writeback.h> 70 70 #include <linux/capability.h> 71 + #include <linux/kthread.h> 72 + #include <linux/freezer.h> 71 73 #include <linux/list_sort.h> 72 74 73 75 #include <asm/page.h>
+1 -12
fs/xfs/xfs_super.c
··· 1652 1652 */ 1653 1653 xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8); 1654 1654 if (!xfs_syncd_wq) 1655 - goto out; 1656 - 1657 - xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8); 1658 - if (!xfs_ail_wq) 1659 - goto out_destroy_syncd; 1660 - 1655 + return -ENOMEM; 1661 1656 return 0; 1662 - 1663 - out_destroy_syncd: 1664 - destroy_workqueue(xfs_syncd_wq); 1665 - out: 1666 - return -ENOMEM; 1667 1657 } 1668 1658 1669 1659 STATIC void 1670 1660 xfs_destroy_workqueues(void) 1671 1661 { 1672 - destroy_workqueue(xfs_ail_wq); 1673 1662 destroy_workqueue(xfs_syncd_wq); 1674 1663 } 1675 1664
+1 -1
fs/xfs/xfs_trans.h
··· 350 350 void (*iop_unlock)(xfs_log_item_t *); 351 351 xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); 352 352 void (*iop_push)(xfs_log_item_t *); 353 - void (*iop_pushbuf)(xfs_log_item_t *); 353 + bool (*iop_pushbuf)(xfs_log_item_t *); 354 354 void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); 355 355 } xfs_item_ops_t; 356 356
+48 -35
fs/xfs/xfs_trans_ail.c
··· 28 28 #include "xfs_trans_priv.h" 29 29 #include "xfs_error.h" 30 30 31 - struct workqueue_struct *xfs_ail_wq; /* AIL workqueue */ 32 - 33 31 #ifdef DEBUG 34 32 /* 35 33 * Check that the list is sorted as it should be. ··· 354 356 xfs_trans_ail_cursor_clear(ailp, lip); 355 357 } 356 358 357 - /* 358 - * xfs_ail_worker does the work of pushing on the AIL. It will requeue itself 359 - * to run at a later time if there is more work to do to complete the push. 360 - */ 361 - STATIC void 362 - xfs_ail_worker( 363 - struct work_struct *work) 359 + static long 360 + xfsaild_push( 361 + struct xfs_ail *ailp) 364 362 { 365 - struct xfs_ail *ailp = container_of(to_delayed_work(work), 366 - struct xfs_ail, xa_work); 367 363 xfs_mount_t *mp = ailp->xa_mount; 368 364 struct xfs_ail_cursor cur; 369 365 xfs_log_item_t *lip; ··· 419 427 420 428 case XFS_ITEM_PUSHBUF: 421 429 XFS_STATS_INC(xs_push_ail_pushbuf); 422 - IOP_PUSHBUF(lip); 423 - ailp->xa_last_pushed_lsn = lsn; 430 + 431 + if (!IOP_PUSHBUF(lip)) { 432 + stuck++; 433 + flush_log = 1; 434 + } else { 435 + ailp->xa_last_pushed_lsn = lsn; 436 + } 424 437 push_xfsbufd = 1; 425 438 break; 426 439 ··· 437 440 438 441 case XFS_ITEM_LOCKED: 439 442 XFS_STATS_INC(xs_push_ail_locked); 440 - ailp->xa_last_pushed_lsn = lsn; 441 443 stuck++; 442 444 break; 443 445 ··· 497 501 /* We're past our target or empty, so idle */ 498 502 ailp->xa_last_pushed_lsn = 0; 499 503 500 - /* 501 - * We clear the XFS_AIL_PUSHING_BIT first before checking 502 - * whether the target has changed. If the target has changed, 503 - * this pushes the requeue race directly onto the result of the 504 - * atomic test/set bit, so we are guaranteed that either the 505 - * the pusher that changed the target or ourselves will requeue 506 - * the work (but not both). 507 - */ 508 - clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags); 509 - smp_rmb(); 510 - if (XFS_LSN_CMP(ailp->xa_target, target) == 0 || 511 - test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags)) 512 - return; 513 - 514 504 tout = 50; 515 505 } else if (XFS_LSN_CMP(lsn, target) >= 0) { 516 506 /* ··· 519 537 tout = 20; 520 538 } 521 539 522 - /* There is more to do, requeue us. */ 523 - queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 524 - msecs_to_jiffies(tout)); 540 + return tout; 541 + } 542 + 543 + static int 544 + xfsaild( 545 + void *data) 546 + { 547 + struct xfs_ail *ailp = data; 548 + long tout = 0; /* milliseconds */ 549 + 550 + while (!kthread_should_stop()) { 551 + if (tout && tout <= 20) 552 + __set_current_state(TASK_KILLABLE); 553 + else 554 + __set_current_state(TASK_INTERRUPTIBLE); 555 + schedule_timeout(tout ? 556 + msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT); 557 + 558 + try_to_freeze(); 559 + 560 + tout = xfsaild_push(ailp); 561 + } 562 + 563 + return 0; 525 564 } 526 565 527 566 /* ··· 577 574 */ 578 575 smp_wmb(); 579 576 xfs_trans_ail_copy_lsn(ailp, &ailp->xa_target, &threshold_lsn); 580 - if (!test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags)) 581 - queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 0); 577 + smp_wmb(); 578 + 579 + wake_up_process(ailp->xa_task); 582 580 } 583 581 584 582 /* ··· 817 813 INIT_LIST_HEAD(&ailp->xa_ail); 818 814 INIT_LIST_HEAD(&ailp->xa_cursors); 819 815 spin_lock_init(&ailp->xa_lock); 820 - INIT_DELAYED_WORK(&ailp->xa_work, xfs_ail_worker); 816 + 817 + ailp->xa_task = kthread_run(xfsaild, ailp, "xfsaild/%s", 818 + ailp->xa_mount->m_fsname); 819 + if (IS_ERR(ailp->xa_task)) 820 + goto out_free_ailp; 821 + 821 822 mp->m_ail = ailp; 822 823 return 0; 824 + 825 + out_free_ailp: 826 + kmem_free(ailp); 827 + return ENOMEM; 823 828 } 824 829 825 830 void ··· 837 824 { 838 825 struct xfs_ail *ailp = mp->m_ail; 839 826 840 - cancel_delayed_work_sync(&ailp->xa_work); 827 + kthread_stop(ailp->xa_task); 841 828 kmem_free(ailp); 842 829 }
+1 -7
fs/xfs/xfs_trans_priv.h
··· 64 64 */ 65 65 struct xfs_ail { 66 66 struct xfs_mount *xa_mount; 67 + struct task_struct *xa_task; 67 68 struct list_head xa_ail; 68 69 xfs_lsn_t xa_target; 69 70 struct list_head xa_cursors; 70 71 spinlock_t xa_lock; 71 - struct delayed_work xa_work; 72 72 xfs_lsn_t xa_last_pushed_lsn; 73 - unsigned long xa_flags; 74 73 }; 75 - 76 - #define XFS_AIL_PUSHING_BIT 0 77 74 78 75 /* 79 76 * From xfs_trans_ail.c 80 77 */ 81 - 82 - extern struct workqueue_struct *xfs_ail_wq; /* AIL workqueue */ 83 - 84 78 void xfs_trans_ail_update_bulk(struct xfs_ail *ailp, 85 79 struct xfs_ail_cursor *cur, 86 80 struct xfs_log_item **log_items, int nr_items,
+1 -1
include/linux/phy.h
··· 420 420 421 421 /* 422 422 * Requests a Tx timestamp for 'skb'. The phy driver promises 423 - * to deliver it to the socket's error queue as soon as a 423 + * to deliver it using skb_complete_tx_timestamp() as soon as a 424 424 * timestamp becomes available. One of the PTP_CLASS_ values 425 425 * is passed in 'type'. 426 426 */
+6 -1
include/linux/skbuff.h
··· 2216 2216 /** 2217 2217 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps 2218 2218 * 2219 + * PHY drivers may accept clones of transmitted packets for 2220 + * timestamping via their phy_driver.txtstamp method. These drivers 2221 + * must call this function to return the skb back to the stack, with 2222 + * or without a timestamp. 2223 + * 2219 2224 * @skb: clone of the the original outgoing packet 2220 - * @hwtstamps: hardware time stamps 2225 + * @hwtstamps: hardware time stamps, may be NULL if not available 2221 2226 * 2222 2227 */ 2223 2228 void skb_complete_tx_timestamp(struct sk_buff *skb,
+1
include/net/ip_vs.h
··· 900 900 volatile int sync_state; 901 901 volatile int master_syncid; 902 902 volatile int backup_syncid; 903 + struct mutex sync_mutex; 903 904 /* multicast interface name */ 904 905 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 905 906 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
+34 -35
include/net/udplite.h
··· 66 66 return 0; 67 67 } 68 68 69 - static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) 70 - { 71 - int cscov = up->len; 72 - 73 - /* 74 - * Sender has set `partial coverage' option on UDP-Lite socket 75 - */ 76 - if (up->pcflag & UDPLITE_SEND_CC) { 77 - if (up->pcslen < up->len) { 78 - /* up->pcslen == 0 means that full coverage is required, 79 - * partial coverage only if 0 < up->pcslen < up->len */ 80 - if (0 < up->pcslen) { 81 - cscov = up->pcslen; 82 - } 83 - uh->len = htons(up->pcslen); 84 - } 85 - /* 86 - * NOTE: Causes for the error case `up->pcslen > up->len': 87 - * (i) Application error (will not be penalized). 88 - * (ii) Payload too big for send buffer: data is split 89 - * into several packets, each with its own header. 90 - * In this case (e.g. last segment), coverage may 91 - * exceed packet length. 92 - * Since packets with coverage length > packet length are 93 - * illegal, we fall back to the defaults here. 94 - */ 95 - } 96 - return cscov; 97 - } 98 - 69 + /* Slow-path computation of checksum. Socket is locked. */ 99 70 static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) 100 71 { 101 - int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); 72 + const struct udp_sock *up = udp_sk(skb->sk); 73 + int cscov = up->len; 102 74 __wsum csum = 0; 75 + 76 + if (up->pcflag & UDPLITE_SEND_CC) { 77 + /* 78 + * Sender has set `partial coverage' option on UDP-Lite socket. 79 + * The special case "up->pcslen == 0" signifies full coverage. 80 + */ 81 + if (up->pcslen < up->len) { 82 + if (0 < up->pcslen) 83 + cscov = up->pcslen; 84 + udp_hdr(skb)->len = htons(up->pcslen); 85 + } 86 + /* 87 + * NOTE: Causes for the error case `up->pcslen > up->len': 88 + * (i) Application error (will not be penalized). 89 + * (ii) Payload too big for send buffer: data is split 90 + * into several packets, each with its own header. 91 + * In this case (e.g. last segment), coverage may 92 + * exceed packet length. 93 + * Since packets with coverage length > packet length are 94 + * illegal, we fall back to the defaults here. 95 + */ 96 + } 103 97 104 98 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 105 99 ··· 109 115 return csum; 110 116 } 111 117 118 + /* Fast-path computation of checksum. Socket may not be locked. */ 112 119 static inline __wsum udplite_csum(struct sk_buff *skb) 113 120 { 114 - struct sock *sk = skb->sk; 115 - int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); 121 + const struct udp_sock *up = udp_sk(skb->sk); 116 122 const int off = skb_transport_offset(skb); 117 - const int len = skb->len - off; 123 + int len = skb->len - off; 118 124 125 + if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) { 126 + if (0 < up->pcslen) 127 + len = up->pcslen; 128 + udp_hdr(skb)->len = htons(up->pcslen); 129 + } 119 130 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 120 131 121 - return skb_checksum(skb, off, min(cscov, len), 0); 132 + return skb_checksum(skb, off, len, 0); 122 133 } 123 134 124 135 extern void udplite4_register(void);
+4 -3
kernel/posix-cpu-timers.c
··· 274 274 struct task_cputime sum; 275 275 unsigned long flags; 276 276 277 - spin_lock_irqsave(&cputimer->lock, flags); 278 277 if (!cputimer->running) { 279 - cputimer->running = 1; 280 278 /* 281 279 * The POSIX timer interface allows for absolute time expiry 282 280 * values through the TIMER_ABSTIME flag, therefore we have ··· 282 284 * it. 283 285 */ 284 286 thread_group_cputime(tsk, &sum); 287 + spin_lock_irqsave(&cputimer->lock, flags); 288 + cputimer->running = 1; 285 289 update_gt_cputime(&cputimer->cputime, &sum); 286 - } 290 + } else 291 + spin_lock_irqsave(&cputimer->lock, flags); 287 292 *times = cputimer->cputime; 288 293 spin_unlock_irqrestore(&cputimer->lock, flags); 289 294 }
+1 -1
kernel/sys.c
··· 1172 1172 static int override_release(char __user *release, int len) 1173 1173 { 1174 1174 int ret = 0; 1175 - char buf[len]; 1175 + char buf[65]; 1176 1176 1177 1177 if (current->personality & UNAME26) { 1178 1178 char *rest = UTS_RELEASE;
+4 -4
mm/migrate.c
··· 120 120 121 121 ptep = pte_offset_map(pmd, addr); 122 122 123 - if (!is_swap_pte(*ptep)) { 124 - pte_unmap(ptep); 125 - goto out; 126 - } 123 + /* 124 + * Peek to check is_swap_pte() before taking ptlock? No, we 125 + * can race mremap's move_ptes(), which skips anon_vma lock. 126 + */ 127 127 128 128 ptl = pte_lockptr(mm, pmd); 129 129 }
+6 -1
net/batman-adv/translation-table.c
··· 1049 1049 tt_response = (struct tt_query_packet *)skb_put(skb, 1050 1050 tt_query_size + tt_len); 1051 1051 tt_response->ttvn = ttvn; 1052 - tt_response->tt_data = htons(tt_tot); 1053 1052 1054 1053 tt_change = (struct tt_change *)(skb->data + tt_query_size); 1055 1054 tt_count = 0; ··· 1073 1074 } 1074 1075 } 1075 1076 rcu_read_unlock(); 1077 + 1078 + /* store in the message the number of entries we have successfully 1079 + * copied */ 1080 + tt_response->tt_data = htons(tt_count); 1076 1081 1077 1082 out: 1078 1083 return skb; ··· 1725 1722 rcu_read_lock(); 1726 1723 hlist_for_each_entry_rcu(tt_local_entry, node, 1727 1724 head, hash_entry) { 1725 + if (!(tt_local_entry->flags & flags)) 1726 + continue; 1728 1727 tt_local_entry->flags &= ~flags; 1729 1728 atomic_inc(&bat_priv->num_local_tt); 1730 1729 }
+4
net/bluetooth/l2cap_sock.c
··· 26 26 27 27 /* Bluetooth L2CAP sockets. */ 28 28 29 + #include <linux/security.h> 30 + 29 31 #include <net/bluetooth/bluetooth.h> 30 32 #include <net/bluetooth/hci_core.h> 31 33 #include <net/bluetooth/l2cap.h> ··· 935 933 chan->force_reliable = pchan->force_reliable; 936 934 chan->flushable = pchan->flushable; 937 935 chan->force_active = pchan->force_active; 936 + 937 + security_sk_clone(parent, sk); 938 938 } else { 939 939 940 940 switch (sk->sk_type) {
+3
net/bluetooth/rfcomm/sock.c
··· 42 42 #include <linux/device.h> 43 43 #include <linux/debugfs.h> 44 44 #include <linux/seq_file.h> 45 + #include <linux/security.h> 45 46 #include <net/sock.h> 46 47 47 48 #include <asm/system.h> ··· 265 264 266 265 pi->sec_level = rfcomm_pi(parent)->sec_level; 267 266 pi->role_switch = rfcomm_pi(parent)->role_switch; 267 + 268 + security_sk_clone(parent, sk); 268 269 } else { 269 270 pi->dlc->defer_setup = 0; 270 271
+4 -1
net/bluetooth/sco.c
··· 41 41 #include <linux/debugfs.h> 42 42 #include <linux/seq_file.h> 43 43 #include <linux/list.h> 44 + #include <linux/security.h> 44 45 #include <net/sock.h> 45 46 46 47 #include <asm/system.h> ··· 404 403 { 405 404 BT_DBG("sk %p", sk); 406 405 407 - if (parent) 406 + if (parent) { 408 407 sk->sk_type = parent->sk_type; 408 + security_sk_clone(parent, sk); 409 + } 409 410 } 410 411 411 412 static struct proto sco_proto = {
+5 -4
net/bridge/br_if.c
··· 160 160 call_rcu(&p->rcu, destroy_nbp_rcu); 161 161 } 162 162 163 - /* called with RTNL */ 164 - static void del_br(struct net_bridge *br, struct list_head *head) 163 + /* Delete bridge device */ 164 + void br_dev_delete(struct net_device *dev, struct list_head *head) 165 165 { 166 + struct net_bridge *br = netdev_priv(dev); 166 167 struct net_bridge_port *p, *n; 167 168 168 169 list_for_each_entry_safe(p, n, &br->port_list, list) { ··· 268 267 } 269 268 270 269 else 271 - del_br(netdev_priv(dev), NULL); 270 + br_dev_delete(dev, NULL); 272 271 273 272 rtnl_unlock(); 274 273 return ret; ··· 447 446 rtnl_lock(); 448 447 for_each_netdev(net, dev) 449 448 if (dev->priv_flags & IFF_EBRIDGE) 450 - del_br(netdev_priv(dev), &list); 449 + br_dev_delete(dev, &list); 451 450 452 451 unregister_netdevice_many(&list); 453 452 rtnl_unlock();
+1
net/bridge/br_netlink.c
··· 210 210 .priv_size = sizeof(struct net_bridge), 211 211 .setup = br_dev_setup, 212 212 .validate = br_validate, 213 + .dellink = br_dev_delete, 213 214 }; 214 215 215 216 int __init br_netlink_init(void)
+1
net/bridge/br_private.h
··· 301 301 302 302 /* br_device.c */ 303 303 extern void br_dev_setup(struct net_device *dev); 304 + extern void br_dev_delete(struct net_device *dev, struct list_head *list); 304 305 extern netdev_tx_t br_dev_xmit(struct sk_buff *skb, 305 306 struct net_device *dev); 306 307 #ifdef CONFIG_NET_POLL_CONTROLLER
+1
net/core/dev.c
··· 6266 6266 */ 6267 6267 call_netdevice_notifiers(NETDEV_UNREGISTER, dev); 6268 6268 call_netdevice_notifiers(NETDEV_UNREGISTER_BATCH, dev); 6269 + rtmsg_ifinfo(RTM_DELLINK, dev, ~0U); 6269 6270 6270 6271 /* 6271 6272 * Flush the unicast and multicast chains
+4 -1
net/core/fib_rules.c
··· 475 475 476 476 list_del_rcu(&rule->list); 477 477 478 - if (rule->action == FR_ACT_GOTO) 478 + if (rule->action == FR_ACT_GOTO) { 479 479 ops->nr_goto_rules--; 480 + if (rtnl_dereference(rule->ctarget) == NULL) 481 + ops->unresolved_rules--; 482 + } 480 483 481 484 /* 482 485 * Check if this rule is a target to any of them. If so,
+11 -3
net/core/timestamping.c
··· 57 57 case PTP_CLASS_V2_VLAN: 58 58 phydev = skb->dev->phydev; 59 59 if (likely(phydev->drv->txtstamp)) { 60 - clone = skb_clone(skb, GFP_ATOMIC); 61 - if (!clone) 60 + if (!atomic_inc_not_zero(&sk->sk_refcnt)) 62 61 return; 62 + clone = skb_clone(skb, GFP_ATOMIC); 63 + if (!clone) { 64 + sock_put(sk); 65 + return; 66 + } 63 67 clone->sk = sk; 64 68 phydev->drv->txtstamp(phydev, clone, type); 65 69 } ··· 81 77 struct sock_exterr_skb *serr; 82 78 int err; 83 79 84 - if (!hwtstamps) 80 + if (!hwtstamps) { 81 + sock_put(sk); 82 + kfree_skb(skb); 85 83 return; 84 + } 86 85 87 86 *skb_hwtstamps(skb) = *hwtstamps; 88 87 serr = SKB_EXT_ERR(skb); ··· 94 87 serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING; 95 88 skb->sk = NULL; 96 89 err = sock_queue_err_skb(sk, skb); 90 + sock_put(sk); 97 91 if (err) 98 92 kfree_skb(skb); 99 93 }
-2
net/ipv4/ip_gre.c
··· 835 835 if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| 836 836 (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { 837 837 struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); 838 - if (max_headroom > dev->needed_headroom) 839 - dev->needed_headroom = max_headroom; 840 838 if (!new_skb) { 841 839 ip_rt_put(rt); 842 840 dev->stats.tx_dropped++;
+31 -5
net/ipv4/route.c
··· 1308 1308 void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, 1309 1309 __be32 saddr, struct net_device *dev) 1310 1310 { 1311 + int s, i; 1311 1312 struct in_device *in_dev = __in_dev_get_rcu(dev); 1313 + struct rtable *rt; 1314 + __be32 skeys[2] = { saddr, 0 }; 1315 + int ikeys[2] = { dev->ifindex, 0 }; 1316 + struct flowi4 fl4; 1312 1317 struct inet_peer *peer; 1313 1318 struct net *net; 1314 1319 ··· 1336 1331 goto reject_redirect; 1337 1332 } 1338 1333 1339 - peer = inet_getpeer_v4(daddr, 1); 1340 - if (peer) { 1341 - peer->redirect_learned.a4 = new_gw; 1334 + memset(&fl4, 0, sizeof(fl4)); 1335 + fl4.daddr = daddr; 1336 + for (s = 0; s < 2; s++) { 1337 + for (i = 0; i < 2; i++) { 1338 + fl4.flowi4_oif = ikeys[i]; 1339 + fl4.saddr = skeys[s]; 1340 + rt = __ip_route_output_key(net, &fl4); 1341 + if (IS_ERR(rt)) 1342 + continue; 1342 1343 1343 - inet_putpeer(peer); 1344 + if (rt->dst.error || rt->dst.dev != dev || 1345 + rt->rt_gateway != old_gw) { 1346 + ip_rt_put(rt); 1347 + continue; 1348 + } 1344 1349 1345 - atomic_inc(&__rt_peer_genid); 1350 + if (!rt->peer) 1351 + rt_bind_peer(rt, rt->rt_dst, 1); 1352 + 1353 + peer = rt->peer; 1354 + if (peer) { 1355 + peer->redirect_learned.a4 = new_gw; 1356 + atomic_inc(&__rt_peer_genid); 1357 + } 1358 + 1359 + ip_rt_put(rt); 1360 + return; 1361 + } 1346 1362 } 1347 1363 return; 1348 1364
+1
net/ipv4/tcp_minisocks.c
··· 328 328 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); 329 329 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); 330 330 331 + tw->tw_transparent = inet_sk(sk)->transparent; 331 332 tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale; 332 333 tcptw->tw_rcv_nxt = tp->rcv_nxt; 333 334 tcptw->tw_snd_nxt = tp->snd_nxt;
+7 -7
net/ipv4/xfrm4_policy.c
··· 79 79 struct rtable *rt = (struct rtable *)xdst->route; 80 80 const struct flowi4 *fl4 = &fl->u.ip4; 81 81 82 - rt->rt_key_dst = fl4->daddr; 83 - rt->rt_key_src = fl4->saddr; 84 - rt->rt_key_tos = fl4->flowi4_tos; 85 - rt->rt_route_iif = fl4->flowi4_iif; 86 - rt->rt_iif = fl4->flowi4_iif; 87 - rt->rt_oif = fl4->flowi4_oif; 88 - rt->rt_mark = fl4->flowi4_mark; 82 + xdst->u.rt.rt_key_dst = fl4->daddr; 83 + xdst->u.rt.rt_key_src = fl4->saddr; 84 + xdst->u.rt.rt_key_tos = fl4->flowi4_tos; 85 + xdst->u.rt.rt_route_iif = fl4->flowi4_iif; 86 + xdst->u.rt.rt_iif = fl4->flowi4_iif; 87 + xdst->u.rt.rt_oif = fl4->flowi4_oif; 88 + xdst->u.rt.rt_mark = fl4->flowi4_mark; 89 89 90 90 xdst->u.dst.dev = dev; 91 91 dev_hold(dev);
+1
net/ipv6/af_inet6.c
··· 875 875 skb_reset_transport_header(skb); 876 876 __skb_push(skb, skb_gro_offset(skb)); 877 877 878 + ops = rcu_dereference(inet6_protos[proto]); 878 879 if (!ops || !ops->gro_receive) 879 880 goto out_unlock; 880 881
+3 -1
net/l2tp/l2tp_core.c
··· 1045 1045 headroom = NET_SKB_PAD + sizeof(struct iphdr) + 1046 1046 uhlen + hdr_len; 1047 1047 old_headroom = skb_headroom(skb); 1048 - if (skb_cow_head(skb, headroom)) 1048 + if (skb_cow_head(skb, headroom)) { 1049 + dev_kfree_skb(skb); 1049 1050 goto abort; 1051 + } 1050 1052 1051 1053 new_headroom = skb_headroom(skb); 1052 1054 skb_orphan(skb);
+82 -53
net/netfilter/ipvs/ip_vs_ctl.c
··· 2283 2283 struct ip_vs_service *svc; 2284 2284 struct ip_vs_dest_user *udest_compat; 2285 2285 struct ip_vs_dest_user_kern udest; 2286 + struct netns_ipvs *ipvs = net_ipvs(net); 2286 2287 2287 2288 if (!capable(CAP_NET_ADMIN)) 2288 2289 return -EPERM; ··· 2304 2303 /* increase the module use count */ 2305 2304 ip_vs_use_count_inc(); 2306 2305 2306 + /* Handle daemons since they have another lock */ 2307 + if (cmd == IP_VS_SO_SET_STARTDAEMON || 2308 + cmd == IP_VS_SO_SET_STOPDAEMON) { 2309 + struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg; 2310 + 2311 + if (mutex_lock_interruptible(&ipvs->sync_mutex)) { 2312 + ret = -ERESTARTSYS; 2313 + goto out_dec; 2314 + } 2315 + if (cmd == IP_VS_SO_SET_STARTDAEMON) 2316 + ret = start_sync_thread(net, dm->state, dm->mcast_ifn, 2317 + dm->syncid); 2318 + else 2319 + ret = stop_sync_thread(net, dm->state); 2320 + mutex_unlock(&ipvs->sync_mutex); 2321 + goto out_dec; 2322 + } 2323 + 2307 2324 if (mutex_lock_interruptible(&__ip_vs_mutex)) { 2308 2325 ret = -ERESTARTSYS; 2309 2326 goto out_dec; ··· 2334 2315 } else if (cmd == IP_VS_SO_SET_TIMEOUT) { 2335 2316 /* Set timeout values for (tcp tcpfin udp) */ 2336 2317 ret = ip_vs_set_timeout(net, (struct ip_vs_timeout_user *)arg); 2337 - goto out_unlock; 2338 - } else if (cmd == IP_VS_SO_SET_STARTDAEMON) { 2339 - struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg; 2340 - ret = start_sync_thread(net, dm->state, dm->mcast_ifn, 2341 - dm->syncid); 2342 - goto out_unlock; 2343 - } else if (cmd == IP_VS_SO_SET_STOPDAEMON) { 2344 - struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg; 2345 - ret = stop_sync_thread(net, dm->state); 2346 2318 goto out_unlock; 2347 2319 } 2348 2320 ··· 2594 2584 2595 2585 if (copy_from_user(arg, user, copylen) != 0) 2596 2586 return -EFAULT; 2587 + /* 2588 + * Handle daemons first since it has its own locking 2589 + */ 2590 + if (cmd == IP_VS_SO_GET_DAEMON) { 2591 + struct ip_vs_daemon_user d[2]; 2592 + 2593 + memset(&d, 0, sizeof(d)); 2594 + if (mutex_lock_interruptible(&ipvs->sync_mutex)) 2595 + return -ERESTARTSYS; 2596 + 2597 + if (ipvs->sync_state & IP_VS_STATE_MASTER) { 2598 + d[0].state = IP_VS_STATE_MASTER; 2599 + strlcpy(d[0].mcast_ifn, ipvs->master_mcast_ifn, 2600 + sizeof(d[0].mcast_ifn)); 2601 + d[0].syncid = ipvs->master_syncid; 2602 + } 2603 + if (ipvs->sync_state & IP_VS_STATE_BACKUP) { 2604 + d[1].state = IP_VS_STATE_BACKUP; 2605 + strlcpy(d[1].mcast_ifn, ipvs->backup_mcast_ifn, 2606 + sizeof(d[1].mcast_ifn)); 2607 + d[1].syncid = ipvs->backup_syncid; 2608 + } 2609 + if (copy_to_user(user, &d, sizeof(d)) != 0) 2610 + ret = -EFAULT; 2611 + mutex_unlock(&ipvs->sync_mutex); 2612 + return ret; 2613 + } 2597 2614 2598 2615 if (mutex_lock_interruptible(&__ip_vs_mutex)) 2599 2616 return -ERESTARTSYS; ··· 2714 2677 2715 2678 __ip_vs_get_timeouts(net, &t); 2716 2679 if (copy_to_user(user, &t, sizeof(t)) != 0) 2717 - ret = -EFAULT; 2718 - } 2719 - break; 2720 - 2721 - case IP_VS_SO_GET_DAEMON: 2722 - { 2723 - struct ip_vs_daemon_user d[2]; 2724 - 2725 - memset(&d, 0, sizeof(d)); 2726 - if (ipvs->sync_state & IP_VS_STATE_MASTER) { 2727 - d[0].state = IP_VS_STATE_MASTER; 2728 - strlcpy(d[0].mcast_ifn, ipvs->master_mcast_ifn, 2729 - sizeof(d[0].mcast_ifn)); 2730 - d[0].syncid = ipvs->master_syncid; 2731 - } 2732 - if (ipvs->sync_state & IP_VS_STATE_BACKUP) { 2733 - d[1].state = IP_VS_STATE_BACKUP; 2734 - strlcpy(d[1].mcast_ifn, ipvs->backup_mcast_ifn, 2735 - sizeof(d[1].mcast_ifn)); 2736 - d[1].syncid = ipvs->backup_syncid; 2737 - } 2738 - if (copy_to_user(user, &d, sizeof(d)) != 0) 2739 2680 ret = -EFAULT; 2740 2681 } 2741 2682 break; ··· 3220 3205 struct net *net = skb_sknet(skb); 3221 3206 struct netns_ipvs *ipvs = net_ipvs(net); 3222 3207 3223 - mutex_lock(&__ip_vs_mutex); 3208 + mutex_lock(&ipvs->sync_mutex); 3224 3209 if ((ipvs->sync_state & IP_VS_STATE_MASTER) && !cb->args[0]) { 3225 3210 if (ip_vs_genl_dump_daemon(skb, IP_VS_STATE_MASTER, 3226 3211 ipvs->master_mcast_ifn, ··· 3240 3225 } 3241 3226 3242 3227 nla_put_failure: 3243 - mutex_unlock(&__ip_vs_mutex); 3228 + mutex_unlock(&ipvs->sync_mutex); 3244 3229 3245 3230 return skb->len; 3246 3231 } ··· 3286 3271 return ip_vs_set_timeout(net, &t); 3287 3272 } 3288 3273 3274 + static int ip_vs_genl_set_daemon(struct sk_buff *skb, struct genl_info *info) 3275 + { 3276 + int ret = 0, cmd; 3277 + struct net *net; 3278 + struct netns_ipvs *ipvs; 3279 + 3280 + net = skb_sknet(skb); 3281 + ipvs = net_ipvs(net); 3282 + cmd = info->genlhdr->cmd; 3283 + 3284 + if (cmd == IPVS_CMD_NEW_DAEMON || cmd == IPVS_CMD_DEL_DAEMON) { 3285 + struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1]; 3286 + 3287 + mutex_lock(&ipvs->sync_mutex); 3288 + if (!info->attrs[IPVS_CMD_ATTR_DAEMON] || 3289 + nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX, 3290 + info->attrs[IPVS_CMD_ATTR_DAEMON], 3291 + ip_vs_daemon_policy)) { 3292 + ret = -EINVAL; 3293 + goto out; 3294 + } 3295 + 3296 + if (cmd == IPVS_CMD_NEW_DAEMON) 3297 + ret = ip_vs_genl_new_daemon(net, daemon_attrs); 3298 + else 3299 + ret = ip_vs_genl_del_daemon(net, daemon_attrs); 3300 + out: 3301 + mutex_unlock(&ipvs->sync_mutex); 3302 + } 3303 + return ret; 3304 + } 3305 + 3289 3306 static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info) 3290 3307 { 3291 3308 struct ip_vs_service *svc = NULL; ··· 3339 3292 goto out; 3340 3293 } else if (cmd == IPVS_CMD_SET_CONFIG) { 3341 3294 ret = ip_vs_genl_set_config(net, info->attrs); 3342 - goto out; 3343 - } else if (cmd == IPVS_CMD_NEW_DAEMON || 3344 - cmd == IPVS_CMD_DEL_DAEMON) { 3345 - 3346 - struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1]; 3347 - 3348 - if (!info->attrs[IPVS_CMD_ATTR_DAEMON] || 3349 - nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX, 3350 - info->attrs[IPVS_CMD_ATTR_DAEMON], 3351 - ip_vs_daemon_policy)) { 3352 - ret = -EINVAL; 3353 - goto out; 3354 - } 3355 - 3356 - if (cmd == IPVS_CMD_NEW_DAEMON) 3357 - ret = ip_vs_genl_new_daemon(net, daemon_attrs); 3358 - else 3359 - ret = ip_vs_genl_del_daemon(net, daemon_attrs); 3360 3295 goto out; 3361 3296 } else if (cmd == IPVS_CMD_ZERO && 3362 3297 !info->attrs[IPVS_CMD_ATTR_SERVICE]) { ··· 3565 3536 .cmd = IPVS_CMD_NEW_DAEMON, 3566 3537 .flags = GENL_ADMIN_PERM, 3567 3538 .policy = ip_vs_cmd_policy, 3568 - .doit = ip_vs_genl_set_cmd, 3539 + .doit = ip_vs_genl_set_daemon, 3569 3540 }, 3570 3541 { 3571 3542 .cmd = IPVS_CMD_DEL_DAEMON, 3572 3543 .flags = GENL_ADMIN_PERM, 3573 3544 .policy = ip_vs_cmd_policy, 3574 - .doit = ip_vs_genl_set_cmd, 3545 + .doit = ip_vs_genl_set_daemon, 3575 3546 }, 3576 3547 { 3577 3548 .cmd = IPVS_CMD_GET_DAEMON,
+6
net/netfilter/ipvs/ip_vs_sync.c
··· 61 61 62 62 #define SYNC_PROTO_VER 1 /* Protocol version in header */ 63 63 64 + static struct lock_class_key __ipvs_sync_key; 64 65 /* 65 66 * IPVS sync connection entry 66 67 * Version 0, i.e. original version. ··· 1546 1545 IP_VS_DBG(7, "Each ip_vs_sync_conn entry needs %Zd bytes\n", 1547 1546 sizeof(struct ip_vs_sync_conn_v0)); 1548 1547 1548 + 1549 1549 if (state == IP_VS_STATE_MASTER) { 1550 1550 if (ipvs->master_thread) 1551 1551 return -EEXIST; ··· 1669 1667 { 1670 1668 struct netns_ipvs *ipvs = net_ipvs(net); 1671 1669 1670 + __mutex_init(&ipvs->sync_mutex, "ipvs->sync_mutex", &__ipvs_sync_key); 1672 1671 INIT_LIST_HEAD(&ipvs->sync_queue); 1673 1672 spin_lock_init(&ipvs->sync_lock); 1674 1673 spin_lock_init(&ipvs->sync_buff_lock); ··· 1683 1680 void ip_vs_sync_net_cleanup(struct net *net) 1684 1681 { 1685 1682 int retc; 1683 + struct netns_ipvs *ipvs = net_ipvs(net); 1686 1684 1685 + mutex_lock(&ipvs->sync_mutex); 1687 1686 retc = stop_sync_thread(net, IP_VS_STATE_MASTER); 1688 1687 if (retc && retc != -ESRCH) 1689 1688 pr_err("Failed to stop Master Daemon\n"); ··· 1693 1688 retc = stop_sync_thread(net, IP_VS_STATE_BACKUP); 1694 1689 if (retc && retc != -ESRCH) 1695 1690 pr_err("Failed to stop Backup Daemon\n"); 1691 + mutex_unlock(&ipvs->sync_mutex); 1696 1692 }
+2 -2
net/netfilter/nf_conntrack_proto_gre.c
··· 241 241 nf_ct_refresh_acct(ct, ctinfo, skb, 242 242 ct->proto.gre.stream_timeout); 243 243 /* Also, more likely to be important, and not a probe. */ 244 - set_bit(IPS_ASSURED_BIT, &ct->status); 245 - nf_conntrack_event_cache(IPCT_ASSURED, ct); 244 + if (!test_and_set_bit(IPS_ASSURED_BIT, &ct->status)) 245 + nf_conntrack_event_cache(IPCT_ASSURED, ct); 246 246 } else 247 247 nf_ct_refresh_acct(ct, ctinfo, skb, 248 248 ct->proto.gre.timeout);
+32 -8
net/x25/af_x25.c
··· 91 91 int needed; 92 92 int rc; 93 93 94 - if (skb->len < 1) { 94 + if (!pskb_may_pull(skb, 1)) { 95 95 /* packet has no address block */ 96 96 rc = 0; 97 97 goto empty; ··· 100 100 len = *skb->data; 101 101 needed = 1 + (len >> 4) + (len & 0x0f); 102 102 103 - if (skb->len < needed) { 103 + if (!pskb_may_pull(skb, needed)) { 104 104 /* packet is too short to hold the addresses it claims 105 105 to hold */ 106 106 rc = -1; ··· 295 295 * Found a listening socket, now check the incoming 296 296 * call user data vs this sockets call user data 297 297 */ 298 - if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) { 298 + if (x25_sk(s)->cudmatchlength > 0 && 299 + skb->len >= x25_sk(s)->cudmatchlength) { 299 300 if((memcmp(x25_sk(s)->calluserdata.cuddata, 300 301 skb->data, 301 302 x25_sk(s)->cudmatchlength)) == 0) { ··· 952 951 * 953 952 * Facilities length is mandatory in call request packets 954 953 */ 955 - if (skb->len < 1) 954 + if (!pskb_may_pull(skb, 1)) 956 955 goto out_clear_request; 957 956 len = skb->data[0] + 1; 958 - if (skb->len < len) 957 + if (!pskb_may_pull(skb, len)) 959 958 goto out_clear_request; 960 959 skb_pull(skb,len); 960 + 961 + /* 962 + * Ensure that the amount of call user data is valid. 963 + */ 964 + if (skb->len > X25_MAX_CUD_LEN) 965 + goto out_clear_request; 966 + 967 + /* 968 + * Get all the call user data so it can be used in 969 + * x25_find_listener and skb_copy_from_linear_data up ahead. 970 + */ 971 + if (!pskb_may_pull(skb, skb->len)) 972 + goto out_clear_request; 961 973 962 974 /* 963 975 * Find a listener for the particular address/cud pair. ··· 1180 1166 * byte of the user data is the logical value of the Q Bit. 1181 1167 */ 1182 1168 if (test_bit(X25_Q_BIT_FLAG, &x25->flags)) { 1169 + if (!pskb_may_pull(skb, 1)) 1170 + goto out_kfree_skb; 1171 + 1183 1172 qbit = skb->data[0]; 1184 1173 skb_pull(skb, 1); 1185 1174 } ··· 1261 1244 struct x25_sock *x25 = x25_sk(sk); 1262 1245 struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; 1263 1246 size_t copied; 1264 - int qbit; 1247 + int qbit, header_len = x25->neighbour->extended ? 1248 + X25_EXT_MIN_LEN : X25_STD_MIN_LEN; 1249 + 1265 1250 struct sk_buff *skb; 1266 1251 unsigned char *asmptr; 1267 1252 int rc = -ENOTCONN; ··· 1283 1264 goto out; 1284 1265 1285 1266 skb = skb_dequeue(&x25->interrupt_in_queue); 1267 + 1268 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN)) 1269 + goto out_free_dgram; 1286 1270 1287 1271 skb_pull(skb, X25_STD_MIN_LEN); 1288 1272 ··· 1307 1285 if (!skb) 1308 1286 goto out; 1309 1287 1288 + if (!pskb_may_pull(skb, header_len)) 1289 + goto out_free_dgram; 1290 + 1310 1291 qbit = (skb->data[0] & X25_Q_BIT) == X25_Q_BIT; 1311 1292 1312 - skb_pull(skb, x25->neighbour->extended ? 1313 - X25_EXT_MIN_LEN : X25_STD_MIN_LEN); 1293 + skb_pull(skb, header_len); 1314 1294 1315 1295 if (test_bit(X25_Q_BIT_FLAG, &x25->flags)) { 1316 1296 asmptr = skb_push(skb, 1);
+6
net/x25/x25_dev.c
··· 32 32 unsigned short frametype; 33 33 unsigned int lci; 34 34 35 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN)) 36 + return 0; 37 + 35 38 frametype = skb->data[2]; 36 39 lci = ((skb->data[0] << 8) & 0xF00) + ((skb->data[1] << 0) & 0x0FF); 37 40 ··· 117 114 printk(KERN_DEBUG "X.25: unknown neighbour - %s\n", dev->name); 118 115 goto drop; 119 116 } 117 + 118 + if (!pskb_may_pull(skb, 1)) 119 + return 0; 120 120 121 121 switch (skb->data[0]) { 122 122
+6 -4
net/x25/x25_facilities.c
··· 44 44 int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, 45 45 struct x25_dte_facilities *dte_facs, unsigned long *vc_fac_mask) 46 46 { 47 - unsigned char *p = skb->data; 47 + unsigned char *p; 48 48 unsigned int len; 49 49 50 50 *vc_fac_mask = 0; ··· 60 60 memset(dte_facs->called_ae, '\0', sizeof(dte_facs->called_ae)); 61 61 memset(dte_facs->calling_ae, '\0', sizeof(dte_facs->calling_ae)); 62 62 63 - if (skb->len < 1) 63 + if (!pskb_may_pull(skb, 1)) 64 64 return 0; 65 65 66 - len = *p++; 66 + len = skb->data[0]; 67 67 68 - if (len >= skb->len) 68 + if (!pskb_may_pull(skb, 1 + len)) 69 69 return -1; 70 + 71 + p = skb->data + 1; 70 72 71 73 while (len > 0) { 72 74 switch (*p & X25_FAC_CLASS_MASK) {
+38 -5
net/x25/x25_in.c
··· 107 107 /* 108 108 * Parse the data in the frame. 109 109 */ 110 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN)) 111 + goto out_clear; 110 112 skb_pull(skb, X25_STD_MIN_LEN); 111 113 112 114 len = x25_parse_address_block(skb, &source_addr, ··· 129 127 * Copy any Call User Data. 130 128 */ 131 129 if (skb->len > 0) { 132 - skb_copy_from_linear_data(skb, 133 - x25->calluserdata.cuddata, 134 - skb->len); 130 + if (skb->len > X25_MAX_CUD_LEN) 131 + goto out_clear; 132 + 133 + skb_copy_bits(skb, 0, x25->calluserdata.cuddata, 134 + skb->len); 135 135 x25->calluserdata.cudlength = skb->len; 136 136 } 137 137 if (!sock_flag(sk, SOCK_DEAD)) ··· 141 137 break; 142 138 } 143 139 case X25_CLEAR_REQUEST: 140 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) 141 + goto out_clear; 142 + 144 143 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 145 144 x25_disconnect(sk, ECONNREFUSED, skb->data[3], skb->data[4]); 146 145 break; ··· 171 164 switch (frametype) { 172 165 173 166 case X25_CLEAR_REQUEST: 167 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) 168 + goto out_clear; 169 + 174 170 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 175 171 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); 176 172 break; ··· 186 176 break; 187 177 } 188 178 179 + return 0; 180 + 181 + out_clear: 182 + x25_write_internal(sk, X25_CLEAR_REQUEST); 183 + x25_start_t23timer(sk); 189 184 return 0; 190 185 } 191 186 ··· 221 206 break; 222 207 223 208 case X25_CLEAR_REQUEST: 209 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) 210 + goto out_clear; 211 + 224 212 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 225 213 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); 226 214 break; ··· 322 304 } 323 305 324 306 return queued; 307 + 308 + out_clear: 309 + x25_write_internal(sk, X25_CLEAR_REQUEST); 310 + x25->state = X25_STATE_2; 311 + x25_start_t23timer(sk); 312 + return 0; 325 313 } 326 314 327 315 /* ··· 337 313 */ 338 314 static int x25_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype) 339 315 { 316 + struct x25_sock *x25 = x25_sk(sk); 317 + 340 318 switch (frametype) { 341 319 342 320 case X25_RESET_REQUEST: 343 321 x25_write_internal(sk, X25_RESET_CONFIRMATION); 344 322 case X25_RESET_CONFIRMATION: { 345 - struct x25_sock *x25 = x25_sk(sk); 346 - 347 323 x25_stop_timer(sk); 348 324 x25->condition = 0x00; 349 325 x25->va = 0; ··· 355 331 break; 356 332 } 357 333 case X25_CLEAR_REQUEST: 334 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 2)) 335 + goto out_clear; 336 + 358 337 x25_write_internal(sk, X25_CLEAR_CONFIRMATION); 359 338 x25_disconnect(sk, 0, skb->data[3], skb->data[4]); 360 339 break; ··· 366 339 break; 367 340 } 368 341 342 + return 0; 343 + 344 + out_clear: 345 + x25_write_internal(sk, X25_CLEAR_REQUEST); 346 + x25->state = X25_STATE_2; 347 + x25_start_t23timer(sk); 369 348 return 0; 370 349 } 371 350
+3
net/x25/x25_link.c
··· 90 90 break; 91 91 92 92 case X25_DIAGNOSTIC: 93 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN + 4)) 94 + break; 95 + 93 96 printk(KERN_WARNING "x25: diagnostic #%d - %02X %02X %02X\n", 94 97 skb->data[3], skb->data[4], 95 98 skb->data[5], skb->data[6]);
+13 -1
net/x25/x25_subr.c
··· 269 269 int *d, int *m) 270 270 { 271 271 struct x25_sock *x25 = x25_sk(sk); 272 - unsigned char *frame = skb->data; 272 + unsigned char *frame; 273 + 274 + if (!pskb_may_pull(skb, X25_STD_MIN_LEN)) 275 + return X25_ILLEGAL; 276 + frame = skb->data; 273 277 274 278 *ns = *nr = *q = *d = *m = 0; 275 279 ··· 298 294 if (frame[2] == X25_RR || 299 295 frame[2] == X25_RNR || 300 296 frame[2] == X25_REJ) { 297 + if (!pskb_may_pull(skb, X25_EXT_MIN_LEN)) 298 + return X25_ILLEGAL; 299 + frame = skb->data; 300 + 301 301 *nr = (frame[3] >> 1) & 0x7F; 302 302 return frame[2]; 303 303 } ··· 316 308 317 309 if (x25->neighbour->extended) { 318 310 if ((frame[2] & 0x01) == X25_DATA) { 311 + if (!pskb_may_pull(skb, X25_EXT_MIN_LEN)) 312 + return X25_ILLEGAL; 313 + frame = skb->data; 314 + 319 315 *q = (frame[0] & X25_Q_BIT) == X25_Q_BIT; 320 316 *d = (frame[0] & X25_D_BIT) == X25_D_BIT; 321 317 *m = (frame[3] & X25_EXT_M_BIT) == X25_EXT_M_BIT;
+1
security/security.c
··· 1097 1097 { 1098 1098 security_ops->sk_clone_security(sk, newsk); 1099 1099 } 1100 + EXPORT_SYMBOL(security_sk_clone); 1100 1101 1101 1102 void security_sk_classify_flow(struct sock *sk, struct flowi *fl) 1102 1103 {