···27062706 functions are at fixed addresses, they make nice27072707 targets for exploits that can control RIP.2708270827092709- emulate [default] Vsyscalls turn into traps and are27102710- emulated reasonably safely.27092709+ emulate Vsyscalls turn into traps and are emulated27102710+ reasonably safely.2711271127122712- native Vsyscalls are native syscall instructions.27122712+ native [default] Vsyscalls are native syscall27132713+ instructions.27132714 This is a little bit faster than trapping27142715 and makes a few dynamic recompilers work27152716 better than they would in emulation mode.
+3-3
MAINTAINERS
···24682468F: drivers/infiniband/hw/ehca/2469246924702470EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER24712471-M: Breno Leitao <leitao@linux.vnet.ibm.com>24712471+M: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>24722472L: netdev@vger.kernel.org24732473S: Maintained24742474F: drivers/net/ethernet/ibm/ehea/···6374637463756375TEGRA SUPPORT63766376M: Colin Cross <ccross@android.com>63776377-M: Erik Gilling <konkers@android.com>63786377M: Olof Johansson <olof@lixom.net>63786378+M: Stephen Warren <swarren@nvidia.com>63796379L: linux-tegra@vger.kernel.org63806380-T: git git://android.git.kernel.org/kernel/tegra.git63806380+T: git git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git63816381S: Supported63826382F: arch/arm/mach-tegra63836383
···259259 writel(0, base + VIC_INT_SELECT);260260 writel(0, base + VIC_INT_ENABLE);261261 writel(~0, base + VIC_INT_ENABLE_CLEAR);262262- writel(0, base + VIC_IRQ_STATUS);263262 writel(0, base + VIC_ITCR);264263 writel(~0, base + VIC_INT_SOFT_CLEAR);265264}
···137137 */138138 reg = omap4_ctrl_pad_readl(control_pbias_offset);139139 reg &= ~(OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |140140- OMAP4_MMC1_PWRDNZ_MASK |141141- OMAP4_USBC1_ICUSB_PWRDNZ_MASK);140140+ OMAP4_MMC1_PWRDNZ_MASK);142141 omap4_ctrl_pad_writel(reg, control_pbias_offset);143142}144143···155156 else156157 reg |= OMAP4_MMC1_PBIASLITE_VMODE_MASK;157158 reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |158158- OMAP4_MMC1_PWRDNZ_MASK |159159- OMAP4_USBC1_ICUSB_PWRDNZ_MASK);159159+ OMAP4_MMC1_PWRDNZ_MASK);160160 omap4_ctrl_pad_writel(reg, control_pbias_offset);161161162162 timeout = jiffies + msecs_to_jiffies(5);···169171 if (reg & OMAP4_MMC1_PBIASLITE_VMODE_ERROR_MASK) {170172 pr_err("Pbias Voltage is not same as LDO\n");171173 /* Caution : On VMODE_ERROR Power Down MMC IO */172172- reg &= ~(OMAP4_MMC1_PWRDNZ_MASK |173173- OMAP4_USBC1_ICUSB_PWRDNZ_MASK);174174+ reg &= ~(OMAP4_MMC1_PWRDNZ_MASK);174175 omap4_ctrl_pad_writel(reg, control_pbias_offset);175176 }176177 } else {177178 reg = omap4_ctrl_pad_readl(control_pbias_offset);178179 reg |= (OMAP4_MMC1_PBIASLITE_PWRDNZ_MASK |179180 OMAP4_MMC1_PWRDNZ_MASK |180180- OMAP4_MMC1_PBIASLITE_VMODE_MASK |181181- OMAP4_USBC1_ICUSB_PWRDNZ_MASK);181181+ OMAP4_MMC1_PBIASLITE_VMODE_MASK);182182 omap4_ctrl_pad_writel(reg, control_pbias_offset);183183 }184184}
-3
arch/arm/mach-omap2/usb-musb.c
···137137 musb_plat.mode = board_data->mode;138138 musb_plat.extvbus = board_data->extvbus;139139140140- if (cpu_is_omap44xx())141141- omap4430_phy_init(dev);142142-143140 if (cpu_is_omap3517() || cpu_is_omap3505()) {144141 oh_name = "am35x_otg_hs";145142 name = "musb-am35x";
-1
arch/arm/mach-tegra/cpu-tegra.c
···32323333#include <asm/system.h>34343535-#include <mach/hardware.h>3635#include <mach/clk.h>37363837/* Frequency table index must be sequential starting at 0 */
···496496 */497497 bank_start = min(bank_start,498498 ALIGN(prev_bank_end, PAGES_PER_SECTION));499499+#else500500+ /*501501+ * Align down here since the VM subsystem insists that the502502+ * memmap entries are valid from the bank start aligned to503503+ * MAX_ORDER_NR_PAGES.504504+ */505505+ bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES);499506#endif500507 /*501508 * If we had a previous bank, and there is a space
+6
arch/mips/Kconfig
···2424 select GENERIC_IRQ_PROBE2525 select GENERIC_IRQ_SHOW2626 select HAVE_ARCH_JUMP_LABEL2727+ select IRQ_FORCED_THREADING27282829menu "Machine selection"2930···716715 select SYS_SUPPORTS_HIGHMEM717716 select SYS_SUPPORTS_HOTPLUG_CPU718717 select SYS_HAS_CPU_CAVIUM_OCTEON718718+ select HOLES_IN_ZONE719719 help720720 The Octeon simulator is software performance model of the Cavium721721 Octeon Processor. It supports simulating Octeon processors on x86···739737 select ZONE_DMA32740738 select USB_ARCH_HAS_OHCI741739 select USB_ARCH_HAS_EHCI740740+ select HOLES_IN_ZONE742741 help743742 This option supports all of the Octeon reference boards from Cavium744743 Networks. It builds a kernel that dynamically determines the Octeon···968965 bool969966970967config GENERIC_GPIO968968+ bool969969+970970+config HOLES_IN_ZONE971971 bool972972973973#
+1-1
arch/mips/alchemy/common/platform.c
···492492 memcpy(au1xxx_eth0_platform_data.mac, ethaddr, 6);493493494494 ret = platform_device_register(&au1xxx_eth0_device);495495- if (!ret)495495+ if (ret)496496 printk(KERN_INFO "Alchemy: failed to register MAC0\n");497497498498
+14-8
arch/mips/alchemy/common/power.c
···158158159159void au_sleep(void)160160{161161- int cpuid = alchemy_get_cputype();162162- if (cpuid != ALCHEMY_CPU_UNKNOWN) {163163- save_core_regs();164164- if (cpuid <= ALCHEMY_CPU_AU1500)165165- alchemy_sleep_au1000();166166- else if (cpuid <= ALCHEMY_CPU_AU1200)167167- alchemy_sleep_au1550();168168- restore_core_regs();161161+ save_core_regs();162162+163163+ switch (alchemy_get_cputype()) {164164+ case ALCHEMY_CPU_AU1000:165165+ case ALCHEMY_CPU_AU1500:166166+ case ALCHEMY_CPU_AU1100:167167+ alchemy_sleep_au1000();168168+ break;169169+ case ALCHEMY_CPU_AU1550:170170+ case ALCHEMY_CPU_AU1200:171171+ alchemy_sleep_au1550();172172+ break;169173 }174174+175175+ restore_core_regs();170176}171177172178#endif /* CONFIG_PM */
+4
arch/mips/alchemy/devboards/bcsr.c
···8989{9090 unsigned short bisr = __raw_readw(bcsr_virt + BCSR_REG_INTSTAT);91919292+ disable_irq_nosync(irq);9393+9294 for ( ; bisr; bisr &= bisr - 1)9395 generic_handle_irq(bcsr_csc_base + __ffs(bisr));9696+9797+ enable_irq(irq);9498}959996100/* NOTE: both the enable and mask bits must be cleared, otherwise the
-7
arch/mips/alchemy/devboards/db1200/setup.c
···2323 unsigned long freq0, clksrc, div, pfc;2424 unsigned short whoami;25252626- /* Set Config[OD] (disable overlapping bus transaction):2727- * This gets rid of a _lot_ of spurious interrupts (especially2828- * wrt. IDE); but incurs ~10% performance hit in some2929- * cpu-bound applications.3030- */3131- set_c0_config(1 << 19);3232-3326 bcsr_init(DB1200_BCSR_PHYS_ADDR,3427 DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS);3528
···1414#include <linux/bug.h>1515#include <linux/compiler.h>1616#include <linux/init.h>1717+#include <linux/kernel.h>1718#include <linux/mm.h>1819#include <linux/module.h>1920#include <linux/sched.h>···365364 return (regs->cp0_cause >> 2) & 0x1f;366365}367366368368-static DEFINE_SPINLOCK(die_lock);367367+static DEFINE_RAW_SPINLOCK(die_lock);369368370369void __noreturn die(const char *str, struct pt_regs *regs)371370{372371 static int die_counter;373372 int sig = SIGSEGV;374373#ifdef CONFIG_MIPS_MT_SMTC375375- unsigned long dvpret = dvpe();374374+ unsigned long dvpret;376375#endif /* CONFIG_MIPS_MT_SMTC */376376+377377+ oops_enter();377378378379 if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) == NOTIFY_STOP)379380 sig = 0;380381381382 console_verbose();382382- spin_lock_irq(&die_lock);383383+ raw_spin_lock_irq(&die_lock);384384+#ifdef CONFIG_MIPS_MT_SMTC385385+ dvpret = dvpe();386386+#endif /* CONFIG_MIPS_MT_SMTC */383387 bust_spinlocks(1);384388#ifdef CONFIG_MIPS_MT_SMTC385389 mips_mt_regdump(dvpret);···393387 printk("%s[#%d]:\n", str, ++die_counter);394388 show_registers(regs);395389 add_taint(TAINT_DIE);396396- spin_unlock_irq(&die_lock);390390+ raw_spin_unlock_irq(&die_lock);391391+392392+ oops_exit();397393398394 if (in_interrupt())399395 panic("Fatal exception in interrupt");
+1-1
arch/mips/kernel/vpe.c
···192192 }193193 spin_unlock(&vpecontrol.tc_list_lock);194194195195- return NULL;195195+ return res;196196}197197198198/* allocate a vpe and associate it with this minor (or index) */
+2-4
arch/mips/lantiq/irq.c
···123123static unsigned int ltq_startup_eiu_irq(struct irq_data *d)124124{125125 int i;126126- int irq_nr = d->irq - INT_NUM_IRQ0;127126128127 ltq_enable_irq(d);129128 for (i = 0; i < MAX_EIU; i++) {130130- if (irq_nr == ltq_eiu_irq[i]) {129129+ if (d->irq == ltq_eiu_irq[i]) {131130 /* low level - we should really handle set_type */132131 ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_C) |133132 (0x6 << (i * 4)), LTQ_EIU_EXIN_C);···146147static void ltq_shutdown_eiu_irq(struct irq_data *d)147148{148149 int i;149149- int irq_nr = d->irq - INT_NUM_IRQ0;150150151151 ltq_disable_irq(d);152152 for (i = 0; i < MAX_EIU; i++) {153153- if (irq_nr == ltq_eiu_irq[i]) {153153+ if (d->irq == ltq_eiu_irq[i]) {154154 /* disable */155155 ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~(1 << i),156156 LTQ_EIU_EXIN_INEN);
···66 * Copyright (C) 2011 Wind River Systems,77 * written by Ralf Baechle <ralf@linux-mips.org>88 */99+#include <linux/compiler.h>910#include <linux/errno.h>1011#include <linux/mm.h>1112#include <linux/mman.h>···1615#include <linux/sched.h>17161817unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */1919-2018EXPORT_SYMBOL(shm_align_mask);21192220/* gap between mmap and stack */2321#define MIN_GAP (128*1024*1024UL)2424-#define MAX_GAP ((TASK_SIZE)/6*5)2222+#define MAX_GAP ((TASK_SIZE)/6*5)25232624static int mmap_is_legacy(void)2725{···5757 return base - off;5858}59596060-#define COLOUR_ALIGN(addr,pgoff) \6060+#define COLOUR_ALIGN(addr, pgoff) \6161 ((((addr) + shm_align_mask) & ~shm_align_mask) + \6262 (((pgoff) << PAGE_SHIFT) & shm_align_mask))63636464enum mmap_allocation_direction {UP, DOWN};65656666-static unsigned long arch_get_unmapped_area_foo(struct file *filp,6666+static unsigned long arch_get_unmapped_area_common(struct file *filp,6767 unsigned long addr0, unsigned long len, unsigned long pgoff,6868 unsigned long flags, enum mmap_allocation_direction dir)6969{···103103104104 vma = find_vma(mm, addr);105105 if (TASK_SIZE - len >= addr &&106106- (!vma || addr + len <= vma->vm_start))106106+ (!vma || addr + len <= vma->vm_start))107107 return addr;108108 }109109110110 if (dir == UP) {111111 addr = mm->mmap_base;112112- if (do_color_align)113113- addr = COLOUR_ALIGN(addr, pgoff);114114- else115115- addr = PAGE_ALIGN(addr);112112+ if (do_color_align)113113+ addr = COLOUR_ALIGN(addr, pgoff);114114+ else115115+ addr = PAGE_ALIGN(addr);116116117117 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {118118 /* At this point: (!vma || addr < vma->vm_end). */···131131 mm->free_area_cache = mm->mmap_base;132132 }133133134134- /* either no address requested or can't fit in requested address hole */134134+ /*135135+ * either no address requested, or the mapping can't fit into136136+ * the requested address hole137137+ */135138 addr = mm->free_area_cache;136136- if (do_color_align) {137137- unsigned long base =138138- COLOUR_ALIGN_DOWN(addr - len, pgoff);139139-139139+ if (do_color_align) {140140+ unsigned long base =141141+ COLOUR_ALIGN_DOWN(addr - len, pgoff);140142 addr = base + len;141141- }143143+ }142144143145 /* make sure it can fit in the remaining address space */144146 if (likely(addr > len)) {145147 vma = find_vma(mm, addr - len);146148 if (!vma || addr <= vma->vm_start) {147147- /* remember the address as a hint for next time */148148- return mm->free_area_cache = addr-len;149149+ /* cache the address as a hint for next time */150150+ return mm->free_area_cache = addr - len;149151 }150152 }151153152154 if (unlikely(mm->mmap_base < len))153155 goto bottomup;154156155155- addr = mm->mmap_base-len;157157+ addr = mm->mmap_base - len;156158 if (do_color_align)157159 addr = COLOUR_ALIGN_DOWN(addr, pgoff);158160···165163 * return with success:166164 */167165 vma = find_vma(mm, addr);168168- if (likely(!vma || addr+len <= vma->vm_start)) {169169- /* remember the address as a hint for next time */166166+ if (likely(!vma || addr + len <= vma->vm_start)) {167167+ /* cache the address as a hint for next time */170168 return mm->free_area_cache = addr;171169 }172170···175173 mm->cached_hole_size = vma->vm_start - addr;176174177175 /* try just below the current vma->vm_start */178178- addr = vma->vm_start-len;176176+ addr = vma->vm_start - len;179177 if (do_color_align)180178 addr = COLOUR_ALIGN_DOWN(addr, pgoff);181179 } while (likely(len < vma->vm_start));···203201unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr0,204202 unsigned long len, unsigned long pgoff, unsigned long flags)205203{206206- return arch_get_unmapped_area_foo(filp,204204+ return arch_get_unmapped_area_common(filp,207205 addr0, len, pgoff, flags, UP);208206}209207···215213 unsigned long addr0, unsigned long len, unsigned long pgoff,216214 unsigned long flags)217215{218218- return arch_get_unmapped_area_foo(filp,216216+ return arch_get_unmapped_area_common(filp,219217 addr0, len, pgoff, flags, DOWN);220218}221219
+3-3
arch/mips/mm/tlbex.c
···17591759 u32 *p = handle_tlbm;17601760 struct uasm_label *l = labels;17611761 struct uasm_reloc *r = relocs;17621762- struct work_registers wr;1763176217641763 memset(handle_tlbm, 0, sizeof(handle_tlbm));17651764 memset(labels, 0, sizeof(labels));17661765 memset(relocs, 0, sizeof(relocs));1767176617681767 build_r3000_tlbchange_handler_head(&p, K0, K1);17691769- build_pte_modifiable(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbm);17681768+ build_pte_modifiable(&p, &r, K0, K1, -1, label_nopage_tlbm);17701769 uasm_i_nop(&p); /* load delay */17711770 build_make_write(&p, &r, K0, K1);17721771 build_r3000_pte_reload_tlbwi(&p, K0, K1);···19621963 uasm_i_andi(&p, wr.r3, wr.r3, 2);19631964 uasm_il_beqz(&p, &r, wr.r3, label_tlbl_goaround2);19641965 }19651965-19661966+ if (PM_DEFAULT_MASK == 0)19671967+ uasm_i_nop(&p);19661968 /*19671969 * We clobbered C0_PAGEMASK, restore it. On the other branch19681970 * it is restored in build_huge_tlb_write_entry.
···678678 pentry = (struct sfi_device_table_entry *)sb->pentry;679679680680 for (i = 0; i < num; i++, pentry++) {681681- if (pentry->irq != (u8)0xff) { /* native RTE case */681681+ int irq = pentry->irq;682682+683683+ if (irq != (u8)0xff) { /* native RTE case */682684 /* these SPI2 devices are not exposed to system as PCI683685 * devices, but they have separate RTE entry in IOAPIC684686 * so we have to enable them one by one here685687 */686686- ioapic = mp_find_ioapic(pentry->irq);688688+ ioapic = mp_find_ioapic(irq);687689 irq_attr.ioapic = ioapic;688688- irq_attr.ioapic_pin = pentry->irq;690690+ irq_attr.ioapic_pin = irq;689691 irq_attr.trigger = 1;690692 irq_attr.polarity = 1;691691- io_apic_set_pci_routing(NULL, pentry->irq, &irq_attr);693693+ io_apic_set_pci_routing(NULL, irq, &irq_attr);692694 } else693693- pentry->irq = 0; /* No irq */695695+ irq = 0; /* No irq */694696695697 switch (pentry->type) {696698 case SFI_DEV_TYPE_IPC:697699 /* ID as IRQ is a hack that will go away */698698- pdev = platform_device_alloc(pentry->name, pentry->irq);700700+ pdev = platform_device_alloc(pentry->name, irq);699701 if (pdev == NULL) {700702 pr_err("out of memory for SFI platform device '%s'.\n",701703 pentry->name);702704 continue;703705 }704704- install_irq_resource(pdev, pentry->irq);706706+ install_irq_resource(pdev, irq);705707 pr_debug("info[%2d]: IPC bus, name = %16.16s, "706706- "irq = 0x%2x\n", i, pentry->name, pentry->irq);708708+ "irq = 0x%2x\n", i, pentry->name, irq);707709 sfi_handle_ipc_dev(pdev);708710 break;709711 case SFI_DEV_TYPE_SPI:710712 memset(&spi_info, 0, sizeof(spi_info));711713 strncpy(spi_info.modalias, pentry->name, SFI_NAME_LEN);712712- spi_info.irq = pentry->irq;714714+ spi_info.irq = irq;713715 spi_info.bus_num = pentry->host_num;714716 spi_info.chip_select = pentry->addr;715717 spi_info.max_speed_hz = pentry->max_freq;···728726 memset(&i2c_info, 0, sizeof(i2c_info));729727 bus = pentry->host_num;730728 strncpy(i2c_info.type, pentry->name, SFI_NAME_LEN);731731- i2c_info.irq = pentry->irq;729729+ i2c_info.irq = irq;732730 i2c_info.addr = pentry->addr;733731 pr_debug("info[%2d]: I2C bus = %d, name = %16.16s, "734732 "irq = 0x%2x, addr = 0x%x\n", i, bus,
···129129 for (retry = 0; retry < 4; retry++) {130130 ret = radeon_process_aux_ch(dig_connector->dp_i2c_bus,131131 msg, msg_bytes, NULL, 0, delay, &ack);132132- if (ret < 0)132132+ if (ret == -EBUSY)133133+ continue;134134+ else if (ret < 0)133135 return ret;134136 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)135137 return send_bytes;···162160 for (retry = 0; retry < 4; retry++) {163161 ret = radeon_process_aux_ch(dig_connector->dp_i2c_bus,164162 msg, msg_bytes, recv, recv_bytes, delay, &ack);165165- if (ret < 0)163163+ if (ret == -EBUSY)164164+ continue;165165+ else if (ret < 0)166166 return ret;167167 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)168168 return ret;···240236 for (retry = 0; retry < 4; retry++) {241237 ret = radeon_process_aux_ch(auxch,242238 msg, msg_bytes, reply, reply_bytes, 0, &ack);243243- if (ret < 0) {239239+ if (ret == -EBUSY)240240+ continue;241241+ else if (ret < 0) {244242 DRM_DEBUG_KMS("aux_ch failed %d\n", ret);245243 return ret;246244 }
+6-15
drivers/gpu/drm/radeon/radeon_connectors.c
···13031303 /* get the DPCD from the bridge */13041304 radeon_dp_getdpcd(radeon_connector);1305130513061306- if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))13071307- ret = connector_status_connected;13081308- else {13091309- /* need to setup ddc on the bridge */13101310- if (encoder)13111311- radeon_atom_ext_encoder_setup_ddc(encoder);13061306+ if (encoder) {13071307+ /* setup ddc on the bridge */13081308+ radeon_atom_ext_encoder_setup_ddc(encoder);13121309 if (radeon_ddc_probe(radeon_connector,13131313- radeon_connector->requires_extended_probe))13101310+ radeon_connector->requires_extended_probe)) /* try DDC */13141311 ret = connector_status_connected;13151315- }13161316-13171317- if ((ret == connector_status_disconnected) &&13181318- radeon_connector->dac_load_detect) {13191319- struct drm_encoder *encoder = radeon_best_single_encoder(connector);13201320- struct drm_encoder_helper_funcs *encoder_funcs;13211321- if (encoder) {13221322- encoder_funcs = encoder->helper_private;13121312+ else if (radeon_connector->dac_load_detect) { /* try load detection */13131313+ struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;13231314 ret = encoder_funcs->detect(encoder, connector);13241315 }13251316 }
+22-4
drivers/gpu/drm/radeon/radeon_encoders.c
···16381638 break;16391639 case 2:16401640 args.v2.ucCRTC = radeon_crtc->crtc_id;16411641- args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);16411641+ if (radeon_encoder_is_dp_bridge(encoder)) {16421642+ struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);16431643+16441644+ if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)16451645+ args.v2.ucEncodeMode = ATOM_ENCODER_MODE_LVDS;16461646+ else if (connector->connector_type == DRM_MODE_CONNECTOR_VGA)16471647+ args.v2.ucEncodeMode = ATOM_ENCODER_MODE_CRT;16481648+ else16491649+ args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);16501650+ } else16511651+ args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);16421652 switch (radeon_encoder->encoder_id) {16431653 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:16441654 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:···17651755 /* DCE4/5 */17661756 if (ASIC_IS_DCE4(rdev)) {17671757 dig = radeon_encoder->enc_priv;17681768- if (ASIC_IS_DCE41(rdev))17691769- return radeon_crtc->crtc_id;17701770- else {17581758+ if (ASIC_IS_DCE41(rdev)) {17591759+ /* ontario follows DCE4 */17601760+ if (rdev->family == CHIP_PALM) {17611761+ if (dig->linkb)17621762+ return 1;17631763+ else17641764+ return 0;17651765+ } else17661766+ /* llano follows DCE3.2 */17671767+ return radeon_crtc->crtc_id;17681768+ } else {17711769 switch (radeon_encoder->encoder_id) {17721770 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:17731771 if (dig->linkb)
···327327 select BLK_DEV_IDEPCI328328 help329329 This is a driver for the OPTi 82C621 EIDE controller.330330- Please read the comments at the top of <file:drivers/ide/pci/opti621.c>.330330+ Please read the comments at the top of <file:drivers/ide/opti621.c>.331331332332config BLK_DEV_RZ1000333333 tristate "RZ1000 chipset bugfix/support"···365365 normal dual channel support.366366367367 Please read the comments at the top of368368- <file:drivers/ide/pci/alim15x3.c>.368368+ <file:drivers/ide/alim15x3.c>.369369370370 If unsure, say N.371371···528528 This driver adds detection and support for the NS87415 chip529529 (used mainly on SPARC64 and PA-RISC machines).530530531531- Please read the comments at the top of <file:drivers/ide/pci/ns87415.c>.531531+ Please read the comments at the top of <file:drivers/ide/ns87415.c>.532532533533config BLK_DEV_PDC202XX_OLD534534 tristate "PROMISE PDC202{46|62|65|67} support"···547547 for more than one card.548548549549 Please read the comments at the top of550550- <file:drivers/ide/pci/pdc202xx_old.c>.550550+ <file:drivers/ide/pdc202xx_old.c>.551551552552 If unsure, say N.553553···593593 ATA100: SiS635, SiS645, SiS650, SiS730, SiS735, SiS740,594594 SiS745, SiS750595595596596- Please read the comments at the top of <file:drivers/ide/pci/sis5513.c>.596596+ Please read the comments at the top of <file:drivers/ide/sis5513.c>.597597598598config BLK_DEV_SL82C105599599 tristate "Winbond SL82c105 support"···616616 look-a-like to the PIIX4 it should be a nice addition.617617618618 Please read the comments at the top of619619- <file:drivers/ide/pci/slc90e66.c>.619619+ <file:drivers/ide/slc90e66.c>.620620621621config BLK_DEV_TRM290622622 tristate "Tekram TRM290 chipset support"···625625 This driver adds support for bus master DMA transfers626626 using the Tekram TRM290 PCI IDE chip. Volunteers are627627 needed for further tweaking and development.628628- Please read the comments at the top of <file:drivers/ide/pci/trm290.c>.628628+ Please read the comments at the top of <file:drivers/ide/trm290.c>.629629630630config BLK_DEV_VIA82CXXX631631 tristate "VIA82CXXX chipset support"···836836 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster837837 I/O speeds to be set as well.838838 See the files <file:Documentation/ide/ide.txt> and839839- <file:drivers/ide/legacy/ali14xx.c> for more info.839839+ <file:drivers/ide/ali14xx.c> for more info.840840841841config BLK_DEV_DTC2278842842 tristate "DTC-2278 support"···847847 boot parameter. It enables support for the secondary IDE interface848848 of the DTC-2278 card, and permits faster I/O speeds to be set as849849 well. See the <file:Documentation/ide/ide.txt> and850850- <file:drivers/ide/legacy/dtc2278.c> files for more info.850850+ <file:drivers/ide/dtc2278.c> files for more info.851851852852config BLK_DEV_HT6560B853853 tristate "Holtek HT6560B support"···858858 boot parameter. It enables support for the secondary IDE interface859859 of the Holtek card, and permits faster I/O speeds to be set as well.860860 See the <file:Documentation/ide/ide.txt> and861861- <file:drivers/ide/legacy/ht6560b.c> files for more info.861861+ <file:drivers/ide/ht6560b.c> files for more info.862862863863config BLK_DEV_QD65XX864864 tristate "QDI QD65xx support"···867867 help868868 This driver is enabled at runtime using the "qd65xx.probe" kernel869869 boot parameter. It permits faster I/O speeds to be set. See the870870- <file:Documentation/ide/ide.txt> and <file:drivers/ide/legacy/qd65xx.c>870870+ <file:Documentation/ide/ide.txt> and <file:drivers/ide/qd65xx.c>871871 for more info.872872873873config BLK_DEV_UMC8672···879879 boot parameter. It enables support for the secondary IDE interface880880 of the UMC-8672, and permits faster I/O speeds to be set as well.881881 See the files <file:Documentation/ide/ide.txt> and882882- <file:drivers/ide/legacy/umc8672.c> for more info.882882+ <file:drivers/ide/umc8672.c> for more info.883883884884endif885885
+1-1
drivers/media/video/v4l2-dev.c
···181181 * TODO: In the long run all drivers that use v4l2_device should use the182182 * v4l2_device release callback. This check will then be unnecessary.183183 */184184- if (v4l2_dev->release == NULL)184184+ if (v4l2_dev && v4l2_dev->release == NULL)185185 v4l2_dev = NULL;186186187187 /* Release video_device and perform other
···478478 spin_unlock_irqrestore(<q_asc_lock, flags);479479480480 /* Don't rewrite B0 */481481- if (tty_termios_baud_rate(new))481481+ if (tty_termios_baud_rate(new))482482 tty_termios_encode_baud_rate(new, baud, baud);483483+484484+ uart_update_timeout(port, cflag, baud);483485}484486485487static const char*
+10-1
fs/btrfs/ioctl.c
···10471047 if (!max_to_defrag)10481048 max_to_defrag = last_index - 1;1049104910501050- while (i <= last_index && defrag_count < max_to_defrag) {10501050+ /*10511051+ * make writeback starts from i, so the defrag range can be10521052+ * written sequentially.10531053+ */10541054+ if (i < inode->i_mapping->writeback_index)10551055+ inode->i_mapping->writeback_index = i;10561056+10571057+ while (i <= last_index && defrag_count < max_to_defrag &&10581058+ (i < (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >>10591059+ PAGE_CACHE_SHIFT)) {10511060 /*10521061 * make sure we stop running if someone unmounts10531062 * the FS
+1-1
fs/cifs/connect.c
···20182018 warned_on_ntlm = true;20192019 cERROR(1, "default security mechanism requested. The default "20202020 "security mechanism will be upgraded from ntlm to "20212021- "ntlmv2 in kernel release 3.1");20212021+ "ntlmv2 in kernel release 3.2");20222022 }20232023 ses->overrideSecFlg = volume_info->secFlg;20242024
+2-1
fs/xfs/xfs_buf_item.c
···629629 * the xfsbufd to get this buffer written. We have to unlock the buffer630630 * to allow the xfsbufd to write it, too.631631 */632632-STATIC void632632+STATIC bool633633xfs_buf_item_pushbuf(634634 struct xfs_log_item *lip)635635{···643643644644 xfs_buf_delwri_promote(bp);645645 xfs_buf_relse(bp);646646+ return true;646647}647648648649STATIC void
+7-3
fs/xfs/xfs_dquot_item.c
···183183 * search the buffer cache can be a time consuming thing, and AIL lock is a184184 * spinlock.185185 */186186-STATIC void186186+STATIC bool187187xfs_qm_dquot_logitem_pushbuf(188188 struct xfs_log_item *lip)189189{190190 struct xfs_dq_logitem *qlip = DQUOT_ITEM(lip);191191 struct xfs_dquot *dqp = qlip->qli_dquot;192192 struct xfs_buf *bp;193193+ bool ret = true;193194194195 ASSERT(XFS_DQ_IS_LOCKED(dqp));195196···202201 if (completion_done(&dqp->q_flush) ||203202 !(lip->li_flags & XFS_LI_IN_AIL)) {204203 xfs_dqunlock(dqp);205205- return;204204+ return true;206205 }207206208207 bp = xfs_incore(dqp->q_mount->m_ddev_targp, qlip->qli_format.qlf_blkno,209208 dqp->q_mount->m_quotainfo->qi_dqchunklen, XBF_TRYLOCK);210209 xfs_dqunlock(dqp);211210 if (!bp)212212- return;211211+ return true;213212 if (XFS_BUF_ISDELAYWRITE(bp))214213 xfs_buf_delwri_promote(bp);214214+ if (xfs_buf_ispinned(bp))215215+ ret = false;215216 xfs_buf_relse(bp);217217+ return ret;216218}217219218220/*
+7-3
fs/xfs/xfs_inode_item.c
···708708 * marked delayed write. If that's the case, we'll promote it and that will709709 * allow the caller to write the buffer by triggering the xfsbufd to run.710710 */711711-STATIC void711711+STATIC bool712712xfs_inode_item_pushbuf(713713 struct xfs_log_item *lip)714714{715715 struct xfs_inode_log_item *iip = INODE_ITEM(lip);716716 struct xfs_inode *ip = iip->ili_inode;717717 struct xfs_buf *bp;718718+ bool ret = true;718719719720 ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED));720721···726725 if (completion_done(&ip->i_flush) ||727726 !(lip->li_flags & XFS_LI_IN_AIL)) {728727 xfs_iunlock(ip, XFS_ILOCK_SHARED);729729- return;728728+ return true;730729 }731730732731 bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno,···734733735734 xfs_iunlock(ip, XFS_ILOCK_SHARED);736735 if (!bp)737737- return;736736+ return true;738737 if (XFS_BUF_ISDELAYWRITE(bp))739738 xfs_buf_delwri_promote(bp);739739+ if (xfs_buf_ispinned(bp))740740+ ret = false;740741 xfs_buf_relse(bp);742742+ return ret;741743}742744743745/*
···2828#include "xfs_trans_priv.h"2929#include "xfs_error.h"30303131-struct workqueue_struct *xfs_ail_wq; /* AIL workqueue */3232-3331#ifdef DEBUG3432/*3533 * Check that the list is sorted as it should be.···354356 xfs_trans_ail_cursor_clear(ailp, lip);355357}356358357357-/*358358- * xfs_ail_worker does the work of pushing on the AIL. It will requeue itself359359- * to run at a later time if there is more work to do to complete the push.360360- */361361-STATIC void362362-xfs_ail_worker(363363- struct work_struct *work)359359+static long360360+xfsaild_push(361361+ struct xfs_ail *ailp)364362{365365- struct xfs_ail *ailp = container_of(to_delayed_work(work),366366- struct xfs_ail, xa_work);367363 xfs_mount_t *mp = ailp->xa_mount;368364 struct xfs_ail_cursor cur;369365 xfs_log_item_t *lip;···419427420428 case XFS_ITEM_PUSHBUF:421429 XFS_STATS_INC(xs_push_ail_pushbuf);422422- IOP_PUSHBUF(lip);423423- ailp->xa_last_pushed_lsn = lsn;430430+431431+ if (!IOP_PUSHBUF(lip)) {432432+ stuck++;433433+ flush_log = 1;434434+ } else {435435+ ailp->xa_last_pushed_lsn = lsn;436436+ }424437 push_xfsbufd = 1;425438 break;426439···437440438441 case XFS_ITEM_LOCKED:439442 XFS_STATS_INC(xs_push_ail_locked);440440- ailp->xa_last_pushed_lsn = lsn;441443 stuck++;442444 break;443445···497501 /* We're past our target or empty, so idle */498502 ailp->xa_last_pushed_lsn = 0;499503500500- /*501501- * We clear the XFS_AIL_PUSHING_BIT first before checking502502- * whether the target has changed. If the target has changed,503503- * this pushes the requeue race directly onto the result of the504504- * atomic test/set bit, so we are guaranteed that either the505505- * the pusher that changed the target or ourselves will requeue506506- * the work (but not both).507507- */508508- clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags);509509- smp_rmb();510510- if (XFS_LSN_CMP(ailp->xa_target, target) == 0 ||511511- test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags))512512- return;513513-514504 tout = 50;515505 } else if (XFS_LSN_CMP(lsn, target) >= 0) {516506 /*···519537 tout = 20;520538 }521539522522- /* There is more to do, requeue us. */523523- queue_delayed_work(xfs_syncd_wq, &ailp->xa_work,524524- msecs_to_jiffies(tout));540540+ return tout;541541+}542542+543543+static int544544+xfsaild(545545+ void *data)546546+{547547+ struct xfs_ail *ailp = data;548548+ long tout = 0; /* milliseconds */549549+550550+ while (!kthread_should_stop()) {551551+ if (tout && tout <= 20)552552+ __set_current_state(TASK_KILLABLE);553553+ else554554+ __set_current_state(TASK_INTERRUPTIBLE);555555+ schedule_timeout(tout ?556556+ msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT);557557+558558+ try_to_freeze();559559+560560+ tout = xfsaild_push(ailp);561561+ }562562+563563+ return 0;525564}526565527566/*···577574 */578575 smp_wmb();579576 xfs_trans_ail_copy_lsn(ailp, &ailp->xa_target, &threshold_lsn);580580- if (!test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags))581581- queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 0);577577+ smp_wmb();578578+579579+ wake_up_process(ailp->xa_task);582580}583581584582/*···817813 INIT_LIST_HEAD(&ailp->xa_ail);818814 INIT_LIST_HEAD(&ailp->xa_cursors);819815 spin_lock_init(&ailp->xa_lock);820820- INIT_DELAYED_WORK(&ailp->xa_work, xfs_ail_worker);816816+817817+ ailp->xa_task = kthread_run(xfsaild, ailp, "xfsaild/%s",818818+ ailp->xa_mount->m_fsname);819819+ if (IS_ERR(ailp->xa_task))820820+ goto out_free_ailp;821821+821822 mp->m_ail = ailp;822823 return 0;824824+825825+out_free_ailp:826826+ kmem_free(ailp);827827+ return ENOMEM;823828}824829825830void···837824{838825 struct xfs_ail *ailp = mp->m_ail;839826840840- cancel_delayed_work_sync(&ailp->xa_work);827827+ kthread_stop(ailp->xa_task);841828 kmem_free(ailp);842829}
···420420421421 /*422422 * Requests a Tx timestamp for 'skb'. The phy driver promises423423- * to deliver it to the socket's error queue as soon as a423423+ * to deliver it using skb_complete_tx_timestamp() as soon as a424424 * timestamp becomes available. One of the PTP_CLASS_ values425425 * is passed in 'type'.426426 */
+6-1
include/linux/skbuff.h
···22162216/**22172217 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps22182218 *22192219+ * PHY drivers may accept clones of transmitted packets for22202220+ * timestamping via their phy_driver.txtstamp method. These drivers22212221+ * must call this function to return the skb back to the stack, with22222222+ * or without a timestamp.22232223+ *22192224 * @skb: clone of the the original outgoing packet22202220- * @hwtstamps: hardware time stamps22252225+ * @hwtstamps: hardware time stamps, may be NULL if not available22212226 *22222227 */22232228void skb_complete_tx_timestamp(struct sk_buff *skb,
+1
include/net/ip_vs.h
···900900 volatile int sync_state;901901 volatile int master_syncid;902902 volatile int backup_syncid;903903+ struct mutex sync_mutex;903904 /* multicast interface name */904905 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN];905906 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
+34-35
include/net/udplite.h
···6666 return 0;6767}68686969-static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh)7070-{7171- int cscov = up->len;7272-7373- /*7474- * Sender has set `partial coverage' option on UDP-Lite socket7575- */7676- if (up->pcflag & UDPLITE_SEND_CC) {7777- if (up->pcslen < up->len) {7878- /* up->pcslen == 0 means that full coverage is required,7979- * partial coverage only if 0 < up->pcslen < up->len */8080- if (0 < up->pcslen) {8181- cscov = up->pcslen;8282- }8383- uh->len = htons(up->pcslen);8484- }8585- /*8686- * NOTE: Causes for the error case `up->pcslen > up->len':8787- * (i) Application error (will not be penalized).8888- * (ii) Payload too big for send buffer: data is split8989- * into several packets, each with its own header.9090- * In this case (e.g. last segment), coverage may9191- * exceed packet length.9292- * Since packets with coverage length > packet length are9393- * illegal, we fall back to the defaults here.9494- */9595- }9696- return cscov;9797-}9898-6969+/* Slow-path computation of checksum. Socket is locked. */9970static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)10071{101101- int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));7272+ const struct udp_sock *up = udp_sk(skb->sk);7373+ int cscov = up->len;10274 __wsum csum = 0;7575+7676+ if (up->pcflag & UDPLITE_SEND_CC) {7777+ /*7878+ * Sender has set `partial coverage' option on UDP-Lite socket.7979+ * The special case "up->pcslen == 0" signifies full coverage.8080+ */8181+ if (up->pcslen < up->len) {8282+ if (0 < up->pcslen)8383+ cscov = up->pcslen;8484+ udp_hdr(skb)->len = htons(up->pcslen);8585+ }8686+ /*8787+ * NOTE: Causes for the error case `up->pcslen > up->len':8888+ * (i) Application error (will not be penalized).8989+ * (ii) Payload too big for send buffer: data is split9090+ * into several packets, each with its own header.9191+ * In this case (e.g. last segment), coverage may9292+ * exceed packet length.9393+ * Since packets with coverage length > packet length are9494+ * illegal, we fall back to the defaults here.9595+ */9696+ }1039710498 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */10599···109115 return csum;110116}111117118118+/* Fast-path computation of checksum. Socket may not be locked. */112119static inline __wsum udplite_csum(struct sk_buff *skb)113120{114114- struct sock *sk = skb->sk;115115- int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));121121+ const struct udp_sock *up = udp_sk(skb->sk);116122 const int off = skb_transport_offset(skb);117117- const int len = skb->len - off;123123+ int len = skb->len - off;118124125125+ if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) {126126+ if (0 < up->pcslen)127127+ len = up->pcslen;128128+ udp_hdr(skb)->len = htons(up->pcslen);129129+ }119130 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */120131121121- return skb_checksum(skb, off, min(cscov, len), 0);132132+ return skb_checksum(skb, off, len, 0);122133}123134124135extern void udplite4_register(void);
+4-3
kernel/posix-cpu-timers.c
···274274 struct task_cputime sum;275275 unsigned long flags;276276277277- spin_lock_irqsave(&cputimer->lock, flags);278277 if (!cputimer->running) {279279- cputimer->running = 1;280278 /*281279 * The POSIX timer interface allows for absolute time expiry282280 * values through the TIMER_ABSTIME flag, therefore we have···282284 * it.283285 */284286 thread_group_cputime(tsk, &sum);287287+ spin_lock_irqsave(&cputimer->lock, flags);288288+ cputimer->running = 1;285289 update_gt_cputime(&cputimer->cputime, &sum);286286- }290290+ } else291291+ spin_lock_irqsave(&cputimer->lock, flags);287292 *times = cputimer->cputime;288293 spin_unlock_irqrestore(&cputimer->lock, flags);289294}
+1-1
kernel/sys.c
···11721172static int override_release(char __user *release, int len)11731173{11741174 int ret = 0;11751175- char buf[len];11751175+ char buf[65];1176117611771177 if (current->personality & UNAME26) {11781178 char *rest = UTS_RELEASE;
+4-4
mm/migrate.c
···120120121121 ptep = pte_offset_map(pmd, addr);122122123123- if (!is_swap_pte(*ptep)) {124124- pte_unmap(ptep);125125- goto out;126126- }123123+ /*124124+ * Peek to check is_swap_pte() before taking ptlock? No, we125125+ * can race mremap's move_ptes(), which skips anon_vma lock.126126+ */127127128128 ptl = pte_lockptr(mm, pmd);129129 }
+6-1
net/batman-adv/translation-table.c
···10491049 tt_response = (struct tt_query_packet *)skb_put(skb,10501050 tt_query_size + tt_len);10511051 tt_response->ttvn = ttvn;10521052- tt_response->tt_data = htons(tt_tot);1053105210541053 tt_change = (struct tt_change *)(skb->data + tt_query_size);10551054 tt_count = 0;···10731074 }10741075 }10751076 rcu_read_unlock();10771077+10781078+ /* store in the message the number of entries we have successfully10791079+ * copied */10801080+ tt_response->tt_data = htons(tt_count);1076108110771082out:10781083 return skb;···17251722 rcu_read_lock();17261723 hlist_for_each_entry_rcu(tt_local_entry, node,17271724 head, hash_entry) {17251725+ if (!(tt_local_entry->flags & flags))17261726+ continue;17281727 tt_local_entry->flags &= ~flags;17291728 atomic_inc(&bat_priv->num_local_tt);17301729 }
···62666266 */62676267 call_netdevice_notifiers(NETDEV_UNREGISTER, dev);62686268 call_netdevice_notifiers(NETDEV_UNREGISTER_BATCH, dev);62696269+ rtmsg_ifinfo(RTM_DELLINK, dev, ~0U);6269627062706271 /*62716272 * Flush the unicast and multicast chains
+4-1
net/core/fib_rules.c
···475475476476 list_del_rcu(&rule->list);477477478478- if (rule->action == FR_ACT_GOTO)478478+ if (rule->action == FR_ACT_GOTO) {479479 ops->nr_goto_rules--;480480+ if (rtnl_dereference(rule->ctarget) == NULL)481481+ ops->unresolved_rules--;482482+ }480483481484 /*482485 * Check if this rule is a target to any of them. If so,
+11-3
net/core/timestamping.c
···5757 case PTP_CLASS_V2_VLAN:5858 phydev = skb->dev->phydev;5959 if (likely(phydev->drv->txtstamp)) {6060- clone = skb_clone(skb, GFP_ATOMIC);6161- if (!clone)6060+ if (!atomic_inc_not_zero(&sk->sk_refcnt))6261 return;6262+ clone = skb_clone(skb, GFP_ATOMIC);6363+ if (!clone) {6464+ sock_put(sk);6565+ return;6666+ }6367 clone->sk = sk;6468 phydev->drv->txtstamp(phydev, clone, type);6569 }···8177 struct sock_exterr_skb *serr;8278 int err;83798484- if (!hwtstamps)8080+ if (!hwtstamps) {8181+ sock_put(sk);8282+ kfree_skb(skb);8583 return;8484+ }86858786 *skb_hwtstamps(skb) = *hwtstamps;8887 serr = SKB_EXT_ERR(skb);···9487 serr->ee.ee_origin = SO_EE_ORIGIN_TIMESTAMPING;9588 skb->sk = NULL;9689 err = sock_queue_err_skb(sk, skb);9090+ sock_put(sk);9791 if (err)9892 kfree_skb(skb);9993}
-2
net/ipv4/ip_gre.c
···835835 if (skb_headroom(skb) < max_headroom || skb_shared(skb)||836836 (skb_cloned(skb) && !skb_clone_writable(skb, 0))) {837837 struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);838838- if (max_headroom > dev->needed_headroom)839839- dev->needed_headroom = max_headroom;840838 if (!new_skb) {841839 ip_rt_put(rt);842840 dev->stats.tx_dropped++;
+31-5
net/ipv4/route.c
···13081308void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,13091309 __be32 saddr, struct net_device *dev)13101310{13111311+ int s, i;13111312 struct in_device *in_dev = __in_dev_get_rcu(dev);13131313+ struct rtable *rt;13141314+ __be32 skeys[2] = { saddr, 0 };13151315+ int ikeys[2] = { dev->ifindex, 0 };13161316+ struct flowi4 fl4;13121317 struct inet_peer *peer;13131318 struct net *net;13141319···13361331 goto reject_redirect;13371332 }1338133313391339- peer = inet_getpeer_v4(daddr, 1);13401340- if (peer) {13411341- peer->redirect_learned.a4 = new_gw;13341334+ memset(&fl4, 0, sizeof(fl4));13351335+ fl4.daddr = daddr;13361336+ for (s = 0; s < 2; s++) {13371337+ for (i = 0; i < 2; i++) {13381338+ fl4.flowi4_oif = ikeys[i];13391339+ fl4.saddr = skeys[s];13401340+ rt = __ip_route_output_key(net, &fl4);13411341+ if (IS_ERR(rt))13421342+ continue;1342134313431343- inet_putpeer(peer);13441344+ if (rt->dst.error || rt->dst.dev != dev ||13451345+ rt->rt_gateway != old_gw) {13461346+ ip_rt_put(rt);13471347+ continue;13481348+ }1344134913451345- atomic_inc(&__rt_peer_genid);13501350+ if (!rt->peer)13511351+ rt_bind_peer(rt, rt->rt_dst, 1);13521352+13531353+ peer = rt->peer;13541354+ if (peer) {13551355+ peer->redirect_learned.a4 = new_gw;13561356+ atomic_inc(&__rt_peer_genid);13571357+ }13581358+13591359+ ip_rt_put(rt);13601360+ return;13611361+ }13461362 }13471363 return;13481364
···22832283 struct ip_vs_service *svc;22842284 struct ip_vs_dest_user *udest_compat;22852285 struct ip_vs_dest_user_kern udest;22862286+ struct netns_ipvs *ipvs = net_ipvs(net);2286228722872288 if (!capable(CAP_NET_ADMIN))22882289 return -EPERM;···23042303 /* increase the module use count */23052304 ip_vs_use_count_inc();2306230523062306+ /* Handle daemons since they have another lock */23072307+ if (cmd == IP_VS_SO_SET_STARTDAEMON ||23082308+ cmd == IP_VS_SO_SET_STOPDAEMON) {23092309+ struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;23102310+23112311+ if (mutex_lock_interruptible(&ipvs->sync_mutex)) {23122312+ ret = -ERESTARTSYS;23132313+ goto out_dec;23142314+ }23152315+ if (cmd == IP_VS_SO_SET_STARTDAEMON)23162316+ ret = start_sync_thread(net, dm->state, dm->mcast_ifn,23172317+ dm->syncid);23182318+ else23192319+ ret = stop_sync_thread(net, dm->state);23202320+ mutex_unlock(&ipvs->sync_mutex);23212321+ goto out_dec;23222322+ }23232323+23072324 if (mutex_lock_interruptible(&__ip_vs_mutex)) {23082325 ret = -ERESTARTSYS;23092326 goto out_dec;···23342315 } else if (cmd == IP_VS_SO_SET_TIMEOUT) {23352316 /* Set timeout values for (tcp tcpfin udp) */23362317 ret = ip_vs_set_timeout(net, (struct ip_vs_timeout_user *)arg);23372337- goto out_unlock;23382338- } else if (cmd == IP_VS_SO_SET_STARTDAEMON) {23392339- struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;23402340- ret = start_sync_thread(net, dm->state, dm->mcast_ifn,23412341- dm->syncid);23422342- goto out_unlock;23432343- } else if (cmd == IP_VS_SO_SET_STOPDAEMON) {23442344- struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;23452345- ret = stop_sync_thread(net, dm->state);23462318 goto out_unlock;23472319 }23482320···2594258425952585 if (copy_from_user(arg, user, copylen) != 0)25962586 return -EFAULT;25872587+ /*25882588+ * Handle daemons first since it has its own locking25892589+ */25902590+ if (cmd == IP_VS_SO_GET_DAEMON) {25912591+ struct ip_vs_daemon_user d[2];25922592+25932593+ memset(&d, 0, sizeof(d));25942594+ if (mutex_lock_interruptible(&ipvs->sync_mutex))25952595+ return -ERESTARTSYS;25962596+25972597+ if (ipvs->sync_state & IP_VS_STATE_MASTER) {25982598+ d[0].state = IP_VS_STATE_MASTER;25992599+ strlcpy(d[0].mcast_ifn, ipvs->master_mcast_ifn,26002600+ sizeof(d[0].mcast_ifn));26012601+ d[0].syncid = ipvs->master_syncid;26022602+ }26032603+ if (ipvs->sync_state & IP_VS_STATE_BACKUP) {26042604+ d[1].state = IP_VS_STATE_BACKUP;26052605+ strlcpy(d[1].mcast_ifn, ipvs->backup_mcast_ifn,26062606+ sizeof(d[1].mcast_ifn));26072607+ d[1].syncid = ipvs->backup_syncid;26082608+ }26092609+ if (copy_to_user(user, &d, sizeof(d)) != 0)26102610+ ret = -EFAULT;26112611+ mutex_unlock(&ipvs->sync_mutex);26122612+ return ret;26132613+ }2597261425982615 if (mutex_lock_interruptible(&__ip_vs_mutex))25992616 return -ERESTARTSYS;···2714267727152678 __ip_vs_get_timeouts(net, &t);27162679 if (copy_to_user(user, &t, sizeof(t)) != 0)27172717- ret = -EFAULT;27182718- }27192719- break;27202720-27212721- case IP_VS_SO_GET_DAEMON:27222722- {27232723- struct ip_vs_daemon_user d[2];27242724-27252725- memset(&d, 0, sizeof(d));27262726- if (ipvs->sync_state & IP_VS_STATE_MASTER) {27272727- d[0].state = IP_VS_STATE_MASTER;27282728- strlcpy(d[0].mcast_ifn, ipvs->master_mcast_ifn,27292729- sizeof(d[0].mcast_ifn));27302730- d[0].syncid = ipvs->master_syncid;27312731- }27322732- if (ipvs->sync_state & IP_VS_STATE_BACKUP) {27332733- d[1].state = IP_VS_STATE_BACKUP;27342734- strlcpy(d[1].mcast_ifn, ipvs->backup_mcast_ifn,27352735- sizeof(d[1].mcast_ifn));27362736- d[1].syncid = ipvs->backup_syncid;27372737- }27382738- if (copy_to_user(user, &d, sizeof(d)) != 0)27392680 ret = -EFAULT;27402681 }27412682 break;···32203205 struct net *net = skb_sknet(skb);32213206 struct netns_ipvs *ipvs = net_ipvs(net);3222320732233223- mutex_lock(&__ip_vs_mutex);32083208+ mutex_lock(&ipvs->sync_mutex);32243209 if ((ipvs->sync_state & IP_VS_STATE_MASTER) && !cb->args[0]) {32253210 if (ip_vs_genl_dump_daemon(skb, IP_VS_STATE_MASTER,32263211 ipvs->master_mcast_ifn,···32403225 }3241322632423227nla_put_failure:32433243- mutex_unlock(&__ip_vs_mutex);32283228+ mutex_unlock(&ipvs->sync_mutex);3244322932453230 return skb->len;32463231}···32863271 return ip_vs_set_timeout(net, &t);32873272}3288327332743274+static int ip_vs_genl_set_daemon(struct sk_buff *skb, struct genl_info *info)32753275+{32763276+ int ret = 0, cmd;32773277+ struct net *net;32783278+ struct netns_ipvs *ipvs;32793279+32803280+ net = skb_sknet(skb);32813281+ ipvs = net_ipvs(net);32823282+ cmd = info->genlhdr->cmd;32833283+32843284+ if (cmd == IPVS_CMD_NEW_DAEMON || cmd == IPVS_CMD_DEL_DAEMON) {32853285+ struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1];32863286+32873287+ mutex_lock(&ipvs->sync_mutex);32883288+ if (!info->attrs[IPVS_CMD_ATTR_DAEMON] ||32893289+ nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX,32903290+ info->attrs[IPVS_CMD_ATTR_DAEMON],32913291+ ip_vs_daemon_policy)) {32923292+ ret = -EINVAL;32933293+ goto out;32943294+ }32953295+32963296+ if (cmd == IPVS_CMD_NEW_DAEMON)32973297+ ret = ip_vs_genl_new_daemon(net, daemon_attrs);32983298+ else32993299+ ret = ip_vs_genl_del_daemon(net, daemon_attrs);33003300+out:33013301+ mutex_unlock(&ipvs->sync_mutex);33023302+ }33033303+ return ret;33043304+}33053305+32893306static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info *info)32903307{32913308 struct ip_vs_service *svc = NULL;···33393292 goto out;33403293 } else if (cmd == IPVS_CMD_SET_CONFIG) {33413294 ret = ip_vs_genl_set_config(net, info->attrs);33423342- goto out;33433343- } else if (cmd == IPVS_CMD_NEW_DAEMON ||33443344- cmd == IPVS_CMD_DEL_DAEMON) {33453345-33463346- struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1];33473347-33483348- if (!info->attrs[IPVS_CMD_ATTR_DAEMON] ||33493349- nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX,33503350- info->attrs[IPVS_CMD_ATTR_DAEMON],33513351- ip_vs_daemon_policy)) {33523352- ret = -EINVAL;33533353- goto out;33543354- }33553355-33563356- if (cmd == IPVS_CMD_NEW_DAEMON)33573357- ret = ip_vs_genl_new_daemon(net, daemon_attrs);33583358- else33593359- ret = ip_vs_genl_del_daemon(net, daemon_attrs);33603295 goto out;33613296 } else if (cmd == IPVS_CMD_ZERO &&33623297 !info->attrs[IPVS_CMD_ATTR_SERVICE]) {···35653536 .cmd = IPVS_CMD_NEW_DAEMON,35663537 .flags = GENL_ADMIN_PERM,35673538 .policy = ip_vs_cmd_policy,35683568- .doit = ip_vs_genl_set_cmd,35393539+ .doit = ip_vs_genl_set_daemon,35693540 },35703541 {35713542 .cmd = IPVS_CMD_DEL_DAEMON,35723543 .flags = GENL_ADMIN_PERM,35733544 .policy = ip_vs_cmd_policy,35743574- .doit = ip_vs_genl_set_cmd,35453545+ .doit = ip_vs_genl_set_daemon,35753546 },35763547 {35773548 .cmd = IPVS_CMD_GET_DAEMON,
+6
net/netfilter/ipvs/ip_vs_sync.c
···61616262#define SYNC_PROTO_VER 1 /* Protocol version in header */63636464+static struct lock_class_key __ipvs_sync_key;6465/*6566 * IPVS sync connection entry6667 * Version 0, i.e. original version.···15461545 IP_VS_DBG(7, "Each ip_vs_sync_conn entry needs %Zd bytes\n",15471546 sizeof(struct ip_vs_sync_conn_v0));1548154715481548+15491549 if (state == IP_VS_STATE_MASTER) {15501550 if (ipvs->master_thread)15511551 return -EEXIST;···16691667{16701668 struct netns_ipvs *ipvs = net_ipvs(net);1671166916701670+ __mutex_init(&ipvs->sync_mutex, "ipvs->sync_mutex", &__ipvs_sync_key);16721671 INIT_LIST_HEAD(&ipvs->sync_queue);16731672 spin_lock_init(&ipvs->sync_lock);16741673 spin_lock_init(&ipvs->sync_buff_lock);···16831680void ip_vs_sync_net_cleanup(struct net *net)16841681{16851682 int retc;16831683+ struct netns_ipvs *ipvs = net_ipvs(net);1686168416851685+ mutex_lock(&ipvs->sync_mutex);16871686 retc = stop_sync_thread(net, IP_VS_STATE_MASTER);16881687 if (retc && retc != -ESRCH)16891688 pr_err("Failed to stop Master Daemon\n");···16931688 retc = stop_sync_thread(net, IP_VS_STATE_BACKUP);16941689 if (retc && retc != -ESRCH)16951690 pr_err("Failed to stop Backup Daemon\n");16911691+ mutex_unlock(&ipvs->sync_mutex);16961692}
+2-2
net/netfilter/nf_conntrack_proto_gre.c
···241241 nf_ct_refresh_acct(ct, ctinfo, skb,242242 ct->proto.gre.stream_timeout);243243 /* Also, more likely to be important, and not a probe. */244244- set_bit(IPS_ASSURED_BIT, &ct->status);245245- nf_conntrack_event_cache(IPCT_ASSURED, ct);244244+ if (!test_and_set_bit(IPS_ASSURED_BIT, &ct->status))245245+ nf_conntrack_event_cache(IPCT_ASSURED, ct);246246 } else247247 nf_ct_refresh_acct(ct, ctinfo, skb,248248 ct->proto.gre.timeout);
+32-8
net/x25/af_x25.c
···9191 int needed;9292 int rc;93939494- if (skb->len < 1) {9494+ if (!pskb_may_pull(skb, 1)) {9595 /* packet has no address block */9696 rc = 0;9797 goto empty;···100100 len = *skb->data;101101 needed = 1 + (len >> 4) + (len & 0x0f);102102103103- if (skb->len < needed) {103103+ if (!pskb_may_pull(skb, needed)) {104104 /* packet is too short to hold the addresses it claims105105 to hold */106106 rc = -1;···295295 * Found a listening socket, now check the incoming296296 * call user data vs this sockets call user data297297 */298298- if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) {298298+ if (x25_sk(s)->cudmatchlength > 0 &&299299+ skb->len >= x25_sk(s)->cudmatchlength) {299300 if((memcmp(x25_sk(s)->calluserdata.cuddata,300301 skb->data,301302 x25_sk(s)->cudmatchlength)) == 0) {···952951 *953952 * Facilities length is mandatory in call request packets954953 */955955- if (skb->len < 1)954954+ if (!pskb_may_pull(skb, 1))956955 goto out_clear_request;957956 len = skb->data[0] + 1;958958- if (skb->len < len)957957+ if (!pskb_may_pull(skb, len))959958 goto out_clear_request;960959 skb_pull(skb,len);960960+961961+ /*962962+ * Ensure that the amount of call user data is valid.963963+ */964964+ if (skb->len > X25_MAX_CUD_LEN)965965+ goto out_clear_request;966966+967967+ /*968968+ * Get all the call user data so it can be used in969969+ * x25_find_listener and skb_copy_from_linear_data up ahead.970970+ */971971+ if (!pskb_may_pull(skb, skb->len))972972+ goto out_clear_request;961973962974 /*963975 * Find a listener for the particular address/cud pair.···11801166 * byte of the user data is the logical value of the Q Bit.11811167 */11821168 if (test_bit(X25_Q_BIT_FLAG, &x25->flags)) {11691169+ if (!pskb_may_pull(skb, 1))11701170+ goto out_kfree_skb;11711171+11831172 qbit = skb->data[0];11841173 skb_pull(skb, 1);11851174 }···12611244 struct x25_sock *x25 = x25_sk(sk);12621245 struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name;12631246 size_t copied;12641264- int qbit;12471247+ int qbit, header_len = x25->neighbour->extended ?12481248+ X25_EXT_MIN_LEN : X25_STD_MIN_LEN;12491249+12651250 struct sk_buff *skb;12661251 unsigned char *asmptr;12671252 int rc = -ENOTCONN;···12831264 goto out;1284126512851266 skb = skb_dequeue(&x25->interrupt_in_queue);12671267+12681268+ if (!pskb_may_pull(skb, X25_STD_MIN_LEN))12691269+ goto out_free_dgram;1286127012871271 skb_pull(skb, X25_STD_MIN_LEN);12881272···13071285 if (!skb)13081286 goto out;1309128712881288+ if (!pskb_may_pull(skb, header_len))12891289+ goto out_free_dgram;12901290+13101291 qbit = (skb->data[0] & X25_Q_BIT) == X25_Q_BIT;1311129213121312- skb_pull(skb, x25->neighbour->extended ?13131313- X25_EXT_MIN_LEN : X25_STD_MIN_LEN);12931293+ skb_pull(skb, header_len);1314129413151295 if (test_bit(X25_Q_BIT_FLAG, &x25->flags)) {13161296 asmptr = skb_push(skb, 1);