Linux 4.6.7
Greg KH
maintainerI'm announcing the release of the 4.6.7 kernel.
All users of the 4.6 kernel series must upgrade.
Note, this is the LAST 4.6.y kernel to be released, please move to 4.7.1 now, you have been warned.
The updated 4.6.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.6.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
------------
Documentation/cpu-freq/pcc-cpufreq.txt | 4 - Documentation/x86/pat.txt | 32 ++++++++ Makefile | 2 arch/arm/kernel/sys_oabi-compat.c | 8 +- arch/mips/kernel/scall64-n32.S | 2 arch/mips/kernel/scall64-o32.S | 2 arch/powerpc/Kconfig | 2 arch/powerpc/kernel/eeh_driver.c | 7 + arch/x86/entry/syscalls/syscall_32.tbl | 2 arch/x86/include/asm/microcode.h | 2 arch/x86/include/asm/mtrr.h | 6 + arch/x86/include/asm/pat.h | 2 arch/x86/kernel/cpu/microcode/core.c | 3 arch/x86/kernel/cpu/mtrr/generic.c | 24 +++--- arch/x86/kernel/cpu/mtrr/main.c | 13 +++ arch/x86/kernel/cpu/mtrr/mtrr.h | 1 arch/x86/mm/init.c | 7 - arch/x86/mm/pat.c | 109 ++++++++++++++++++------------ arch/x86/power/hibernate_asm_64.S | 4 - arch/x86/xen/enlighten.c | 9 -- block/genhd.c | 1 crypto/gcm.c | 4 - crypto/scatterwalk.c | 3 drivers/char/random.c | 13 +-- drivers/cpufreq/pcc-cpufreq.c | 2 drivers/i2c/busses/i2c-i801.c | 103 +++++++++++++++++++++++++--- drivers/net/bonding/bond_netlink.c | 6 + drivers/net/ethernet/broadcom/bgmac.c | 2 drivers/net/ethernet/qlogic/qed/qed_spq.c | 7 - drivers/net/macsec.c | 3 drivers/net/ppp/ppp_generic.c | 5 - drivers/nvdimm/pfn.h | 4 - drivers/nvdimm/pfn_devs.c | 53 ++++++++++++-- drivers/nvdimm/pmem.c | 4 - drivers/regulator/qcom_smd-regulator.c | 1 drivers/staging/rdma/hfi1/ud.c | 23 ------ drivers/staging/rdma/hfi1/verbs_txreq.c | 4 - drivers/staging/rdma/hfi1/verbs_txreq.h | 1 drivers/tty/serial/mvebu-uart.c | 2 fs/dcache.c | 7 + fs/ext4/balloc.c | 3 fs/ext4/extents.c | 8 +- fs/ext4/inode.c | 35 +++++++-- fs/ext4/mballoc.c | 17 ---- fs/ext4/super.c | 17 ++++ fs/fuse/file.c | 24 ++++++ fs/fuse/inode.c | 2 fs/inode.c | 2 fs/udf/super.c | 67 +++++++++++------- include/linux/netdevice.h | 7 + ipc/msg.c | 2 ipc/sem.c | 12 +-- lib/radix-tree.c | 14 ++- mm/memcontrol.c | 68 +++++++++++++++--- mm/mempool.c | 18 ---- net/8021q/vlan_dev.c | 10 +- net/8021q/vlan_netlink.c | 7 + net/bridge/br_input.c | 18 ++++ net/ipv4/tcp_input.c | 54 ++++++++------ net/ipv4/tcp_output.c | 3 net/ipv6/addrconf.c | 4 + net/irda/af_irda.c | 7 + security/apparmor/apparmorfs.c | 1 63 files changed, 618 insertions(+), 271 deletions(-)
Alden Tondettar (1):
udf: Prevent stack overflow on corrupted filesystem mount
Alexey Kuznetsov (1):
fuse: fsync() did not return IO errors
Andreas Herrmann (1):
Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency"
Axel Lin (1):
regulator: qcom_smd: Remove list_voltage callback for rpm_smps_ldo_ops_fixed
Beniamino Galvani (2):
bonding: set carrier off for devices created through netlink
macsec: ensure rx_sa is set when validation is disabled
Borislav Petkov (1):
x86/microcode: Fix suspend to RAM with builtin microcode
Dan Williams (2):
libnvdimm, dax: record the specified alignment of a dax-device instance libnvdimm, pfn, dax: fix initialization vs autodetect for mode + alignment
Dave Weinstein (1):
arm: oabi compat: add missing access checks
David Howells (2):
KEYS: 64-bit MIPS needs to use compat_sys_keyctl for 32-bit userspace x86/syscalls/64: Add compat_sys_keyctl for 32-bit userspace
Eric Dumazet (1):
tcp: make challenge acks less predictable
Fabian Frederick (1):
sysv, ipc: fix security-layer leaking
Florian Fainelli (1):
net: bgmac: Fix infinite loop in bgmac_dma_tx_add()
Gavin Shan (1):
powerpc/eeh: Fix invalid cached PE primary bus
Greg Kroah-Hartman (1):
Linux 4.6.7
Herbert Xu (2):
crypto: gcm - Filter out async ghash if necessary
crypto: scatterwalk - Fix test in scatterwalk_done
Ido Schimmel (1):
bridge: Fix incorrect re-injection of LLDP packets
Jan Kara (1):
ext4: fix deadlock during page writeback
Jason Baron (1):
tcp: enable per-socket rate limiting of all 'challenge acks'
John Johansen (1):
apparmor: fix ref count leak when profile sha1 hash is read
Josh Poimboeuf (1):
x86/power/64: Fix hibernation return address corruption
Manish Chopra (1):
qed: Fix setting/clearing bit in completion bitmap
Maxim Patlasov (1):
fuse: fuse_flush must check mapping->flags for errors
Michal Hocko (1):
Revert "mm, mempool: only set __GFP_NOMEMALLOC if there are free elements"
Mika Westerberg (1):
i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR
Mike Manning (1):
net: ipv6: Always leave anycast and multicast groups on link down
Mike Marciniszyn (2):
IB/hfi1: Correct issues with sc5 computation IB/hfi1: Fix deadlock with txreq allocation slow path
Naveen N. Rao (1):
powerpc/bpf/jit: Disable classic BPF JIT on ppc64le
Paolo Abeni (1):
vlan: use a valid default mtu value for vlan over macsec
Soheil Hassas Yeganeh (1):
tcp: consider recv buf for the initial window scale
Theodore Ts'o (2):
random: strengthen input validation for RNDADDTOENTCNT
ext4: validate s_reserved_gdt_blocks on mount
Thomas Petazzoni (1):
serial: mvebu-uart: free the IRQ in ->shutdown()
Toshi Kani (8):
x86/mm/pat: Add support of non-default PAT MSR setting x86/mm/pat: Add pat_disable() interface x86/mm/pat: Replace cpu_has_pat with boot_cpu_has() x86/mtrr: Fix Xorg crashes in Qemu sessions x86/mtrr: Fix PAT init handling when MTRR is disabled x86/xen, pat: Remove PAT table init code from Xen x86/pat: Document the PAT initialization sequence x86/mm/pat: Fix BUG_ON() in mmap_mem() on QEMU/i386
Vegard Nossum (6):
net/irda: fix NULL pointer dereference on memory allocation failure
block: fix use-after-free in seq file
ext4: check for extents that wrap around
ext4: don't call ext4_should_journal_data() on the journal inode
ext4: short-cut orphan cleanup on error
ext4: fix reference counting bug on block allocation error
Vladimir Davydov (3):
mm: memcontrol: fix swap counter leak on swapout from offline cgroup
mm: memcontrol: fix memcg id ref counter on swap charge move
radix-tree: account nodes to memcg only if explicitly requested
WANG Cong (1):
ppp: defer netns reference release for ppp channel
Wei Fang (2):
fuse: fix wrong assignment of ->flags in fuse_send_init() fs/dcache.c: avoid soft-lockup in dput()
Greg KH
maintainerDocumentation/cpu-freq/pcc-cpufreq.txt +2 -2
@@ -159,8 +159,8 @@ to be strictly associated with a P-state. 2.2 cpuinfo_transition_latency: ------------------------------- -The cpuinfo_transition_latency field is CPUFREQ_ETERNAL. The PCC specification -does not include a field to expose this value currently. +The cpuinfo_transition_latency field is 0. The PCC specification does +not include a field to expose this value currently. 2.3 cpuinfo_cur_freq: ---------------------
Documentation/x86/pat.txt +32 -0
@@ -196,3 +196,35 @@ Another, more verbose way of getting PAT related debug messages is with "debugpat" boot parameter. With this parameter, various debug messages are printed to dmesg log. +PAT Initialization +------------------ + +The following table describes how PAT is initialized under various +configurations. The PAT MSR must be updated by Linux in order to support WC +and WT attributes. Otherwise, the PAT MSR has the value programmed in it +by the firmware. Note, Xen enables WC attribute in the PAT MSR for guests. + + MTRR PAT Call Sequence PAT State PAT MSR + ========================================================= + E E MTRR -> PAT init Enabled OS + E D MTRR -> PAT init Disabled - + D E MTRR -> PAT disable Disabled BIOS + D D MTRR -> PAT disable Disabled - + - np/E PAT -> PAT disable Disabled BIOS + - np/D PAT -> PAT disable Disabled - + E !P/E MTRR -> PAT init Disabled BIOS + D !P/E MTRR -> PAT disable Disabled BIOS + !M !P/E MTRR stub -> PAT disable Disabled BIOS + + Legend + ------------------------------------------------ + E Feature enabled in CPU + D Feature disabled/unsupported in CPU + np "nopat" boot option specified + !P CONFIG_X86_PAT option unset + !M CONFIG_MTRR option unset + Enabled PAT state set to enabled + Disabled PAT state set to disabled + OS PAT initializes PAT MSR with OS setting + BIOS PAT keeps PAT MSR with BIOS setting +
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 6 -SUBLEVEL = 6 +SUBLEVEL = 7 EXTRAVERSION = NAME = Charred Weasel
arch/arm/kernel/sys_oabi-compat.c +7 -1
@@ -279,8 +279,12 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,mm_segment_t fs;long ret, err, i; -if (maxevents <=0 || maxevents > (INT_MAX /sizeof (struct epoll_event ))) +if (maxevents <=0 || + maxevents > (INT_MAX /sizeof (*kbuf)) || + maxevents > (INT_MAX /sizeof (*events)))return -EINVAL ; +if (!access_ok (VERIFY_WRITE , events,sizeof (*events) * maxevents)) +return -EFAULT ; kbuf =kmalloc (sizeof (*kbuf) * maxevents,GFP_KERNEL );if (!kbuf)return -ENOMEM ;
@@ -317,6 +321,8 @@ asmlinkage long sys_oabi_semtimedop(int semid,if (nsops <1 || nsops >SEMOPM )return -EINVAL ; +if (!access_ok (VERIFY_READ , tsops,sizeof (*tsops) * nsops)) +return -EFAULT ; sops =kmalloc (sizeof (*sops) * nsops,GFP_KERNEL );if (!sops)return -ENOMEM ;
arch/mips/kernel/scall64-n32.S +1 -1
@@ -344,7 +344,7 @@ EXPORT(sysn32_call_table) PTR sys_ni_syscall /* available, was setaltroot */ PTR sys_add_key PTR sys_request_key - PTR sys_keyctl /* 6245 */ + PTR compat_sys_keyctl /* 6245 */ PTR sys_set_thread_area PTR sys_inotify_init PTR sys_inotify_add_watch
arch/mips/kernel/scall64-o32.S +1 -1
@@ -500,7 +500,7 @@ EXPORT(sys32_call_table) PTR sys_ni_syscall /* available, was setaltroot */ PTR sys_add_key /* 4280 */ PTR sys_request_key - PTR sys_keyctl + PTR compat_sys_keyctl PTR sys_set_thread_area PTR sys_inotify_init PTR sys_inotify_add_watch /* 4285 */
arch/powerpc/Kconfig +1 -1
@@ -126,7 +126,7 @@ config PPC select IRQ_FORCED_THREADING select HAVE_RCU_TABLE_FREE if SMP select HAVE_SYSCALL_TRACEPOINTS - select HAVE_BPF_JIT + select HAVE_BPF_JIT if CPU_BIG_ENDIAN select HAVE_ARCH_JUMP_LABEL select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAS_GCOV_PROFILE_ALL
arch/powerpc/kernel/eeh_driver.c +4 -3
@@ -648,7 +648,6 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus,if (pe->type &EEH_PE_VF ) {eeh_pe_dev_traverse (pe, eeh_rmv_device,NULL ); }else { -eeh_pe_state_clear (pe,EEH_PE_PRI_BUS );pci_lock_rescan_remove ();pcibios_remove_pci_devices (bus);pci_unlock_rescan_remove ();
@@ -698,10 +697,12 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus,*/ edev = list_first_entry(&pe->edevs, struct eeh_dev, list);eeh_pe_traverse (pe, eeh_pe_detach_dev,NULL ); -if (pe->type &EEH_PE_VF ) +if (pe->type &EEH_PE_VF ) {eeh_add_virt_device (edev,NULL ); -else + }else { +eeh_pe_state_clear (pe,EEH_PE_PRI_BUS );pcibios_add_pci_devices (bus); + } }else if (frozen_bus && rmv_data->removed) {pr_info ("EEH: Sleep 5s ahead of partial hotplug\n" );ssleep (5 );
arch/x86/entry/syscalls/syscall_32.tbl +1 -1
@@ -294,7 +294,7 @@ # 285 sys_setaltroot 286 i386 add_key sys_add_key 287 i386 request_key sys_request_key -288 i386 keyctl sys_keyctl +288 i386 keyctl sys_keyctl compat_sys_keyctl 289 i386 ioprio_set sys_ioprio_set 290 i386 ioprio_get sys_ioprio_get 291 i386 inotify_init sys_inotify_init
arch/x86/include/asm/microcode.h +0 -2
@@ -133,13 +133,11 @@ static inline unsigned int x86_cpuid_family(void)#ifdef CONFIG_MICROCODE extern void __init load_ucode_bsp (void );extern void load_ucode_ap (void ); -extern int __init save_microcode_in_initrd (void );void reload_early_microcode (void );extern bool get_builtin_firmware (struct cpio_data *cd,const char *name);#else static inline void __init load_ucode_bsp (void ) { }static inline void load_ucode_ap (void ) { } -static inline int __init save_microcode_in_initrd (void ) {return 0 ; }static inline void reload_early_microcode (void ) { }static inline bool get_builtin_firmware (struct cpio_data *cd,const char *name) {return false; }
arch/x86/include/asm/mtrr.h +5 -1
@@ -24,6 +24,7 @@#define _ASM_X86_MTRR_H#include <uapi/asm/mtrr.h> +#include <asm/pat.h> /*
@@ -83,9 +84,12 @@ static inline int mtrr_trim_uncached_memory(unsigned long end_pfn)static inline void mtrr_centaur_report_mcr (int mcr,u32 lo,u32 hi) { } +static inline void mtrr_bp_init (void ) +{ +pat_disable ("MTRRs disabled, skipping PAT initialization too." ); +}#define mtrr_ap_init () do {} while (0) -#define mtrr_bp_init () do {} while (0)#define set_mtrr_aps_delayed_init () do {} while (0)#define mtrr_aps_init () do {} while (0)#define mtrr_bp_restore () do {} while (0)
arch/x86/include/asm/pat.h +1 -1
@@ -5,8 +5,8 @@#include <asm/pgtable_types.h> bool pat_enabled (void ); +void pat_disable (const char *reason);extern void pat_init (void ); -void pat_init_cache_modes (u64 );extern int reserve_memtype (u64 start,u64 end,enum page_cache_mode req_pcm,enum page_cache_mode *ret_pcm);
arch/x86/kernel/cpu/microcode/core.c +2 -1
@@ -175,7 +175,7 @@ void load_ucode_ap(void) } } -int __init save_microcode_in_initrd (void ) +static int __init save_microcode_in_initrd (void ) {struct cpuinfo_x86 *c = &boot_cpu_data;
@@ -691,4 +691,5 @@ int __init microcode_init(void)return error; } +fs_initcall (save_microcode_in_initrd);late_initcall (microcode_init);
arch/x86/kernel/cpu/mtrr/generic.c +14 -10
@@ -444,11 +444,24 @@ static void __init print_mtrr_state(void)pr_debug ("TOM2: %016llx aka %lldM\n" , mtrr_tom2, mtrr_tom2>>20 ); } +/* PAT setup for BP. We need to go through sync steps here */ +void __init mtrr_bp_pat_init (void ) +{ +unsigned long flags; + +local_irq_save (flags); +prepare_set (); + +pat_init (); + +post_set (); +local_irq_restore (flags); +} +/* Grab all of the MTRR state for this CPU into *state */ bool __init get_mtrr_state (void ) {struct mtrr_var_range *vrs; -unsigned long flags;unsigned lo, dummy;unsigned int i;
@@ -481,15 +494,6 @@ bool __init get_mtrr_state(void) mtrr_state_set =1 ; -/* PAT setup for BP. We need to go through sync steps here */ -local_irq_save (flags); -prepare_set (); - -pat_init (); - -post_set (); -local_irq_restore (flags); -return !!(mtrr_state.enabled &MTRR_STATE_MTRR_ENABLED ); }
arch/x86/kernel/cpu/mtrr/main.c +12 -1
@@ -752,6 +752,9 @@ void __init mtrr_bp_init(void)/* BIOS may override */ __mtrr_enabled =get_mtrr_state (); +if (mtrr_enabled ()) +mtrr_bp_pat_init (); +if (mtrr_cleanup (phys_addr)) { changed_by_mtrr_cleanup =1 ; mtrr_if->set_all ();
@@ -759,8 +762,16 @@ void __init mtrr_bp_init(void) } } -if (!mtrr_enabled ()) +if (!mtrr_enabled ()) {pr_info ("MTRR: Disabled\n" ); + +/* +* PAT initialization relies on MTRR's rendezvous handler. +* Skip PAT init until the handler can initialize both +* features independently. +*/ +pat_disable ("MTRRs disabled, skipping PAT initialization too." ); + } }void mtrr_ap_init (void )
arch/x86/kernel/cpu/mtrr/mtrr.h +1 -0
@@ -52,6 +52,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt);void fill_mtrr_var_range (unsigned int index,u32 base_lo,u32 base_hi,u32 mask_lo,u32 mask_hi);bool get_mtrr_state (void ); +void mtrr_bp_pat_init (void );extern void set_mtrr_ops (const struct mtrr_ops *ops);
arch/x86/mm/init.c +0 -7
@@ -696,13 +696,6 @@ void free_initmem(void)void __init free_initrd_mem (unsigned long start,unsigned long end) {/* -* Remember, initrd memory may contain microcode or other useful things. -* Before we lose initrd mem, we need to find a place to hold them -* now that normal virtual memory is enabled. -*/ -save_microcode_in_initrd (); - -/* * end could be not aligned, and We can not align that, * decompresser could be confused by aligned initrd_end * We already reserve the end partial page before in
arch/x86/mm/pat.c +67 -42
168 lines not on this page · raw message
arch/x86/power/hibernate_asm_64.S +1 -3
@@ -24,7 +24,6 @@ #include <asm/frame.h> ENTRY(swsusp_arch_suspend) - FRAME_BEGIN movq $saved_context, %rax movq %rsp, pt_regs_sp(%rax) movq %rbp, pt_regs_bp(%rax)
@@ -51,6 +50,7 @@ ENTRY(swsusp_arch_suspend) movq %cr3, %rax movq %rax, restore_cr3(%rip) + FRAME_BEGIN call swsusp_save FRAME_END ret
@@ -111,7 +111,6 @@ ENTRY(core_restore_code) */ ENTRY(restore_registers) - FRAME_BEGIN /* go back to the original page tables */ movq %rbx, %cr3
@@ -152,6 +151,5 @@ ENTRY(restore_registers) /* tell the hibernation core that we've just restored the memory */ movq %rax, in_suspend(%rip) - FRAME_END ret ENDPROC(restore_registers)
arch/x86/xen/enlighten.c +0 -9
@@ -75,7 +75,6 @@#include <asm/mach_traps.h> #include <asm/mwait.h> #include <asm/pci_x86.h> -#include <asm/pat.h> #include <asm/cpu.h> #ifdef CONFIG_ACPI
@@ -1511,7 +1510,6 @@ asmlinkage __visible void __init xen_start_kernel(void) {struct physdev_set_iopl set_iopl;unsigned long initrd_start =0 ; -u64 pat;int rc;if (!xen_start_info)
@@ -1618,13 +1616,6 @@ asmlinkage __visible void __init xen_start_kernel(void) xen_start_info->nr_pages);xen_reserve_special_pages (); -/* -* Modify the cache mode translation tables to match Xen's PAT -* configuration. -*/ -rdmsrl (MSR_IA32_CR_PAT , pat); -pat_init_cache_modes (pat); -/* keep using Xen gdt for now; no urgent need to change it */ #ifdef CONFIG_X86_32
block/genhd.c +1 -0
@@ -856,6 +856,7 @@ static void disk_seqf_stop(struct seq_file *seqf, void *v)if (iter) {class_dev_iter_exit (iter);kfree (iter); + seqf->private =NULL ; } }
crypto/gcm.c +3 -1
@@ -639,7 +639,9 @@ static int crypto_gcm_create_common(struct crypto_template *tmpl, ghash_alg =crypto_find_alg (ghash_name, &crypto_ahash_type,CRYPTO_ALG_TYPE_HASH , -CRYPTO_ALG_TYPE_AHASH_MASK ); +CRYPTO_ALG_TYPE_AHASH_MASK | +crypto_requires_sync (algt->type, + algt->mask));if (IS_ERR (ghash_alg))return PTR_ERR (ghash_alg);
crypto/scatterwalk.c +2 -1
@@ -72,7 +72,8 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,void scatterwalk_done (struct scatter_walk *walk,int out,int more) { -if (!(scatterwalk_pagelen (walk) & (PAGE_SIZE -1 )) || !more) +if (!more || walk->offset >= walk->sg->offset + walk->sg->length || + !(walk->offset & (PAGE_SIZE -1 )))scatterwalk_pagedone (walk, out, more); }EXPORT_SYMBOL_GPL (scatterwalk_done);
drivers/char/random.c +7 -6
@@ -722,15 +722,18 @@ retry: } } -static void credit_entropy_bits_safe (struct entropy_store *r,int nbits) +static int credit_entropy_bits_safe (struct entropy_store *r,int nbits) {const int nbits_max = (int )(~0U >> (ENTROPY_SHIFT +1 )); +if (nbits <0 ) +return -EINVAL ; +/* Cap the value to avoid overflows */ nbits =min (nbits, nbits_max); - nbits =max (nbits, -nbits_max);credit_entropy_bits (r, nbits); +return 0 ; }/*********************************************************************
@@ -1542,8 +1545,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)return -EPERM ;if (get_user (ent_count, p))return -EFAULT ; -credit_entropy_bits_safe (&input_pool, ent_count); -return 0 ; +return credit_entropy_bits_safe (&input_pool, ent_count);case RNDADDENTROPY :if (!capable (CAP_SYS_ADMIN ))return -EPERM ;
@@ -1557,8 +1559,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg) size);if (retval <0 )return retval; -credit_entropy_bits_safe (&input_pool, ent_count); -return 0 ; +return credit_entropy_bits_safe (&input_pool, ent_count);case RNDZAPENTCNT :case RNDCLEARPOOL :/*
drivers/cpufreq/pcc-cpufreq.c +0 -2
@@ -555,8 +555,6 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) policy->min = policy->cpuinfo.min_freq =ioread32 (&pcch_hdr->minimum_frequency) *1000 ; - policy->cpuinfo.transition_latency =CPUFREQ_ETERNAL ; -pr_debug ("init: policy->max is %d, policy->min is %d\n" , policy->max, policy->min); out:
drivers/i2c/busses/i2c-i801.c +94 -9
174 lines not on this page · raw message
drivers/net/bonding/bond_netlink.c +5 -1
@@ -446,7 +446,11 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev,if (err <0 )return err; -return register_netdevice (bond_dev); + err =register_netdevice (bond_dev); + +netif_carrier_off (bond_dev); + +return err; }static size_t bond_get_size (const struct net_device *bond_dev)
drivers/net/ethernet/broadcom/bgmac.c +1 -1
@@ -231,7 +231,7 @@ err_dma:dma_unmap_single (dma_dev, slot->dma_addr,skb_headlen (skb),DMA_TO_DEVICE ); -while (i >0 ) { +while (i-- >0 ) {int index = (ring->end + i) %BGMAC_TX_RING_SLOTS ;struct bgmac_slot_info *slot = &ring->slots[index];u32 ctl1 =le32_to_cpu (ring->cpu_base[index].ctl1);
drivers/net/ethernet/qlogic/qed/qed_spq.c +3 -4
@@ -791,13 +791,12 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn,* in a bitmap and increasing the chain consumer only * for the first successive completed entries. */ -bitmap_set (p_spq->p_comp_bitmap, pos,SPQ_RING_SIZE ); +__set_bit (pos, p_spq->p_comp_bitmap);while (test_bit (p_spq->comp_bitmap_idx, p_spq->p_comp_bitmap)) { -bitmap_clear (p_spq->p_comp_bitmap, - p_spq->comp_bitmap_idx, -SPQ_RING_SIZE ); +__clear_bit (p_spq->comp_bitmap_idx, + p_spq->p_comp_bitmap); p_spq->comp_bitmap_idx++;qed_chain_return_produced (&p_spq->chain); }
drivers/net/macsec.c +2 -1
@@ -914,7 +914,6 @@ static struct sk_buff *macsec_decrypt(struct sk_buff *skb, }macsec_skb_cb (skb)->req = req; -macsec_skb_cb (skb)->rx_sa = rx_sa; skb->dev = dev;aead_request_set_callback (req,0 , macsec_decrypt_done, skb);
@@ -1141,6 +1140,8 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb) } } +macsec_skb_cb (skb)->rx_sa = rx_sa; +/* Disabled && !changed text => skip validation */ if (hdr->tci_an &MACSEC_TCI_C || secy->validate_frames !=MACSEC_VALIDATE_DISABLED )
drivers/net/ppp/ppp_generic.c +3 -2
@@ -2404,8 +2404,6 @@ ppp_unregister_channel(struct ppp_channel *chan)spin_lock_bh (&pn->all_channels_lock);list_del (&pch->list);spin_unlock_bh (&pn->all_channels_lock); -put_net (pch->chan_net); - pch->chan_net =NULL ; pch->file.dead =1 ;wake_up_interruptible (&pch->file.rwait);
@@ -2999,6 +2997,9 @@ ppp_disconnect_channel(struct channel *pch)*/ static void ppp_destroy_channel (struct channel *pch) { +put_net (pch->chan_net); + pch->chan_net =NULL ; +atomic_dec (&channel_count);if (!pch->file.dead) {
drivers/nvdimm/pfn.h +3 -1
@@ -33,7 +33,9 @@ struct nd_pfn_sb {/* minor-version-1 additions for section alignment */ __le32 start_pad;__le32 end_trunc; -u8 padding[4004 ]; +/* minor-version-2 record the base alignment of the mapping */ +__le32 align; +u8 padding[4000 ];__le64 checksum; };
drivers/nvdimm/pfn_devs.c +44 -9
93 lines not on this page · raw message
drivers/nvdimm/pmem.c +2 -2
@@ -426,9 +426,10 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)memcpy (pfn_sb->uuid, nd_pfn->uuid,16 );memcpy (pfn_sb->parent_uuid,nd_dev_to_uuid (&ndns->dev),16 ); pfn_sb->version_major =cpu_to_le16 (1 ); - pfn_sb->version_minor =cpu_to_le16 (1 ); + pfn_sb->version_minor =cpu_to_le16 (2 ); pfn_sb->start_pad =cpu_to_le32 (start_pad); pfn_sb->end_trunc =cpu_to_le32 (end_trunc); + pfn_sb->align =cpu_to_le32 (nd_pfn->align); checksum =nd_sb_checksum ((struct nd_gen_sb *) pfn_sb); pfn_sb->checksum =cpu_to_le64 (checksum);
@@ -501,7 +502,6 @@ static int __nvdimm_namespace_attach_pfn(struct nd_pfn *nd_pfn) pmem =dev_get_drvdata (dev); pmem->data_offset =le64_to_cpu (pfn_sb->dataoff); pmem->pfn_pad = start_pad + end_trunc; - nd_pfn->mode =le32_to_cpu (nd_pfn->pfn_sb->mode);if (nd_pfn->mode ==PFN_MODE_RAM ) {if (pmem->data_offset <SZ_8K )return -EINVAL ;
drivers/regulator/qcom_smd-regulator.c +0 -1
@@ -140,7 +140,6 @@ static const struct regulator_ops rpm_smps_ldo_ops = { .enable = rpm_reg_enable, .disable = rpm_reg_disable, .is_enabled = rpm_reg_is_enabled, - .list_voltage = regulator_list_voltage_linear_range, .get_voltage = rpm_reg_get_voltage, .set_voltage = rpm_reg_set_voltage,
drivers/staging/rdma/hfi1/ud.c +3 -20
@@ -678,8 +678,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)u32 tlen = packet->tlen;struct rvt_qp *qp = packet->qp;bool has_grh = rcv_flags &HFI1_HAS_GRH ; -bool sc4_bit =has_sc4_bit (packet); -u8 sc; +u8 sc5 =hdr2sc ((struct hfi1_message_header *)hdr, packet->rhf);u32 bth1;int is_mcast;struct ib_grh *grh =NULL ;
@@ -697,10 +696,8 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)*/ struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u32 lqpn =be32_to_cpu (ohdr->bth[1 ]) &RVT_QPN_MASK ; -u8 sl, sc5; +u8 sl; - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit; sl = ibp->sc_to_sl[sc5];process_becn (ppd, sl,0 , lqpn,0 ,IB_CC_SVCTYPE_UD );
@@ -717,10 +714,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)if (!is_mcast && (opcode !=IB_OPCODE_CNP ) && bth1 &HFI1_FECN_SMASK ) {u16 slid =be16_to_cpu (hdr->lrh[3 ]); -u8 sc5; - - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit;return_cnp (ibp, qp, src_qp, pkey, dlid, slid, sc5, grh); }
@@ -745,10 +738,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)if (qp->ibqp.qp_num >1 ) {struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u16 slid; -u8 sc5; - - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit; slid =be16_to_cpu (hdr->lrh[3 ]);if (unlikely (rcv_pkey_check (ppd, pkey, sc5, slid))) {
@@ -790,10 +779,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)/* Received on QP0, and so by definition, this is an SMP */ struct opa_smp *smp = (struct opa_smp *)data;u16 slid =be16_to_cpu (hdr->lrh[3 ]); -u8 sc5; - - sc5 = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc5 |= sc4_bit;if (opa_smp_check (ibp, pkey, sc5, qp, slid, smp)) goto drop;
@@ -890,9 +875,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) } wc.slid =be16_to_cpu (hdr->lrh[3 ]); - sc = (be16_to_cpu (hdr->lrh[0 ]) >>12 ) &0xf ; - sc |= sc4_bit; - wc.sl = ibp->sc_to_sl[sc]; + wc.sl = ibp->sc_to_sl[sc5];/* * Save the LMC lower bits if the destination LID is a unicast LID.
drivers/staging/rdma/hfi1/verbs_txreq.c +1 -3
@@ -92,11 +92,10 @@ void hfi1_put_txreq(struct verbs_txreq *tx)struct verbs_txreq *__get_txreq (struct hfi1_ibdev *dev,struct rvt_qp *qp) + __must_hold(&qp->s_lock) {struct verbs_txreq *tx =ERR_PTR (-EBUSY ); -unsigned long flags; -spin_lock_irqsave (&qp->s_lock, flags);write_seqlock (&dev->iowait_lock);if (ib_rvt_state_ops[qp->state] &RVT_PROCESS_RECV_OK ) {struct hfi1_qp_priv *priv;
@@ -116,7 +115,6 @@ struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev, } out:write_sequnlock (&dev->iowait_lock); -spin_unlock_irqrestore (&qp->s_lock, flags);return tx; }
drivers/staging/rdma/hfi1/verbs_txreq.h +1 -0
@@ -73,6 +73,7 @@ struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,static inline struct verbs_txreq *get_txreq (struct hfi1_ibdev *dev,struct rvt_qp *qp) + __must_hold(&qp->slock) {struct verbs_txreq *tx;struct hfi1_qp_priv *priv = qp->priv;
drivers/tty/serial/mvebu-uart.c +2 -0
@@ -299,6 +299,8 @@ static int mvebu_uart_startup(struct uart_port *port)static void mvebu_uart_shutdown (struct uart_port *port) {writel (0 , port->membase +UART_CTRL ); + +free_irq (port->irq, port); } static void mvebu_uart_set_termios(struct uart_port *port,
fs/dcache.c +5 -2
@@ -578,7 +578,6 @@ static struct dentry *dentry_kill(struct dentry *dentry) failed:spin_unlock (&dentry->d_lock); -cpu_relax ();return dentry;/* try again with same dentry */ }
@@ -752,6 +751,8 @@ void dput(struct dentry *dentry)return ; repeat: +might_sleep (); +rcu_read_lock ();if (likely (fast_dput (dentry))) {rcu_read_unlock ();
@@ -783,8 +784,10 @@ repeat: kill_it: dentry =dentry_kill (dentry); -if (dentry) +if (dentry) { +cond_resched (); goto repeat; + } }EXPORT_SYMBOL (dput);
fs/ext4/balloc.c +3 -0
@@ -208,6 +208,9 @@ static int ext4_init_block_bitmap(struct super_block *sb,memset (bh->b_data,0 , sb->s_blocksize); bit_max =ext4_num_base_meta_clusters (sb, block_group); +if ((bit_max >>3 ) >= bh->b_size) +return -EFSCORRUPTED ; +for (bit =0 ; bit < bit_max; bit++)ext4_set_bit (bit, bh->b_data);
fs/ext4/extents.c +6 -2
@@ -376,9 +376,13 @@ static int ext4_valid_extent(struct inode *inode, struct ext4_extent *ext)ext4_fsblk_t block =ext4_ext_pblock (ext);int len =ext4_ext_get_actual_len (ext);ext4_lblk_t lblock =le32_to_cpu (ext->ee_block); -ext4_lblk_t last = lblock + len -1 ; -if (len ==0 || lblock > last) +/* +* We allow neither: +* - zero length +* - overflow/wrap-around +*/ +if (lblock + len <= lblock)return 0 ;return ext4_data_block_valid (EXT4_SB (inode->i_sb), block, len); }
fs/ext4/inode.c +29 -6
@@ -205,9 +205,9 @@ void ext4_evict_inode(struct inode *inode)* Note that directories do not have this problem because they * don't use page cache. */ -if (ext4_should_journal_data (inode) && - (S_ISLNK (inode->i_mode) ||S_ISREG (inode->i_mode)) && - inode->i_ino !=EXT4_JOURNAL_INO ) { +if (inode->i_ino !=EXT4_JOURNAL_INO && +ext4_should_journal_data (inode) && + (S_ISLNK (inode->i_mode) ||S_ISREG (inode->i_mode))) {journal_t *journal =EXT4_SB (inode->i_sb)->s_journal;tid_t commit_tid =EXT4_I (inode)->i_datasync_tid;
@@ -2741,13 +2741,36 @@ retry: done = true; } } -ext4_journal_stop (handle); +/* +* Caution: If the handle is synchronous, +* ext4_journal_stop() can wait for transaction commit +* to finish which may depend on writeback of pages to +* complete or on page lock to be released. In that +* case, we have to wait until after after we have +* submitted all the IO, released page locks we hold, +* and dropped io_end reference (for extent conversion +* to be able to complete) before stopping the handle. +*/ +if (!ext4_handle_valid (handle) || handle->h_sync ==0 ) { +ext4_journal_stop (handle); + handle =NULL ; + }/* Submit prepared bio */ ext4_io_submit (&mpd.io_submit);/* Unlock pages we didn't use */ mpage_release_unused_pages (&mpd, give_up_on_write); -/* Drop our io_end reference we got from init */ -ext4_put_io_end (mpd.io_submit.io_end); +/* +* Drop our io_end reference we got from init. We have +* to be careful and use deferred io_end finishing if +* we are still holding the transaction as we can +* release the last reference to io_end which may end +* up doing unwritten extent conversion. +*/ +if (handle) { +ext4_put_io_end_defer (mpd.io_submit.io_end); +ext4_journal_stop (handle); + }else +ext4_put_io_end (mpd.io_submit.io_end);if (ret == -ENOSPC && sbi->s_journal) {/*
fs/ext4/mballoc.c +3 -14
@@ -2939,7 +2939,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,ext4_error (sb,"Allocating blocks %llu-%llu which overlap " "fs metadata" , block, block+len);/* File system mounted not to panic on error -* Fix the bitmap and repeat the block allocation +* Fix the bitmap and return EFSCORRUPTED * We leak some of the blocks here. */ ext4_lock_group (sb, ac->ac_b_ex.fe_group);
@@ -2948,7 +2948,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,ext4_unlock_group (sb, ac->ac_b_ex.fe_group); err =ext4_handle_dirty_metadata (handle,NULL , bitmap_bh);if (!err) - err = -EAGAIN ; + err = -EFSCORRUPTED ; goto out_err; }
@@ -4513,18 +4513,7 @@ repeat: }if (likely (ac->ac_status ==AC_STATUS_FOUND )) { *errp =ext4_mb_mark_diskspace_used (ac, handle, reserv_clstrs); -if (*errp == -EAGAIN ) { -/* -* drop the reference that we took -* in ext4_mb_use_best_found -*/ -ext4_mb_release_context (ac); - ac->ac_b_ex.fe_group =0 ; - ac->ac_b_ex.fe_start =0 ; - ac->ac_b_ex.fe_len =0 ; - ac->ac_status =AC_STATUS_CONTINUE ; - goto repeat; - }else if (*errp) { +if (*errp) {ext4_discard_allocated_blocks (ac); goto errout; }else {
fs/ext4/super.c +17 -0
@@ -2277,6 +2277,16 @@ static void ext4_orphan_cleanup(struct super_block *sb,while (es->s_last_orphan) {struct inode *inode; +/* +* We may have encountered an error during cleanup; if +* so, skip the rest. +*/ +if (EXT4_SB (sb)->s_mount_state &EXT4_ERROR_FS ) { +jbd_debug (1 ,"Skipping orphan recovery on fs with errors.\n" ); + es->s_last_orphan =0 ; +break ; + } + inode =ext4_orphan_get (sb,le32_to_cpu (es->s_last_orphan));if (IS_ERR (inode)) { es->s_last_orphan =0 ;
@@ -3415,6 +3425,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount; } +if (le16_to_cpu (sbi->s_es->s_reserved_gdt_blocks) > (blocksize /4 )) { +ext4_msg (sb,KERN_ERR , +"Number of reserved GDT blocks insanely large: %d" , +le16_to_cpu (sbi->s_es->s_reserved_gdt_blocks)); + goto failed_mount; + } +if (sbi->s_mount_opt &EXT4_MOUNT_DAX ) {if (blocksize !=PAGE_SIZE ) { ext4_msg(sb, KERN_ERR,
fs/fuse/file.c +24 -0
@@ -417,6 +417,15 @@ static int fuse_flush(struct file *file, fl_owner_t id)fuse_sync_writes (inode);inode_unlock (inode); +if (test_bit (AS_ENOSPC , &file->f_mapping->flags) && +test_and_clear_bit (AS_ENOSPC , &file->f_mapping->flags)) + err = -ENOSPC ; +if (test_bit (AS_EIO , &file->f_mapping->flags) && +test_and_clear_bit (AS_EIO , &file->f_mapping->flags)) + err = -EIO ; +if (err) +return err; + req =fuse_get_req_nofail_nopages (fc, file);memset (&inarg,0 ,sizeof (inarg)); inarg.fh = ff->fh;
@@ -462,6 +471,21 @@ int fuse_fsync_common(struct file *file, loff_t start, loff_t end, goto out;fuse_sync_writes (inode); + +/* +* Due to implementation of fuse writeback +* filemap_write_and_wait_range() does not catch errors. +* We have to do this directly after fuse_sync_writes() +*/ +if (test_bit (AS_ENOSPC , &file->f_mapping->flags) && +test_and_clear_bit (AS_ENOSPC , &file->f_mapping->flags)) + err = -ENOSPC ; +if (test_bit (AS_EIO , &file->f_mapping->flags) && +test_and_clear_bit (AS_EIO , &file->f_mapping->flags)) + err = -EIO ; +if (err) + goto out; + err =sync_inode_metadata (inode,1 );if (err) goto out;
fs/fuse/inode.c +1 -1
@@ -926,7 +926,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req) arg->flags |=FUSE_ASYNC_READ |FUSE_POSIX_LOCKS |FUSE_ATOMIC_O_TRUNC |FUSE_EXPORT_SUPPORT |FUSE_BIG_WRITES |FUSE_DONT_MASK |FUSE_SPLICE_WRITE |FUSE_SPLICE_MOVE |FUSE_SPLICE_READ | -FUSE_FLOCK_LOCKS |FUSE_IOCTL_DIR |FUSE_AUTO_INVAL_DATA | +FUSE_FLOCK_LOCKS |FUSE_HAS_IOCTL_DIR |FUSE_AUTO_INVAL_DATA |FUSE_DO_READDIRPLUS |FUSE_READDIRPLUS_AUTO |FUSE_ASYNC_DIO |FUSE_WRITEBACK_CACHE |FUSE_NO_OPEN_SUPPORT ; req->in.h.opcode =FUSE_INIT ;
fs/inode.c +1 -1
@@ -344,7 +344,7 @@ EXPORT_SYMBOL(inc_nlink);void address_space_init_once (struct address_space *mapping) {memset (mapping,0 ,sizeof (*mapping)); -INIT_RADIX_TREE (&mapping->page_tree,GFP_ATOMIC ); +INIT_RADIX_TREE (&mapping->page_tree,GFP_ATOMIC | __GFP_ACCOUNT);spin_lock_init (&mapping->tree_lock);init_rwsem (&mapping->i_mmap_rwsem);INIT_LIST_HEAD (&mapping->private_list);
fs/udf/super.c +43 -24
91 lines not on this page · raw message
include/linux/netdevice.h +7 -0
@@ -4156,6 +4156,13 @@ static inline void netif_keep_dst(struct net_device *dev) dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE |IFF_XMIT_DST_RELEASE_PERM ); } +/* return true if dev can't cope with mtu frames that need vlan tag insertion */ +static inline bool netif_reduces_vlan_mtu (struct net_device *dev) +{ +/* TODO: reserve and use an additional IFF bit, if we get more users */ +return dev->priv_flags &IFF_MACSEC ; +} +extern struct pernet_operations __net_initdata loopback_net_ops;/* Logging, debugging and troubleshooting/diagnostic helpers. */
ipc/msg.c +1 -1
@@ -680,7 +680,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,rcu_read_lock ();ipc_lock_object (&msq->q_perm); -ipc_rcu_putref (msq, ipc_rcu_free); +ipc_rcu_putref (msq, msg_rcu_free);/* raced with RMID? */ if (!ipc_valid_object (&msq->q_perm)) { err = -EIDRM ;
ipc/sem.c +6 -6
@@ -449,7 +449,7 @@ static inline struct sem_array *sem_obtain_object_check(struct ipc_namespace *nsstatic inline void sem_lock_and_putref (struct sem_array *sma) {sem_lock (sma,NULL ,-1 ); -ipc_rcu_putref (sma, ipc_rcu_free); +ipc_rcu_putref (sma, sem_rcu_free); }static inline void sem_rmid (struct ipc_namespace *ns,struct sem_array *s)
@@ -1392,7 +1392,7 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,rcu_read_unlock (); sem_io =ipc_alloc (sizeof (ushort)*nsems);if (sem_io ==NULL ) { -ipc_rcu_putref (sma, ipc_rcu_free); +ipc_rcu_putref (sma, sem_rcu_free);return -ENOMEM ; }
@@ -1426,20 +1426,20 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,if (nsems >SEMMSL_FAST ) { sem_io =ipc_alloc (sizeof (ushort)*nsems);if (sem_io ==NULL ) { -ipc_rcu_putref (sma, ipc_rcu_free); +ipc_rcu_putref (sma, sem_rcu_free);return -ENOMEM ; } }if (copy_from_user (sem_io, p, nsems*sizeof (ushort))) { -ipc_rcu_putref (sma, ipc_rcu_free); +ipc_rcu_putref (sma, sem_rcu_free); err = -EFAULT ; goto out_free; }for (i =0 ; i < nsems; i++) {if (sem_io[i] >SEMVMX ) { -ipc_rcu_putref (sma, ipc_rcu_free); +ipc_rcu_putref (sma, sem_rcu_free); err = -ERANGE ; goto out_free; }
@@ -1731,7 +1731,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid)/* step 2: allocate new undo structure */ new =kzalloc (sizeof (struct sem_undo ) +sizeof (short )*nsems,GFP_KERNEL );if (!new) { -ipc_rcu_putref (sma, ipc_rcu_free); +ipc_rcu_putref (sma, sem_rcu_free);return ERR_PTR (-ENOMEM ); }
lib/radix-tree.c +10 -4
@@ -228,10 +228,11 @@ radix_tree_node_alloc(struct radix_tree_root *root)/* * Even if the caller has preloaded, try to allocate from the -* cache first for the new node to get accounted. +* cache first for the new node to get accounted to the memory +* cgroup. */ ret =kmem_cache_alloc (radix_tree_node_cachep, - gfp_mask | __GFP_ACCOUNT | __GFP_NOWARN); + gfp_mask | __GFP_NOWARN);if (ret) goto out;
@@ -254,8 +255,7 @@ radix_tree_node_alloc(struct radix_tree_root *root)kmemleak_update_trace (ret); goto out; } - ret =kmem_cache_alloc (radix_tree_node_cachep, - gfp_mask | __GFP_ACCOUNT); + ret =kmem_cache_alloc (radix_tree_node_cachep, gfp_mask); out:BUG_ON (radix_tree_is_indirect_ptr (ret));return ret;
@@ -302,6 +302,12 @@ static int __radix_tree_preload(gfp_t gfp_mask)struct radix_tree_node *node;int ret = -ENOMEM ; +/* +* Nodes preloaded by one cgroup can be be used by another cgroup, so +* they should never be accounted to any particular memory cgroup. +*/ + gfp_mask &= ~__GFP_ACCOUNT; +preempt_disable (); rtp =this_cpu_ptr (&radix_tree_preloads);while (rtp->nr <RADIX_TREE_PRELOAD_SIZE ) {
mm/memcontrol.c +56 -12
125 lines not on this page · raw message
mm/mempool.c +3 -15
@@ -310,7 +310,7 @@ EXPORT_SYMBOL(mempool_resize);* returns NULL. Note that due to preallocation, this function * *never* fails when called from process contexts. (it might * fail if called from an IRQ context.) -* Note: neither __GFP_NOMEMALLOC nor __GFP_ZERO are supported. +* Note: using __GFP_ZERO is not supported. */ void *mempool_alloc (mempool_t *pool,gfp_t gfp_mask) {
@@ -319,27 +319,16 @@ void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask)wait_queue_t wait;gfp_t gfp_temp; -/* If oom killed, memory reserves are essential to prevent livelock */ -VM_WARN_ON_ONCE (gfp_mask & __GFP_NOMEMALLOC); -/* No element size to zero on allocation */ VM_WARN_ON_ONCE (gfp_mask & __GFP_ZERO); -might_sleep_if (gfp_mask & __GFP_DIRECT_RECLAIM); + gfp_mask |= __GFP_NOMEMALLOC;/* don't allocate emergency reserves */ gfp_mask |= __GFP_NORETRY;/* don't loop in __alloc_pages */ gfp_mask |= __GFP_NOWARN;/* failures are OK */ gfp_temp = gfp_mask & ~(__GFP_DIRECT_RECLAIM|__GFP_IO); repeat_alloc: -if (likely (pool->curr_nr)) { -/* -* Don't allocate from emergency reserves if there are -* elements available. This check is racy, but it will -* be rechecked each loop. -*/ - gfp_temp |= __GFP_NOMEMALLOC; - } element = pool->alloc (gfp_temp, pool->pool_data);if (likely (element !=NULL ))
@@ -363,12 +352,11 @@ repeat_alloc:* We use gfp mask w/o direct reclaim or IO for the first round. If * alloc failed with that and @pool was empty, retry immediately. */ -if ((gfp_temp & ~__GFP_NOMEMALLOC) != gfp_mask) { +if (gfp_temp != gfp_mask) {spin_unlock_irqrestore (&pool->lock, flags); gfp_temp = gfp_mask; goto repeat_alloc; } - gfp_temp = gfp_mask;/* We must not sleep if !__GFP_DIRECT_RECLAIM */ if (!(gfp_mask & __GFP_DIRECT_RECLAIM)) {
net/8021q/vlan_dev.c +6 -4
@@ -146,10 +146,12 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,static int vlan_dev_change_mtu (struct net_device *dev,int new_mtu) { -/* TODO: gotta make sure the underlying layer can handle it, -* maybe an IFF_VLAN_CAPABLE flag for devices? -*/ -if (vlan_dev_priv (dev)->real_dev->mtu < new_mtu) +struct net_device *real_dev =vlan_dev_priv (dev)->real_dev; +unsigned int max_mtu = real_dev->mtu; + +if (netif_reduces_vlan_mtu (real_dev)) + max_mtu -=VLAN_HLEN ; +if (max_mtu < new_mtu)return -ERANGE ; dev->mtu = new_mtu;
net/8021q/vlan_netlink.c +5 -2
@@ -118,6 +118,7 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev, {struct vlan_dev_priv *vlan =vlan_dev_priv (dev);struct net_device *real_dev; +unsigned int max_mtu;__be16 proto;int err;
@@ -144,9 +145,11 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev,if (err <0 )return err; + max_mtu =netif_reduces_vlan_mtu (real_dev) ? real_dev->mtu -VLAN_HLEN : + real_dev->mtu;if (!tb[IFLA_MTU ]) - dev->mtu = real_dev->mtu; -else if (dev->mtu > real_dev->mtu) + dev->mtu = max_mtu; +else if (dev->mtu > max_mtu)return -EINVAL ; err =vlan_changelink (dev, tb, data);
net/bridge/br_input.c +18 -0
@@ -213,6 +213,16 @@ drop: }EXPORT_SYMBOL_GPL (br_handle_frame_finish); +static void __br_handle_local_finish (struct sk_buff *skb) +{ +struct net_bridge_port *p =br_port_get_rcu (skb->dev); +u16 vid =0 ; + +/* check if vlan is allowed, to avoid spoofing */ +if (p->flags &BR_LEARNING &&br_should_learn (p, skb, &vid)) +br_fdb_update (p->br, p,eth_hdr (skb)->h_source, vid, false); +} +/* note: already called with rcu_read_lock */ static int br_handle_local_finish (struct net *net,struct sock *sk,struct sk_buff *skb) {
@@ -279,6 +289,14 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)case 0x01 :/* IEEE MAC (Pause) */ goto drop; +case 0x0E :/* 802.1AB LLDP */ + fwd_mask |= p->br->group_fwd_mask; +if (fwd_mask & (1u << dest[5 ])) + goto forward; + *pskb = skb; +__br_handle_local_finish (skb); +return RX_HANDLER_PASS ; +default :/* Allow selective forwarding for most other protocols */ fwd_mask |= p->br->group_fwd_mask;
net/ipv4/tcp_input.c +32 -22
87 lines not on this page · raw message
net/ipv4/tcp_output.c +2 -1
@@ -236,7 +236,8 @@ void tcp_select_initial_window(int __space, __u32 mss,/* Set window scaling on max possible window * See RFC1323 for an explanation of the limit to 14 */ - space =max_t (u32, sysctl_tcp_rmem[2 ], sysctl_rmem_max); + space =max_t (u32, space, sysctl_tcp_rmem[2 ]); + space =max_t (u32, space, sysctl_rmem_max); space =min_t (u32, space, *window_clamp);while (space >65535 && (*rcv_wscale) <14 ) { space >>=1 ;
net/ipv6/addrconf.c +4 -0
@@ -3563,6 +3563,10 @@ restart:if (state !=INET6_IFADDR_STATE_DEAD ) {__ipv6_ifa_notify (RTM_DELADDR , ifa);inet6addr_notifier_call_chain (NETDEV_DOWN , ifa); + }else { +if (idev->cnf.forwarding) +addrconf_leave_anycast (ifa); +addrconf_leave_solict (ifa->idev, &ifa->addr); }write_lock_bh (&idev->lock);
net/irda/af_irda.c +5 -2
@@ -1024,8 +1024,11 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr, }/* Check if we have opened a local TSAP */ -if (!self->tsap) -irda_open_tsap (self,LSAP_ANY , addr->sir_name); +if (!self->tsap) { + err =irda_open_tsap (self,LSAP_ANY , addr->sir_name); +if (err) + goto out; + }/* Move to connecting socket, start sending Connect Requests */ sock->state =SS_CONNECTING ;
security/apparmor/apparmorfs.c +1 -0
@@ -331,6 +331,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)seq_printf (seq,"%.2x" , profile->hash[i]);seq_puts (seq,"\n" ); } +aa_put_profile (profile);return 0 ; }