Linux 4.9.127
Greg KH
maintainerI'm announcing the release of the 4.9.127 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/configs/imx_v6_v7_defconfig | 2 arch/arm/mach-rockchip/Kconfig | 1 arch/arm64/Kconfig.platforms | 1 arch/arm64/include/asm/cachetype.h | 5 + arch/arm64/include/asm/cpucaps.h | 3 arch/arm64/kernel/cpu_errata.c | 24 ++++++- arch/arm64/kernel/cpufeature.c | 4 - arch/powerpc/platforms/pseries/ras.c | 2 arch/powerpc/sysdev/mpic_msgr.c | 2 arch/s390/kernel/crash_dump.c | 17 +++-- arch/s390/lib/mem.S | 9 +- arch/x86/include/asm/pgtable-3level.h | 7 -- arch/x86/include/asm/pgtable.h | 2 block/bio.c | 2 drivers/acpi/scan.c | 5 - drivers/clk/rockchip/clk-rk3399.c | 1 drivers/gpu/drm/drm_edid.c | 3 drivers/infiniband/hw/hns/hns_roce_pd.c | 2 drivers/infiniband/hw/hns/hns_roce_qp.c | 5 + drivers/irqchip/irq-bcm7038-l1.c | 4 + drivers/md/dm-kcopyd.c | 2 drivers/mfd/sm501.c | 1 drivers/misc/mei/pci-me.c | 5 + drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 drivers/net/ethernet/broadcom/genet/bcmmii.c | 10 ++- drivers/net/ethernet/cisco/enic/enic_main.c | 2 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 ++----- drivers/net/ethernet/realtek/r8169.c | 1 drivers/net/hyperv/netvsc_drv.c | 5 + drivers/pci/host/pci-mvebu.c | 2 drivers/platform/x86/asus-nb-wmi.c | 1 drivers/platform/x86/intel_punit_ipc.c | 1 drivers/s390/block/dasd_eckd.c | 10 ++- drivers/scsi/aic94xx/aic94xx_init.c | 4 - drivers/staging/comedi/drivers/ni_mio_common.c | 3 drivers/vhost/vhost.c | 2 drivers/virtio/virtio_pci_legacy.c | 14 +++- fs/btrfs/dev-replace.c | 6 + fs/btrfs/disk-io.c | 10 +-- fs/btrfs/extent-tree.c | 2 fs/btrfs/relocation.c | 23 +++---- fs/cifs/cifs_debug.c | 8 ++ fs/cifs/smb2misc.c | 7 ++ fs/cifs/smb2pdu.c | 2 fs/dcache.c | 3 fs/fat/cache.c | 19 +++--- fs/fat/fat.h | 5 + fs/fat/fatent.c | 6 - fs/hfs/brec.c | 7 +- fs/hfsplus/dir.c | 4 - fs/hfsplus/super.c | 4 - fs/reiserfs/reiserfs.h | 2 include/linux/pci_ids.h | 2 kernel/fork.c | 2 lib/debugobjects.c | 7 +- mm/fadvise.c | 8 +- mm/huge_memory.c | 2 net/9p/trans_fd.c | 10 +-- net/9p/trans_virtio.c | 3 net/ipv4/tcp_ipv4.c | 6 + net/ipv4/tcp_minisocks.c | 3 net/ipv4/tcp_probe.c | 4 - net/ipv6/ip6_vti.c | 2 net/irda/af_irda.c | 13 +++- net/netfilter/ipvs/ip_vs_core.c | 15 +++- net/rds/ib_frmr.c | 1 net/sched/act_ife.c | 79 ++++++++++++++----------- net/sched/cls_u32.c | 8 +- net/sched/sch_hhf.c | 3 net/sched/sch_htb.c | 5 - net/sched/sch_multiq.c | 9 -- net/sched/sch_netem.c | 4 - net/sched/sch_tbf.c | 5 - net/sctp/proc.c | 4 - net/sctp/socket.c | 22 ++++-- net/sunrpc/auth_gss/gss_krb5_crypto.c | 12 ++- scripts/depmod.sh | 4 - scripts/mod/modpost.c | 8 +- sound/soc/codecs/wm8994.c | 1 tools/perf/arch/powerpc/util/sym-handling.c | 4 - tools/testing/selftests/powerpc/harness.c | 18 +++-- 82 files changed, 375 insertions(+), 189 deletions(-)
Aleh Filipovich (1):
platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360
Alexey Kodanev (1):
vti6: remove !skb->ignore_df check from vti6_xmit()
Andrey Ryabinin (1):
mm/fadvise.c: fix signed overflow UBSAN complaint
Anthony Wong (1):
r8169: add support for NCube 8168 network card
Arnd Bergmann (1):
reiserfs: change j_timestamp type to time64_t
Breno Leitao (1):
selftests/powerpc: Kill child processes on SIGINT
Chas Williams (1):
Fixes: Commit 2aa6d036b716 ("mm: numa: avoid waiting on freed migrated pages")
Cong Wang (3):
act_ife: fix a potential use-after-free
act_ife: move tcfa_lock down to where necessary
act_ife: fix a potential deadlock
Dan Carpenter (2):
powerpc: Fix size calculation using resource_size()
scsi: aic94xx: fix an error code in aic94xx_init()
Doug Berger (1):
net: bcmgenet: use MAC link status for fixed phy
Eric Dumazet (2):
ipv4: tcp: send zero IPID for RST and ACK sent in SYN-RECV and TIME-WAIT state
tcp: Revert "tcp: tcp_probe: use spin_lock_bh()"
Ernesto A. Fernández (2):
hfs: prevent crash on exit from failed search
hfsplus: fix NULL dereference in hfsplus_lookup()
Ethan Lien (1):
btrfs: use correct compare function of dirty_metadata_bytes
Fabio Estevam (1):
Revert "ARM: imx_v6_v7_defconfig: Select ULPI support"
Florian Westphal (1):
tcp: do not restart timewait timer on rst reception
Gal Pressman (1):
RDMA/hns: Fix usage of bitmap allocation functions return values
Govindarajulu Varadarajan (1):
enic: do not call enic_change_mtu in enic_probe
Greg Edwards (1):
block: bvec_nr_vecs() returns value for wrong slab
Greg Kroah-Hartman (1):
Linux 4.9.127
Guenter Roeck (1):
mfd: sm501: Set coherent_dma_mask when creating subdevices
Gustavo A. R. Silva (1):
ASoC: wm8994: Fix missing break in switch
Hans de Goede (1):
ACPI / scan: Initialize status to ACPI_STA_DEFAULT
Ian Abbott (1):
staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice
Jann Horn (1):
fork: don't copy inconsistent signal handler state to child
Jason Wang (1):
vhost: correctly check the iova range when waking virtqueue
Jean-Philippe Brucker (1):
net/9p: fix error path of p9_virtio_probe
Joel Fernandes (Google) (1):
debugobjects: Make stack check warning more informative
John Pittman (1):
dm kcopyd: avoid softlockup in run_complete_job
Jonas Gorski (1):
irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP
Juergen Gross (1):
x86/pae: use 64 bit atomic xchg function in native_ptep_get_and_clear
Kai-Heng Feng (1):
drm/edid: Add 6 bpc quirk for SDC panel in Lenovo B50-80
Kees Cook (1):
net: sched: Fix memory exposure from short TCA_U32_SEL
Laura Abbott (1):
sunrpc: Don't use stack buffer with scatterlist
Levin Du (1):
clk: rockchip: Add pclk_rkpwm_pmu to PMU critical clocks in rk3399
Mahesh Salgaonkar (1):
powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
Manish Chopra (1):
qlge: Fix netdev features configuration.
Marc Zyngier (2):
arm64: rockchip: Force CONFIG_PM on Rockchip systems
ARM: rockchip: Force CONFIG_PM on Rockchip systems
Martin Schwidefsky (1):
s390/lib: use expoline for all bcr instructions
Michal Hocko (1):
x86/speculation/l1tf: Fix up pte->pfn conversion for PAE
Misono Tomohiro (1):
btrfs: replace: Reset on-disk dev stats value after replace
Nikolay Aleksandrov (5):
sch_htb: fix crash on init failure
sch_multiq: fix double free on init failure
sch_hhf: fix null pointer dereference on init failure
sch_netem: avoid null pointer deref on init failure
sch_tbf: fix two null pointer dereferences on init failure
OGAWA Hirofumi (1):
fat: validate ->i_start before using
Philipp Rudo (1):
s390/kdump: Fix memleak in nt_vmcoreinfo
Qu Wenruo (2):
btrfs: relocation: Only remove reloc rb_trees if reloc control has been initialized
btrfs: Don't remove block group that still has pinned down bytes
Randy Dunlap (3):
scripts: modpost: check memory allocation results platform/x86: intel_punit_ipc: fix build errors
kbuild: make missing $DEPMOD a Warning instead of an Error
Ronnie Sahlberg (1):
cifs: check if SMB2 PDU size has been padded and suppress the warning
Sandipan Das (1):
perf probe powerpc: Fix trace event post-processing
Stefan Haberland (2):
s390/dasd: fix hanging offline processing due to canceled worker s390/dasd: fix panic for failed online processing
Stephen Hemminger (1):
hv_netvsc: ignore devices that are not PCI
Steve French (2):
smb3: fix reset of bytes read and written stats
SMB3: Number of requests sent should be displayed for SMB3 not just CIFS
Suzuki K Poulose (3):
virtio: pci-legacy: Validate queue pfn
arm64: Fix mismatched cache line size detection
arm64: Handle mismatched cache type
Tan Hu (1):
ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
Tetsuo Handa (2):
hfsplus: don't return 0 when fill_super() failed fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot()
Thomas Petazzoni (1):
PCI: mvebu: Fix I/O space end address calculation
Tomas Bortoli (1):
net/9p/trans_fd.c: fix race by holding the lock
Tomas Winkler (1):
mei: me: allow runtime pm for platform with D0i3
Tyler Hicks (2):
irda: Fix memory leak caused by repeated binds of irda socket
irda: Only insert new objects into the global database via setsockopt
Vlad Buslov (1):
net: sched: action_ife: take reference to meta module
Xin Long (1):
sctp: hold transport before accessing its asoc in sctp_transport_get_next
YueHaibing (1):
RDS: IB: fix 'passing zero to ERR_PTR()' warning
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 126 +SUBLEVEL = 127 EXTRAVERSION = NAME = Roaring Lionus
arch/arm/configs/imx_v6_v7_defconfig +0 -2
@@ -271,7 +271,6 @@ CONFIG_USB_STORAGE=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y -CONFIG_USB_CHIPIDEA_ULPI=y CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_FTDI_SIO=m
@@ -308,7 +307,6 @@ CONFIG_USB_GADGETFS=m CONFIG_USB_FUNCTIONFS=m CONFIG_USB_MASS_STORAGE=m CONFIG_USB_G_SERIAL=m -CONFIG_USB_ULPI_BUS=y CONFIG_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y
arch/arm/mach-rockchip/Kconfig +1 -0
@@ -16,6 +16,7 @@ config ARCH_ROCKCHIP select ROCKCHIP_TIMER select ARM_GLOBAL_TIMER select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK + select PM help Support for Rockchip's Cortex-A9 Single-to-Quad-Core-SoCs containing the RK2928, RK30xx and RK31xx series.
arch/arm64/Kconfig.platforms +1 -0
@@ -125,6 +125,7 @@ config ARCH_ROCKCHIP select GPIOLIB select PINCTRL select PINCTRL_ROCKCHIP + select PM select ROCKCHIP_TIMER help This enables support for the ARMv8 based Rockchip chipsets,
arch/arm64/include/asm/cachetype.h +5 -0
@@ -22,6 +22,11 @@#define CTR_L1IP_MASK 3#define CTR_CWG_SHIFT 24#define CTR_CWG_MASK 15 +#define CTR_DMINLINE_SHIFT 16 +#define CTR_IMINLINE_SHIFT 0 + +#define CTR_CACHE_MINLINE_MASK \ + ((0xf << CTR_DMINLINE_SHIFT) | (0xf << CTR_IMINLINE_SHIFT))#define ICACHE_POLICY_RESERVED 0#define ICACHE_POLICY_AIVIVT 1
arch/arm64/include/asm/cpucaps.h +2 -1
@@ -37,7 +37,8 @@#define ARM64_UNMAP_KERNEL_AT_EL0 16#define ARM64_HARDEN_BRANCH_PREDICTOR 17#define ARM64_SSBD 18 +#define ARM64_MISMATCHED_CACHE_TYPE 19 -#define ARM64_NCAPS 19 +#define ARM64_NCAPS 20#endif /* __ASM_CPUCAPS_H */
arch/arm64/kernel/cpu_errata.c +19 -5
@@ -17,6 +17,7 @@*/ #include <linux/types.h> +#include <asm/cachetype.h> #include <asm/cpu.h> #include <asm/cputype.h> #include <asm/cpufeature.h>
@@ -31,12 +32,18 @@ is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope) }static bool -has_mismatched_cache_line_size (const struct arm64_cpu_capabilities *entry, -int scope) +has_mismatched_cache_type (const struct arm64_cpu_capabilities *entry, +int scope) { +u64 mask =CTR_CACHE_MINLINE_MASK ; + +/* Skip matching the min line sizes for cache type check */ +if (entry->capability ==ARM64_MISMATCHED_CACHE_TYPE ) + mask ^= arm64_ftr_reg_ctrel0.strict_mask; +WARN_ON (scope !=SCOPE_LOCAL_CPU ||preemptible ()); -return (read_cpuid_cachetype () & arm64_ftr_reg_ctrel0.strict_mask) != - (arm64_ftr_reg_ctrel0.sys_val & arm64_ftr_reg_ctrel0.strict_mask); +return (read_cpuid_cachetype () & mask) != + (arm64_ftr_reg_ctrel0.sys_val & mask); }static int cpu_enable_trap_ctr_access (void *__unused)
@@ -446,7 +453,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = { { .desc = "Mismatched cache line size", .capability = ARM64_MISMATCHED_CACHE_LINE_SIZE, - .matches = has_mismatched_cache_line_size, + .matches = has_mismatched_cache_type, + .def_scope = SCOPE_LOCAL_CPU, + .enable = cpu_enable_trap_ctr_access, + }, + { + .desc = "Mismatched cache type", + .capability = ARM64_MISMATCHED_CACHE_TYPE, + .matches = has_mismatched_cache_type, .def_scope = SCOPE_LOCAL_CPU, .enable = cpu_enable_trap_ctr_access, },
arch/arm64/kernel/cpufeature.c +2 -2
@@ -152,7 +152,7 @@ static const struct arm64_ftr_bits ftr_ctr[] = {ARM64_FTR_BITS (FTR_STRICT ,FTR_EXACT ,28 ,3 ,0 ),ARM64_FTR_BITS (FTR_STRICT ,FTR_HIGHER_SAFE ,24 ,4 ,0 ),/* CWG */ ARM64_FTR_BITS (FTR_STRICT ,FTR_LOWER_SAFE ,20 ,4 ,0 ),/* ERG */ -ARM64_FTR_BITS (FTR_STRICT ,FTR_LOWER_SAFE ,16 ,4 ,1 ),/* DminLine */ +ARM64_FTR_BITS (FTR_STRICT ,FTR_LOWER_SAFE ,CTR_DMINLINE_SHIFT ,4 ,1 ),/* * Linux can handle differing I-cache policies. Userspace JITs will * make use of *minLine.
@@ -160,7 +160,7 @@ static const struct arm64_ftr_bits ftr_ctr[] = {*/ ARM64_FTR_BITS (FTR_NONSTRICT ,FTR_EXACT ,14 ,2 ,ICACHE_POLICY_AIVIVT ),/* L1Ip */ ARM64_FTR_BITS (FTR_STRICT ,FTR_EXACT ,4 ,10 ,0 ),/* RAZ */ -ARM64_FTR_BITS (FTR_STRICT ,FTR_LOWER_SAFE ,0 ,4 ,0 ),/* IminLine */ +ARM64_FTR_BITS (FTR_STRICT ,FTR_LOWER_SAFE ,CTR_IMINLINE_SHIFT ,4 ,0 ), ARM64_FTR_END, };
arch/powerpc/platforms/pseries/ras.c +1 -1
@@ -357,7 +357,7 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)int len, error_log_length; error_log_length =8 +rtas_error_extended_log_length (h); - len =max_t (int, error_log_length,RTAS_ERROR_LOG_MAX ); + len =min_t (int, error_log_length,RTAS_ERROR_LOG_MAX );memset (global_mce_data_buf,0 ,RTAS_ERROR_LOG_MAX );memcpy (global_mce_data_buf, h, len); errhdr = (struct rtas_error_log *)global_mce_data_buf;
arch/powerpc/sysdev/mpic_msgr.c +1 -1
@@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platform_device *dev)/* IO map the message register block. */ of_address_to_resource (np,0 , &rsrc); - msgr_block_addr =ioremap (rsrc.start, rsrc.end - rsrc.start); + msgr_block_addr =ioremap (rsrc.start,resource_size (&rsrc));if (!msgr_block_addr) {dev_err (&dev->dev,"Failed to iomap MPIC message registers" );return -EFAULT ;
arch/s390/kernel/crash_dump.c +12 -5
@@ -401,11 +401,13 @@ static void *get_vmcoreinfo_old(unsigned long *size)if (copy_oldmem_kernel (nt_name, addr +sizeof (note),sizeof (nt_name) -1 ))return NULL ; -if (strcmp (nt_name,"VMCOREINFO" ) !=0 ) +if (strcmp (nt_name,VMCOREINFO_NOTE_NAME ) !=0 )return NULL ; vmcoreinfo =kzalloc_panic (note.n_descsz); -if (copy_oldmem_kernel (vmcoreinfo, addr +24 , note.n_descsz)) +if (copy_oldmem_kernel (vmcoreinfo, addr +24 , note.n_descsz)) { +kfree (vmcoreinfo);return NULL ; + } *size = note.n_descsz;return vmcoreinfo; }
@@ -415,15 +417,20 @@ static void *get_vmcoreinfo_old(unsigned long *size)*/ static void *nt_vmcoreinfo (void *ptr) { +const char *name =VMCOREINFO_NOTE_NAME ;unsigned long size;void *vmcoreinfo; vmcoreinfo =os_info_old_entry (OS_INFO_VMCOREINFO , &size); -if (!vmcoreinfo) - vmcoreinfo =get_vmcoreinfo_old (&size); +if (vmcoreinfo) +return nt_init_name (ptr,0 , vmcoreinfo, size, name); + + vmcoreinfo =get_vmcoreinfo_old (&size);if (!vmcoreinfo)return ptr; -return nt_init_name (ptr,0 , vmcoreinfo, size,"VMCOREINFO" ); + ptr =nt_init_name (ptr,0 , vmcoreinfo, size, name); +kfree (vmcoreinfo); +return ptr; }/*
arch/s390/lib/mem.S +6 -3
@@ -27,7 +27,7 @@ */ ENTRY(memset) ltgr %r4,%r4 - bzr %r14 + jz .Lmemset_exit ltgr %r3,%r3 jnz .Lmemset_fill aghi %r4,-1
@@ -42,12 +42,13 @@ ENTRY(memset) .Lmemset_clear_rest: larl %r3,.Lmemset_xc ex %r4,0(%r3) +.Lmemset_exit: BR_EX %r14 .Lmemset_fill: stc %r3,0(%r2) cghi %r4,1 lgr %r1,%r2 - ber %r14 + je .Lmemset_fill_exit aghi %r4,-2 srlg %r3,%r4,8 ltgr %r3,%r3
@@ -59,6 +60,7 @@ ENTRY(memset) .Lmemset_fill_rest: larl %r3,.Lmemset_mvc ex %r4,0(%r3) +.Lmemset_fill_exit: BR_EX %r14 .Lmemset_xc: xc 0(1,%r1),0(%r1)
@@ -73,7 +75,7 @@ EXPORT_SYMBOL(memset) */ ENTRY(memcpy) ltgr %r4,%r4 - bzr %r14 + jz .Lmemcpy_exit aghi %r4,-1 srlg %r5,%r4,8 ltgr %r5,%r5
@@ -82,6 +84,7 @@ ENTRY(memcpy) .Lmemcpy_rest: larl %r5,.Lmemcpy_mvc ex %r4,0(%r5) +.Lmemcpy_exit: BR_EX %r14 .Lmemcpy_loop: mvc 0(256,%r1),0(%r3)
arch/x86/include/asm/pgtable-3level.h +3 -4
@@ -1,6 +1,8 @@#ifndef _ASM_X86_PGTABLE_3LEVEL_H#define _ASM_X86_PGTABLE_3LEVEL_H +#include <asm/atomic64_32.h> +/* * Intel Physical Address Extension (PAE) Mode - three-level page * tables on PPro+ CPUs.
@@ -142,10 +144,7 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep) {pte_t res; -/* xchg acts as a barrier before the setting of the high bits */ - res.pte_low =xchg (&ptep->pte_low,0 ); - res.pte_high = ptep->pte_high; - ptep->pte_high =0 ; + res.pte = (pteval_t )atomic64_xchg ((atomic64_t *)ptep,0 );return res; }
arch/x86/include/asm/pgtable.h +1 -1
@@ -420,7 +420,7 @@ static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)static inline pud_t pfn_pud (unsigned long page_nr,pgprot_t pgprot) { -phys_addr_t pfn = page_nr <<PAGE_SHIFT ; +phys_addr_t pfn = (phys_addr_t )page_nr <<PAGE_SHIFT ; pfn ^=protnone_mask (pgprot_val (pgprot)); pfn &=PHYSICAL_PUD_PAGE_MASK ;return __pud (pfn |massage_pgprot (pgprot));
block/bio.c +1 -1
@@ -155,7 +155,7 @@ static void bio_put_slab(struct bio_set *bs)unsigned int bvec_nr_vecs (unsigned short idx) { -return bvec_slabs[idx].nr_vecs; +return bvec_slabs[--idx].nr_vecs; }void bvec_free (mempool_t *pool,struct bio_vec *bv,unsigned int idx)
drivers/acpi/scan.c +3 -2
@@ -1453,7 +1453,8 @@ static int acpi_add_single_object(struct acpi_device **child,* Note this must be done before the get power-/wakeup_dev-flags calls. */ if (type ==ACPI_BUS_TYPE_DEVICE ) -acpi_bus_get_status (device); +if (acpi_bus_get_status (device) <0 ) +acpi_set_device_status (device,0 );acpi_bus_get_power_flags (device);acpi_bus_get_wakeup_device_flags (device);
@@ -1531,7 +1532,7 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type,* acpi_add_single_object updates this once we've an acpi_device * so that acpi_bus_get_status' quirk handling can be used. */ - *sta =0 ; + *sta =ACPI_STA_DEFAULT ;break ;case ACPI_TYPE_PROCESSOR : *type =ACPI_BUS_TYPE_PROCESSOR ;
drivers/clk/rockchip/clk-rk3399.c +1 -0
@@ -1521,6 +1521,7 @@ static const char *const rk3399_pmucru_critical_clocks[] __initconst = {"pclk_pmu_src" ,"fclk_cm0s_src_pmu" ,"clk_timer_src_pmu" , + "pclk_rkpwm_pmu", };static void __init rk3399_clk_init (struct device_node *np)
drivers/gpu/drm/drm_edid.c +3 -0
@@ -110,6 +110,9 @@ static const struct edid_quirk {/* CPT panel of Asus UX303LA reports 8 bpc, but is a 6 bpc panel */ { "CPT", 0x17df, EDID_QUIRK_FORCE_6BPC }, +/* SDC panel of Lenovo B50-80 reports 8 bpc, but is a 6 bpc panel */ + { "SDC", 0x3652, EDID_QUIRK_FORCE_6BPC }, +/* Belinea 10 15 55 */ { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 }, { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 },
drivers/infiniband/hw/hns/hns_roce_pd.c +1 -1
@@ -35,7 +35,7 @@static int hns_roce_pd_alloc (struct hns_roce_dev *hr_dev,unsigned long *pdn) { -return hns_roce_bitmap_alloc (&hr_dev->pd_bitmap, pdn); +return hns_roce_bitmap_alloc (&hr_dev->pd_bitmap, pdn) ? -ENOMEM :0 ; }static void hns_roce_pd_free (struct hns_roce_dev *hr_dev,unsigned long pdn)
drivers/infiniband/hw/hns/hns_roce_qp.c +4 -1
@@ -114,7 +114,10 @@ static int hns_roce_reserve_range_qp(struct hns_roce_dev *hr_dev, int cnt, {struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; -return hns_roce_bitmap_alloc_range (&qp_table->bitmap, cnt, align, base); +return hns_roce_bitmap_alloc_range (&qp_table->bitmap, cnt, align, + base) ? + -ENOMEM : +0 ; }enum hns_roce_qp_state to_hns_roce_state (enum ib_qp_state state)
drivers/irqchip/irq-bcm7038-l1.c +4 -0
@@ -215,6 +215,7 @@ static int bcm7038_l1_set_affinity(struct irq_data *d,return 0 ; } +#ifdef CONFIG_SMP static void bcm7038_l1_cpu_offline (struct irq_data *d) {struct cpumask *mask =irq_data_get_affinity_mask (d);
@@ -239,6 +240,7 @@ static void bcm7038_l1_cpu_offline(struct irq_data *d) }irq_set_affinity_locked (d, &new_affinity, false); } +#endif static int __init bcm7038_l1_init_one(struct device_node *dn, unsigned int idx,
@@ -291,7 +293,9 @@ static struct irq_chip bcm7038_l1_irq_chip = { .irq_mask = bcm7038_l1_mask, .irq_unmask = bcm7038_l1_unmask, .irq_set_affinity = bcm7038_l1_set_affinity, +#ifdef CONFIG_SMP .irq_cpu_offline = bcm7038_l1_cpu_offline, +#endif }; static int bcm7038_l1_map(struct irq_domain *d, unsigned int virq,
drivers/md/dm-kcopyd.c +2 -0
@@ -454,6 +454,8 @@ static int run_complete_job(struct kcopyd_job *job)if (atomic_dec_and_test (&kc->nr_jobs))wake_up (&kc->destroyq); +cond_resched (); +return 0 ; }
drivers/mfd/sm501.c +1 -0
@@ -714,6 +714,7 @@ sm501_create_subdev(struct sm501_devdata *sm, char *name, smdev->pdev.name = name; smdev->pdev.id = sm->pdev_id; smdev->pdev.dev.parent = sm->dev; + smdev->pdev.dev.coherent_dma_mask =0xffffffff ;if (res_count) { smdev->pdev.resource = (struct resource *)(smdev+1 );
drivers/misc/mei/pci-me.c +4 -1
@@ -229,8 +229,11 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (!pci_dev_run_wake (pdev))mei_me_set_pm_domain (dev); -if (mei_pg_is_enabled (dev)) +if (mei_pg_is_enabled (dev)) {pm_runtime_put_noidle (&pdev->dev); +if (hw->d0i3_supported) +pm_runtime_allow (&pdev->dev); + }dev_dbg (&pdev->dev,"initialization successful.\n" );
drivers/net/ethernet/broadcom/genet/bcmgenet.h +3 -0
@@ -185,6 +185,9 @@ struct bcmgenet_mib_counters {#define UMAC_MAC1 0x010#define UMAC_MAX_FRAME_LEN 0x014 +#define UMAC_MODE 0x44 +#define MODE_LINK_STATUS (1 << 5) +#define UMAC_EEE_CTRL 0x064#define EN_LPI_RX_PAUSE (1 << 0)#define EN_LPI_TX_PFC (1 << 1)
drivers/net/ethernet/broadcom/genet/bcmmii.c +8 -2
@@ -167,8 +167,14 @@ void bcmgenet_mii_setup(struct net_device *dev)static int bcmgenet_fixed_phy_link_update (struct net_device *dev,struct fixed_phy_status *status) { -if (dev && dev->phydev && status) - status->link = dev->phydev->link; +struct bcmgenet_priv *priv; +u32 reg; + +if (dev && dev->phydev && status) { + priv =netdev_priv (dev); + reg =bcmgenet_umac_readl (priv,UMAC_MODE ); + status->link = !!(reg &MODE_LINK_STATUS ); + }return 0 ; }
drivers/net/ethernet/cisco/enic/enic_main.c +1 -1
@@ -2681,7 +2681,6 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)*/ enic->port_mtu = enic->config.mtu; - (void )enic_change_mtu (netdev, enic->port_mtu); err =enic_set_mac_addr (netdev, enic->mac_addr);if (err) {
@@ -2731,6 +2730,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev->features |=NETIF_F_HIGHDMA ; netdev->priv_flags |=IFF_UNICAST_FLT ; + netdev->mtu = enic->port_mtu; err =register_netdev (netdev);if (err) {
drivers/net/ethernet/qlogic/qlge/qlge_main.c +8 -15
@@ -2387,26 +2387,20 @@ static int qlge_update_hw_vlan_features(struct net_device *ndev,return status; } -static netdev_features_t qlge_fix_features (struct net_device *ndev, -netdev_features_t features) -{ -int err; - -/* Update the behavior of vlan accel in the adapter */ - err =qlge_update_hw_vlan_features (ndev, features); -if (err) -return err; - -return features; -} -static int qlge_set_features (struct net_device *ndev,netdev_features_t features) {netdev_features_t changed = ndev->features ^ features; +int err; + +if (changed &NETIF_F_HW_VLAN_CTAG_RX ) { +/* Update the behavior of vlan accel in the adapter */ + err =qlge_update_hw_vlan_features (ndev, features); +if (err) +return err; -if (changed &NETIF_F_HW_VLAN_CTAG_RX )qlge_vlan_mode (ndev, features); + }return 0 ; }
@@ -4719,7 +4713,6 @@ static const struct net_device_ops qlge_netdev_ops = { .ndo_set_mac_address = qlge_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_tx_timeout = qlge_tx_timeout, - .ndo_fix_features = qlge_fix_features, .ndo_set_features = qlge_set_features, .ndo_vlan_rx_add_vid = qlge_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = qlge_vlan_rx_kill_vid,
drivers/net/ethernet/realtek/r8169.c +1 -0
@@ -329,6 +329,7 @@ static const struct pci_device_id rtl8169_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 }, { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8167), 0, 0, RTL_CFG_0 }, { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), 0, 0, RTL_CFG_1 }, + { PCI_DEVICE(PCI_VENDOR_ID_NCUBE, 0x8168), 0, 0, RTL_CFG_1 }, { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), 0, 0, RTL_CFG_0 }, { PCI_VENDOR_ID_DLINK, 0x4300, PCI_VENDOR_ID_DLINK, 0x4b10, 0, 0, RTL_CFG_1 },
drivers/net/hyperv/netvsc_drv.c +5 -0
@@ -29,6 +29,7 @@#include <linux/netdevice.h> #include <linux/inetdevice.h> #include <linux/etherdevice.h> +#include <linux/pci.h> #include <linux/skbuff.h> #include <linux/if_vlan.h> #include <linux/in.h>
@@ -1228,11 +1229,15 @@ static int netvsc_register_vf(struct net_device *vf_netdev) {struct net_device *ndev;struct net_device_context *net_device_ctx; +struct device *pdev = vf_netdev->dev.parent;struct netvsc_device *netvsc_dev;if (vf_netdev->addr_len !=ETH_ALEN )return NOTIFY_DONE ; +if (!pdev || !dev_is_pci (pdev) ||dev_is_pf (pdev)) +return NOTIFY_DONE ; +/* * We will use the MAC address to locate the synthetic interface to * associate with the VF interface. If we don't find a matching
drivers/pci/host/pci-mvebu.c +1 -1
@@ -1236,7 +1236,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev) pcie->realio.start =PCIBIOS_MIN_IO ; pcie->realio.end =min_t (resource_size_t,IO_SPACE_LIMIT , -resource_size (&pcie->io)); +resource_size (&pcie->io) -1 ); }else pcie->realio = pcie->io;
drivers/platform/x86/asus-nb-wmi.c +1 -0
@@ -531,6 +531,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ + { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */ { KE_END, 0}, };
drivers/platform/x86/intel_punit_ipc.c +1 -0
@@ -17,6 +17,7 @@#include <linux/bitops.h> #include <linux/device.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/platform_device.h> #include <asm/intel_punit_ipc.h>
drivers/s390/block/dasd_eckd.c +8 -2
@@ -1834,6 +1834,9 @@ static void dasd_eckd_uncheck_device(struct dasd_device *device)struct dasd_eckd_private *private = device->private;int i; +if (!private) +return ; +dasd_alias_disconnect_device_from_lcu (device); private->ned =NULL ; private->sneq =NULL ;
@@ -2085,8 +2088,11 @@ static int dasd_eckd_basic_to_ready(struct dasd_device *device)static int dasd_eckd_online_to_ready (struct dasd_device *device) { -cancel_work_sync (&device->reload_device); -cancel_work_sync (&device->kick_validate); +if (cancel_work_sync (&device->reload_device)) +dasd_put_device (device); +if (cancel_work_sync (&device->kick_validate)) +dasd_put_device (device); +return 0 ; };
drivers/scsi/aic94xx/aic94xx_init.c +3 -1
@@ -1031,8 +1031,10 @@ static int __init aic94xx_init(void) aic94xx_transport_template =sas_domain_attach_transport (&aic94xx_transport_functions); -if (!aic94xx_transport_template) +if (!aic94xx_transport_template) { + err = -ENOMEM ; goto out_destroy_caches; + } err =pci_register_driver (&aic94xx_pci_driver);if (err)
drivers/staging/comedi/drivers/ni_mio_common.c +2 -1
@@ -5407,11 +5407,11 @@ static int ni_E_init(struct comedi_device *dev,/* Digital I/O (PFI) subdevice */ s = &dev->subdevices[NI_PFI_DIO_SUBDEV ]; s->type =COMEDI_SUBD_DIO ; - s->subdev_flags =SDF_READABLE |SDF_WRITABLE |SDF_INTERNAL ; s->maxdata =1 ;if (devpriv->is_m_series) { s->n_chan =16 ; s->insn_bits = ni_pfi_insn_bits; + s->subdev_flags =SDF_READABLE |SDF_WRITABLE |SDF_INTERNAL ;ni_writew (dev, s->state,NI_M_PFI_DO_REG );for (i =0 ; i <NUM_PFI_OUTPUT_SELECT_REGS ; ++i) {
@@ -5420,6 +5420,7 @@ static int ni_E_init(struct comedi_device *dev, } }else { s->n_chan =10 ; + s->subdev_flags =SDF_INTERNAL ; } s->insn_config = ni_pfi_insn_config;
drivers/vhost/vhost.c +1 -1
@@ -905,7 +905,7 @@ static void vhost_iotlb_notify_vq(struct vhost_dev *d,list_for_each_entry_safe (node, n, &d->pending_list, node) {struct vhost_iotlb_msg *vq_msg = &node->msg.iotlb;if (msg->iova <= vq_msg->iova && - msg->iova + msg->size -1 > vq_msg->iova && + msg->iova + msg->size -1 >= vq_msg->iova && vq_msg->type ==VHOST_IOTLB_MISS ) {vhost_poll_queue (&node->vq->poll);list_del (&node->node);
drivers/virtio/virtio_pci_legacy.c +12 -2
@@ -121,6 +121,7 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,struct virtqueue *vq;u16 num;int err; +u64 q_pfn;/* Select the queue we're interested in */ iowrite16 (index, vp_dev->ioaddr +VIRTIO_PCI_QUEUE_SEL );
@@ -139,9 +140,17 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev,if (!vq)return ERR_PTR (-ENOMEM ); + q_pfn =virtqueue_get_desc_addr (vq) >>VIRTIO_PCI_QUEUE_ADDR_SHIFT ; +if (q_pfn >>32 ) { +dev_err (&vp_dev->pci_dev->dev, +"platform bug: legacy virtio-mmio must not be used with RAM above 0x%llxGB\n" , +0x1ULL << (32 +PAGE_SHIFT -30 )); + err = -E2BIG ; + goto out_del_vq; + } +/* activate the queue */ -iowrite32 (virtqueue_get_desc_addr (vq) >>VIRTIO_PCI_QUEUE_ADDR_SHIFT , - vp_dev->ioaddr +VIRTIO_PCI_QUEUE_PFN ); +iowrite32 (q_pfn, vp_dev->ioaddr +VIRTIO_PCI_QUEUE_PFN ); vq->priv = (void __force *)vp_dev->ioaddr +VIRTIO_PCI_QUEUE_NOTIFY ;
@@ -158,6 +167,7 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev, out_deactivate:iowrite32 (0 , vp_dev->ioaddr +VIRTIO_PCI_QUEUE_PFN ); +out_del_vq:vring_del_virtqueue (vq);return ERR_PTR (err); }
fs/btrfs/dev-replace.c +6 -0
@@ -585,6 +585,12 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,btrfs_rm_dev_replace_unblocked (fs_info); +/* +* Increment dev_stats_ccnt so that btrfs_run_dev_stats() will +* update on-disk dev stats value during commit transaction +*/ +atomic_inc (&tgt_device->dev_stats_ccnt); +/* * this is again a consistent state where no dev_replace procedure * is running, the target device is part of the filesystem, the
fs/btrfs/disk-io.c +6 -4
@@ -1096,8 +1096,9 @@ static int btree_writepages(struct address_space *mapping, fs_info =BTRFS_I (mapping->host)->root->fs_info;/* this is a bit racy, but that's ok */ - ret =percpu_counter_compare (&fs_info->dirty_metadata_bytes, -BTRFS_DIRTY_METADATA_THRESH ); + ret =__percpu_counter_compare (&fs_info->dirty_metadata_bytes, +BTRFS_DIRTY_METADATA_THRESH , + fs_info->dirty_metadata_batch);if (ret <0 )return 0 ; }
@@ -4107,8 +4108,9 @@ static void __btrfs_btree_balance_dirty(struct btrfs_root *root,if (flush_delayed)btrfs_balance_delayed_items (root); - ret =percpu_counter_compare (&root->fs_info->dirty_metadata_bytes, -BTRFS_DIRTY_METADATA_THRESH ); + ret =__percpu_counter_compare (&root->fs_info->dirty_metadata_bytes, +BTRFS_DIRTY_METADATA_THRESH , + root->fs_info->dirty_metadata_batch);if (ret >0 ) {balance_dirty_pages_ratelimited ( root->fs_info->btree_inode->i_mapping);
fs/btrfs/extent-tree.c +1 -1
@@ -10853,7 +10853,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)/* Don't want to race with allocators so take the groups_sem */ down_write (&space_info->groups_sem);spin_lock (&block_group->lock); -if (block_group->reserved || +if (block_group->reserved || block_group->pinned ||btrfs_block_group_used (&block_group->item) || block_group->ro ||list_is_singular (&block_group->list)) {
fs/btrfs/relocation.c +12 -11
@@ -1325,18 +1325,19 @@ static void __del_reloc_root(struct btrfs_root *root)struct mapping_node *node =NULL ;struct reloc_control *rc = root->fs_info->reloc_ctl; -spin_lock (&rc->reloc_root_tree.lock); - rb_node =tree_search (&rc->reloc_root_tree.rb_root, - root->node->start); -if (rb_node) { - node = rb_entry(rb_node, struct mapping_node, rb_node); -rb_erase (&node->rb_node, &rc->reloc_root_tree.rb_root); +if (rc) { +spin_lock (&rc->reloc_root_tree.lock); + rb_node =tree_search (&rc->reloc_root_tree.rb_root, + root->node->start); +if (rb_node) { + node = rb_entry(rb_node, struct mapping_node, rb_node); +rb_erase (&node->rb_node, &rc->reloc_root_tree.rb_root); + } +spin_unlock (&rc->reloc_root_tree.lock); +if (!node) +return ; +BUG_ON ((struct btrfs_root *)node->data != root); } -spin_unlock (&rc->reloc_root_tree.lock); - -if (!node) -return ; -BUG_ON ((struct btrfs_root *)node->data != root);spin_lock (&root->fs_info->trans_lock);list_del_init (&root->root_list);
fs/cifs/cifs_debug.c +8 -0
@@ -284,6 +284,10 @@ static ssize_t cifs_stats_proc_write(struct file *file,atomic_set (&totBufAllocCount,0 );atomic_set (&totSmBufAllocCount,0 );#endif /* CONFIG_CIFS_STATS2 */ +spin_lock (&GlobalMid_Lock); + GlobalMaxActiveXid =0 ; + GlobalCurrentXid =0 ; +spin_unlock (&GlobalMid_Lock);spin_lock (&cifs_tcp_ses_lock);list_for_each (tmp1, &cifs_tcp_ses_list) { server = list_entry(tmp1, struct TCP_Server_Info,
@@ -296,6 +300,10 @@ static ssize_t cifs_stats_proc_write(struct file *file, struct cifs_tcon, tcon_list);atomic_set (&tcon->num_smbs_sent,0 ); +spin_lock (&tcon->stat_lock); + tcon->bytes_read =0 ; + tcon->bytes_written =0 ; +spin_unlock (&tcon->stat_lock);if (server->ops->clear_stats) server->ops->clear_stats (tcon); }
fs/cifs/smb2misc.c +7 -0
@@ -208,6 +208,13 @@ smb2_check_message(char *buf, unsigned int length, struct TCP_Server_Info *srvr)if (clc_len ==4 + len +1 )return 0 ; +/* +* Some windows servers (win2016) will pad also the final +* PDU in a compound to 8 bytes. +*/ +if (((clc_len +7 ) & ~7 ) == len) +return 0 ; +/* * MacOS server pads after SMB2.1 write response with 3 bytes * of junk. Other servers match RFC1001 len to actual
fs/cifs/smb2pdu.c +1 -1
@@ -320,7 +320,7 @@ small_smb2_init(__le16 smb2_command, struct cifs_tcon *tcon,smb2_hdr_assemble ((struct smb2_hdr *) *request_buf, smb2_command, tcon);if (tcon !=NULL ) { -#ifdef CONFIG_CIFS_STATS2 +#ifdef CONFIG_CIFS_STATS uint16_t com_code =le16_to_cpu (smb2_command);cifs_stats_inc (&tcon->stats.smb2_stats.smb2_com_sent[com_code]);#endif
fs/dcache.c +2 -1
@@ -286,7 +286,8 @@ void take_dentry_name_snapshot(struct name_snapshot *name, struct dentry *dentryspin_unlock (&dentry->d_lock); name->name = p->name; }else { -memcpy (name->inline_name, dentry->d_iname,DNAME_INLINE_LEN ); +memcpy (name->inline_name, dentry->d_iname, + dentry->d_name.len +1 );spin_unlock (&dentry->d_lock); name->name = name->inline_name; }
fs/fat/cache.c +12 -7
@@ -224,7 +224,8 @@ static inline void cache_init(struct fat_cache_id *cid, int fclus, int dclus)int fat_get_cluster (struct inode *inode,int cluster,int *fclus,int *dclus) {struct super_block *sb = inode->i_sb; -const int limit = sb->s_maxbytes >>MSDOS_SB (sb)->cluster_bits; +struct msdos_sb_info *sbi =MSDOS_SB (sb); +const int limit = sb->s_maxbytes >> sbi->cluster_bits;struct fat_entry fatent;struct fat_cache_id cid;int nr;
@@ -233,6 +234,12 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus) *fclus =0 ; *dclus =MSDOS_I (inode)->i_start; +if (!fat_valid_entry (sbi, *dclus)) { +fat_fs_error_ratelimit (sb, +"%s: invalid start cluster (i_pos %lld, start %08x)" , + __func__,MSDOS_I (inode)->i_pos, *dclus); +return -EIO ; + }if (cluster ==0 )return 0 ;
@@ -249,9 +256,8 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus)/* prevent the infinite loop of cluster chain */ if (*fclus > limit) {fat_fs_error_ratelimit (sb, -"%s: detected the cluster chain loop" -" (i_pos %lld)" , __func__, -MSDOS_I (inode)->i_pos); +"%s: detected the cluster chain loop (i_pos %lld)" , + __func__,MSDOS_I (inode)->i_pos); nr = -EIO ; goto out; }
@@ -261,9 +267,8 @@ int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus) goto out; else if (nr == FAT_ENT_FREE) {fat_fs_error_ratelimit (sb, -"%s: invalid cluster chain (i_pos %lld)" , - __func__, -MSDOS_I (inode)->i_pos); +"%s: invalid cluster chain (i_pos %lld)" , + __func__,MSDOS_I (inode)->i_pos); nr = -EIO ; goto out; } else if (nr == FAT_ENT_EOF) {
fs/fat/fat.h +5 -0
@@ -347,6 +347,11 @@ static inline void fatent_brelse(struct fat_entry *fatent) fatent->fat_inode =NULL ; } +static inline bool fat_valid_entry (struct msdos_sb_info *sbi,int entry) +{ +return FAT_START_ENT <= entry && entry < sbi->max_cluster; +} +extern void fat_ent_access_init (struct super_block *sb);extern int fat_ent_read (struct inode *inode,struct fat_entry *fatent,int entry);
fs/fat/fatent.c +3 -3
@@ -23,7 +23,7 @@ static void fat12_ent_blocknr(struct super_block *sb, int entry, {struct msdos_sb_info *sbi =MSDOS_SB (sb);int bytes = entry + (entry >>1 ); -WARN_ON (entry <FAT_START_ENT || sbi->max_cluster <= entry); +WARN_ON (!fat_valid_entry (sbi, entry)); *offset = bytes & (sb->s_blocksize -1 ); *blocknr = sbi->fat_start + (bytes >> sb->s_blocksize_bits); }
@@ -33,7 +33,7 @@ static void fat_ent_blocknr(struct super_block *sb, int entry, {struct msdos_sb_info *sbi =MSDOS_SB (sb);int bytes = (entry << sbi->fatent_shift); -WARN_ON (entry <FAT_START_ENT || sbi->max_cluster <= entry); +WARN_ON (!fat_valid_entry (sbi, entry)); *offset = bytes & (sb->s_blocksize -1 ); *blocknr = sbi->fat_start + (bytes >> sb->s_blocksize_bits); }
@@ -353,7 +353,7 @@ int fat_ent_read(struct inode *inode, struct fat_entry *fatent, int entry)int err, offset;sector_t blocknr; -if (entry <FAT_START_ENT || sbi->max_cluster <= entry) { +if (!fat_valid_entry (sbi, entry)) {fatent_brelse (fatent);fat_fs_error (sb,"invalid access to FAT (entry 0x%08x)" , entry);return -EIO ;
fs/hfs/brec.c +4 -3
@@ -74,9 +74,10 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len)if (!fd->bnode) {if (!tree->root)hfs_btree_inc_height (tree); - fd->bnode =hfs_bnode_find (tree, tree->leaf_head); -if (IS_ERR (fd->bnode)) -return PTR_ERR (fd->bnode); + node =hfs_bnode_find (tree, tree->leaf_head); +if (IS_ERR (node)) +return PTR_ERR (node); + fd->bnode = node; fd->record =-1 ; } new_node =NULL ;
fs/hfsplus/dir.c +2 -2
@@ -77,13 +77,13 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry,cpu_to_be32 (HFSP_HARDLINK_TYPE ) && entry.file.user_info.fdCreator ==cpu_to_be32 (HFSP_HFSPLUS_CREATOR ) && +HFSPLUS_SB (sb)->hidden_dir && (entry.file.create_date ==HFSPLUS_I (HFSPLUS_SB (sb)->hidden_dir)-> create_date || entry.file.create_date ==HFSPLUS_I (d_inode (sb->s_root))-> - create_date) && - HFSPLUS_SB(sb)->hidden_dir) { + create_date)) { struct qstr str;char name[32 ];
fs/hfsplus/super.c +3 -1
@@ -524,8 +524,10 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) goto out_put_root;if (!hfs_brec_read (&fd, &entry,sizeof (entry))) {hfs_find_exit (&fd); -if (entry.type !=cpu_to_be16 (HFSPLUS_FOLDER )) +if (entry.type !=cpu_to_be16 (HFSPLUS_FOLDER )) { + err = -EINVAL ; goto out_put_root; + } inode =hfsplus_iget (sb,be32_to_cpu (entry.folder.id));if (IS_ERR (inode)) { err =PTR_ERR (inode);
fs/reiserfs/reiserfs.h +1 -1
@@ -270,7 +270,7 @@ struct reiserfs_journal_list {struct mutex j_commit_mutex;unsigned int j_trans_id; -time_t j_timestamp; +time64_t j_timestamp;/* write-only but useful for crash dump analysis */ struct reiserfs_list_bitmap *j_list_bitmap;struct buffer_head *j_commit_bh;/* commit buffer head */ struct reiserfs_journal_cnode *j_realblock;
include/linux/pci_ids.h +2 -0
@@ -3054,4 +3054,6 @@#define PCI_VENDOR_ID_OCZ 0x1b85 +#define PCI_VENDOR_ID_NCUBE 0x10ff +#endif /* _LINUX_PCI_IDS_H */
kernel/fork.c +2 -0
@@ -1304,7 +1304,9 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)return -ENOMEM ;atomic_set (&sig->count,1 ); +spin_lock_irq (¤t->sighand->siglock);memcpy (sig->action, current->sighand->action,sizeof (sig->action)); +spin_unlock_irq (¤t->sighand->siglock);return 0 ; }
lib/debugobjects.c +5 -2
@@ -294,9 +294,12 @@ static void debug_object_is_on_stack(void *addr, int onstack) limit++;if (is_on_stack) -pr_warn ("object is on stack, but not annotated\n" ); +pr_warn ("object %p is on stack %p, but NOT annotated.\n" , addr, +task_stack_page (current));else -pr_warn ("object is not on stack, but annotated\n" ); +pr_warn ("object %p is NOT on stack %p, but annotated.\n" , addr, +task_stack_page (current)); +WARN_ON (1 ); }
mm/fadvise.c +6 -2
@@ -68,8 +68,12 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice) goto out; } -/* Careful about overflows. Len == 0 means "as much as possible" */ - endbyte = offset + len; +/* +* Careful about overflows. Len == 0 means "as much as possible". Use +* unsigned math because signed overflows are undefined and UBSan +* complains. +*/ + endbyte = (u64 )offset + (u64 )len;if (!len || endbyte < len) endbyte =-1 ;else
mm/huge_memory.c +1 -1
@@ -1259,12 +1259,12 @@ int do_huge_pmd_numa_page(struct fault_env *fe, pmd_t pmd)/* Migration could have started since the pmd_trans_migrating check */ if (!page_locked) { + page_nid =-1 ;if (!get_page_unless_zero (page)) goto out_unlock;spin_unlock (fe->ptl);wait_on_page_locked (page);put_page (page); - page_nid =-1 ; goto out; }
net/9p/trans_fd.c +5 -5
@@ -195,15 +195,14 @@ static void p9_mux_poll_stop(struct p9_conn *m)static void p9_conn_cancel (struct p9_conn *m,int err) {struct p9_req_t *req, *rtmp; -unsigned long flags;LIST_HEAD (cancel_list);p9_debug (P9_DEBUG_ERROR ,"mux %p err %d\n" , m, err); -spin_lock_irqsave (&m->client->lock, flags); +spin_lock (&m->client->lock);if (m->err) { -spin_unlock_irqrestore (&m->client->lock, flags); +spin_unlock (&m->client->lock);return ; }
@@ -215,7 +214,6 @@ static void p9_conn_cancel(struct p9_conn *m, int err)list_for_each_entry_safe (req, rtmp, &m->unsent_req_list, req_list) {list_move (&req->req_list, &cancel_list); } -spin_unlock_irqrestore (&m->client->lock, flags);list_for_each_entry_safe (req, rtmp, &cancel_list, req_list) {p9_debug (P9_DEBUG_ERROR ,"call back req %p\n" , req);
@@ -224,6 +222,7 @@ static void p9_conn_cancel(struct p9_conn *m, int err) req->t_err = err;p9_client_cb (m->client, req,REQ_STATUS_ERROR ); } +spin_unlock (&m->client->lock); } static int
@@ -379,8 +378,9 @@ static void p9_read_work(struct work_struct *work)if (m->req->status !=REQ_STATUS_ERROR ) status =REQ_STATUS_RCVD ;list_del (&m->req->req_list); -spin_unlock (&m->client->lock); +/* update req->status while holding client->lock */ p9_client_cb (m->client, m->req, status); +spin_unlock (&m->client->lock); m->rc.sdata =NULL ; m->rc.offset =0 ; m->rc.capacity =0 ;
net/9p/trans_virtio.c +2 -1
@@ -571,7 +571,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vq =virtio_find_single_vq (vdev, req_done,"requests" );if (IS_ERR (chan->vq)) { err =PTR_ERR (chan->vq); - goto out_free_vq; + goto out_free_chan; } chan->vq->vdev->priv = chan;spin_lock_init (&chan->lock);
@@ -624,6 +624,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)kfree (tag); out_free_vq: vdev->config->del_vqs (vdev); +out_free_chan:kfree (chan); fail:return err;
net/ipv4/tcp_ipv4.c +6 -0
@@ -2440,6 +2440,12 @@ static int __net_init tcp_sk_init(struct net *net)if (res) goto fail;sock_set_flag (sk,SOCK_USE_WRITE_QUEUE ); + +/* Please enforce IP_DF and IPID==0 for RST and +* ACK sent in SYN-RECV and TIME-WAIT state. +*/ +inet_sk (sk)->pmtudisc =IP_PMTUDISC_DO ; + *per_cpu_ptr (net->ipv4.tcp_sk, cpu) = sk; }
net/ipv4/tcp_minisocks.c +2 -1
@@ -194,8 +194,9 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,inet_twsk_deschedule_put (tw);return TCP_TW_SUCCESS ; } + }else { +inet_twsk_reschedule (tw,TCP_TIMEWAIT_LEN ); } -inet_twsk_reschedule (tw,TCP_TIMEWAIT_LEN );if (tmp_opt.saw_tstamp) { tcptw->tw_ts_recent = tmp_opt.rcv_tsval;
net/ipv4/tcp_probe.c +2 -2
@@ -117,7 +117,7 @@ static void jtcp_rcv_established(struct sock *sk, struct sk_buff *skb, (fwmark > 0 && skb->mark == fwmark)) && (full || tp->snd_cwnd != tcp_probe.lastcwnd)) { -spin_lock_bh (&tcp_probe.lock); +spin_lock (&tcp_probe.lock);/* If log fills, just silently drop */ if (tcp_probe_avail () >1 ) {struct tcp_log *p = tcp_probe.log + tcp_probe.head;
@@ -157,7 +157,7 @@ static void jtcp_rcv_established(struct sock *sk, struct sk_buff *skb, tcp_probe.head = (tcp_probe.head +1 ) & (bufsize -1 ); } tcp_probe.lastcwnd = tp->snd_cwnd; -spin_unlock_bh (&tcp_probe.lock); +spin_unlock (&tcp_probe.lock);wake_up (&tcp_probe.wait); }
net/ipv6/ip6_vti.c +1 -1
@@ -481,7 +481,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) } mtu =dst_mtu (dst); -if (!skb->ignore_df && skb->len > mtu) { +if (skb->len > mtu) {skb_dst (skb)->ops->update_pmtu (dst,NULL , skb, mtu);if (skb->protocol ==htons (ETH_P_IPV6 )) {
net/irda/af_irda.c +12 -1
@@ -774,6 +774,13 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)return -EINVAL ;lock_sock (sk); + +/* Ensure that the socket is not already bound */ +if (self->ias_obj) { + err = -EINVAL ; + goto out; + } +#ifdef CONFIG_IRDA_ULTRA /* Special care for Ultra sockets */ if ((sk->sk_type == SOCK_DGRAM) &&
@@ -2016,7 +2023,11 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, err = -EINVAL ; goto out; } -irias_insert_object (ias_obj); + +/* Only insert newly allocated objects */ +if (free_ias) +irias_insert_object (ias_obj); +kfree (ias_opt);break ;case IRLMP_IAS_DEL :
net/netfilter/ipvs/ip_vs_core.c +11 -4
@@ -1968,13 +1968,20 @@ ip_vs_in(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, intif (cp->dest && !(cp->dest->flags &IP_VS_DEST_F_AVAILABLE )) {/* the destination server is not available */ -if (sysctl_expire_nodest_conn (ipvs)) { +__u32 flags = cp->flags; + +/* when timer already started, silently drop the packet.*/ +if (timer_pending (&cp->timer)) +__ip_vs_conn_put (cp); +else +ip_vs_conn_put (cp); + +if (sysctl_expire_nodest_conn (ipvs) && + !(flags &IP_VS_CONN_F_ONE_PACKET )) {/* try to expire the connection immediately */ ip_vs_conn_expire_now (cp); } -/* don't restart its timer, and silently -drop the packet. */ -__ip_vs_conn_put (cp); +return NF_DROP ; }
net/rds/ib_frmr.c +1 -0
@@ -61,6 +61,7 @@ static struct rds_ib_mr *rds_ib_alloc_frmr(struct rds_ib_device *rds_ibdev, pool->fmr_attr.max_pages);if (IS_ERR (frmr->mr)) {pr_warn ("RDS/IB: %s failed to allocate MR" , __func__); + err =PTR_ERR (frmr->mr); goto out_no_cigar; }
net/sched/act_ife.c +45 -34
178 lines not on this page · raw message
net/sched/cls_u32.c +6 -2
@@ -851,6 +851,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,struct nlattr *opt = tca[TCA_OPTIONS ];struct nlattr *tb[TCA_U32_MAX +1 ];u32 htid, flags =0 ; +size_t sel_size;int err;#ifdef CONFIG_CLS_U32_PERF size_t size;
@@ -967,8 +968,11 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,return -EINVAL ; s =nla_data (tb[TCA_U32_SEL ]); + sel_size =sizeof (*s) +sizeof (*s->keys) * s->nkeys; +if (nla_len (tb[TCA_U32_SEL ]) < sel_size) +return -EINVAL ; - n =kzalloc (sizeof (*n) + s->nkeys*sizeof (struct tc_u32_key ),GFP_KERNEL ); + n = kzalloc(offsetof(typeof(*n), sel) + sel_size, GFP_KERNEL);if (n ==NULL )return -ENOBUFS ;
@@ -981,7 +985,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, }#endif -memcpy (&n->sel, s,sizeof (*s) + s->nkeys*sizeof (struct tc_u32_key )); +memcpy (&n->sel, s, sel_size);RCU_INIT_POINTER (n->ht_up, ht); n->handle = handle; n->fshift = s->hmask ?ffs (ntohl (s->hmask)) -1 :0 ;
net/sched/sch_hhf.c +3 -0
@@ -492,6 +492,9 @@ static void hhf_destroy(struct Qdisc *sch)hhf_free (q->hhf_valid_bits[i]); } +if (!q->hh_flows) +return ; +for (i =0 ; i <HH_FLOWS_CNT ; i++) {struct hh_flow_state *flow, *next;struct list_head *head = &q->hh_flows[i];
net/sched/sch_htb.c +3 -2
@@ -1013,6 +1013,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)int err;int i; +qdisc_watchdog_init (&q->watchdog, sch); +INIT_WORK (&q->work, htb_work_func); +if (!opt)return -EINVAL ;
@@ -1033,8 +1036,6 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)for (i =0 ; i <TC_HTB_NUMPRIO ; i++)INIT_LIST_HEAD (q->drops + i); -qdisc_watchdog_init (&q->watchdog, sch); -INIT_WORK (&q->work, htb_work_func);qdisc_skb_head_init (&q->direct_queue);if (tb[TCA_HTB_DIRECT_QLEN ])
net/sched/sch_multiq.c +2 -7
@@ -234,7 +234,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)static int multiq_init (struct Qdisc *sch,struct nlattr *opt) {struct multiq_sched_data *q =qdisc_priv (sch); -int i, err; +int i; q->queues =NULL ;
@@ -249,12 +249,7 @@ static int multiq_init(struct Qdisc *sch, struct nlattr *opt)for (i =0 ; i < q->max_bands; i++) q->queues[i] = &noop_qdisc; - err =multiq_tune (sch, opt); - -if (err) -kfree (q->queues); - -return err; +return multiq_tune (sch, opt); }static int multiq_dump (struct Qdisc *sch,struct sk_buff *skb)
net/sched/sch_netem.c +2 -2
@@ -937,11 +937,11 @@ static int netem_init(struct Qdisc *sch, struct nlattr *opt)struct netem_sched_data *q =qdisc_priv (sch);int ret; +qdisc_watchdog_init (&q->watchdog, sch); +if (!opt)return -EINVAL ; -qdisc_watchdog_init (&q->watchdog, sch); - q->loss_model =CLG_RANDOM ; ret =netem_change (sch, opt);if (ret)
net/sched/sch_tbf.c +3 -2
@@ -423,12 +423,13 @@ static int tbf_init(struct Qdisc *sch, struct nlattr *opt) {struct tbf_sched_data *q =qdisc_priv (sch); +qdisc_watchdog_init (&q->watchdog, sch); + q->qdisc = &noop_qdisc; +if (opt ==NULL )return -EINVAL ; q->t_c =ktime_get_ns (); -qdisc_watchdog_init (&q->watchdog, sch); - q->qdisc = &noop_qdisc;return tbf_change (sch, opt); }
net/sctp/proc.c +0 -4
@@ -337,8 +337,6 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) } transport = (struct sctp_transport *)v; -if (!sctp_transport_hold (transport)) -return 0 ; assoc = transport->asoc; epb = &assoc->base; sk = epb->sk;
@@ -428,8 +426,6 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) } transport = (struct sctp_transport *)v; -if (!sctp_transport_hold (transport)) -return 0 ; assoc = transport->asoc; list_for_each_entry_rcu(tsp, &assoc->peer.transport_addr_list,
net/sctp/socket.c +15 -7
@@ -4476,9 +4476,14 @@ struct sctp_transport *sctp_transport_get_next(struct net *net,break ; } +if (!sctp_transport_hold (t)) +continue ; +if (net_eq (sock_net (t->asoc->base.sk), net) && t->asoc->peer.primary_path == t)break ; + +sctp_transport_put (t); }return t;
@@ -4488,13 +4493,18 @@ struct sctp_transport *sctp_transport_get_idx(struct net *net, struct rhashtable_iter *iter, int pos) { - void *obj = SEQ_START_TOKEN; +struct sctp_transport *t; -while (pos && (obj =sctp_transport_get_next (net, iter)) && - !IS_ERR (obj)) - pos--; +if (!pos) +return SEQ_START_TOKEN ; -return obj; +while ((t =sctp_transport_get_next (net, iter)) && !IS_ERR (t)) { +if (!--pos) +break ; +sctp_transport_put (t); + } + +return t; } int sctp_for_each_endpoint(int (*cb)(struct sctp_endpoint *, void *),
@@ -4556,8 +4566,6 @@ int sctp_for_each_transport(int (*cb)(struct sctp_transport *, void *),for (; !IS_ERR_OR_NULL (obj); obj =sctp_transport_get_next (net, &hti)) {struct sctp_transport *transport = obj; -if (!sctp_transport_hold (transport)) -continue ; err =cb (transport, p);sctp_transport_put (transport);if (err)
net/sunrpc/auth_gss/gss_krb5_crypto.c +9 -3
@@ -169,7 +169,7 @@ make_checksum_hmac_md5(struct krb5_ctx *kctx, char *header, int hdrlen,struct scatterlist sg[1 ];int err =-1 ;u8 *checksumdata; -u8 rc4salt[4 ]; +u8 *rc4salt;struct crypto_ahash *md5;struct crypto_ahash *hmac_md5;struct ahash_request *req;
@@ -183,14 +183,18 @@ make_checksum_hmac_md5(struct krb5_ctx *kctx, char *header, int hdrlen,return GSS_S_FAILURE ; } + rc4salt =kmalloc_array (4 ,sizeof (*rc4salt),GFP_NOFS ); +if (!rc4salt) +return GSS_S_FAILURE ; +if (arcfour_hmac_md5_usage_to_salt (usage, rc4salt)) {dprintk ("%s: invalid usage value %u\n" , __func__, usage); -return GSS_S_FAILURE ; + goto out_free_rc4salt; } checksumdata =kmalloc (GSS_KRB5_MAX_CKSUM_LEN ,GFP_NOFS );if (!checksumdata) -return GSS_S_FAILURE ; + goto out_free_rc4salt; md5 =crypto_alloc_ahash ("md5" ,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR (md5))
@@ -258,6 +262,8 @@ make_checksum_hmac_md5(struct krb5_ctx *kctx, char *header, int hdrlen,crypto_free_ahash (md5); out_free_cksum:kfree (checksumdata); +out_free_rc4salt: +kfree (rc4salt);return err ?GSS_S_FAILURE :0 ; }
scripts/depmod.sh +2 -2
@@ -15,9 +15,9 @@ if ! test -r System.map ; then fi if [ -z $(command -v $DEPMOD) ]; then - echo "'make modules_install' requires $DEPMOD. Please install it." >&2 + echo "Warning: 'make modules_install' requires $DEPMOD. Please install it." >&2 echo "This is probably in the kmod package." >&2 - exit 1 + exit 0 fi # older versions of depmod don't support -P <symbol-prefix>
scripts/mod/modpost.c +4 -4
@@ -649,7 +649,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,if (ELF_ST_TYPE (sym->st_info) ==STT_SPARC_REGISTER )break ;if (symname[0 ] =='.' ) { -char *munged =strdup (symname); +char *munged =NOFAIL (strdup (symname)); munged[0 ] ='_' ; munged[1 ] =toupper (munged[1 ]); symname = munged;
@@ -1312,7 +1312,7 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr,static char *sec2annotation (const char *s) {if (match (s, init_exit_sections)) { -char *p =malloc (20 ); +char *p =NOFAIL (malloc (20 ));char *r = p; *p++ ='_' ;
@@ -1332,7 +1332,7 @@ static char *sec2annotation(const char *s)strcat (p," " );return r; }else { -return strdup ("" ); +return NOFAIL (strdup ("" )); } }
@@ -2033,7 +2033,7 @@ void buf_write(struct buffer *buf, const char *s, int len) {if (buf->size - buf->pos < len) { buf->size += len +SZ ; - buf->p =realloc (buf->p, buf->size); + buf->p =NOFAIL (realloc (buf->p, buf->size)); }strncpy (buf->p + buf->pos, s, len); buf->pos += len;
sound/soc/codecs/wm8994.c +1 -0
@@ -2431,6 +2431,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,snd_soc_update_bits (codec,WM8994_POWER_MANAGEMENT_2 ,WM8994_OPCLK_ENA ,0 ); } +break ;default :return -EINVAL ;
tools/perf/arch/powerpc/util/sym-handling.c +3 -1
@@ -115,8 +115,10 @@ void arch__post_process_probe_trace_events(struct perf_probe_event *pev,for (i =0 ; i < ntevs; i++) { tev = &pev->tevs[i];map__for_each_symbol (map, sym, tmp) { -if (map->unmap_ip (map, sym->start) == tev->point.address) +if (map->unmap_ip (map, sym->start) == tev->point.address) {arch__fix_tev_from_maps (pev, tev, map, sym); +break ; + } } } }
tools/testing/selftests/powerpc/harness.c +12 -6
@@ -85,13 +85,13 @@ int run_test(int (test_function)(void), char *name)return status; } -static void alarm_handler (int signum) +static void sig_handler (int signum) { -/* Jut wake us up from waitpid */ +/* Just wake us up from waitpid */ } -static struct sigaction alarm_action = { - .sa_handler = alarm_handler, +static struct sigaction sig_action = { + .sa_handler = sig_handler, };void test_harness_set_timeout (uint64_t time)
@@ -106,8 +106,14 @@ int test_harness(int (test_function)(void), char *name)test_start (name);test_set_git_version (GIT_VERSION ); -if (sigaction (SIGALRM , &alarm_action,NULL )) { -perror ("sigaction" ); +if (sigaction (SIGINT , &sig_action,NULL )) { +perror ("sigaction (sigint)" ); +test_error (name); +return 1 ; + } + +if (sigaction (SIGALRM , &sig_action,NULL )) { +perror ("sigaction (sigalrm)" );test_error (name);return 1 ; }