Linux 3.4.102
Greg KH
maintainerI'm announcing the release of the 3.4.102 kernel.
All users of the 3.4 kernel series must upgrade.
The updated 3.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.4.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/x86/x86_64/mm.txt | 2 Makefile | 2 arch/arm/mm/idmap.c | 7 + arch/x86/Kconfig | 25 +++ arch/x86/include/asm/espfix.h | 16 ++ arch/x86/include/asm/irqflags.h | 2 arch/x86/include/asm/pgtable_64_types.h | 2 arch/x86/include/asm/setup.h | 2 arch/x86/kernel/Makefile | 1 arch/x86/kernel/entry_32.S | 12 + arch/x86/kernel/entry_64.S | 80 ++++++++++-- arch/x86/kernel/espfix_64.c | 208 ++++++++++++++++++++++++++++++++ arch/x86/kernel/ldt.c | 10 - arch/x86/kernel/paravirt_patch_64.c | 2 arch/x86/kernel/smpboot.c | 7 + arch/x86/mm/dump_pagetables.c | 39 ++++-- arch/x86/vdso/vdso32-setup.c | 8 - crypto/af_alg.c | 2 drivers/scsi/scsi_lib.c | 8 + include/linux/printk.h | 6 include/linux/skbuff.h | 17 -- init/main.c | 4 kernel/printk.c | 2 kernel/sched/core.c | 2 kernel/sched/rt.c | 2 kernel/time/clockevents.c | 10 - lib/btree.c | 1 mm/mlock.c | 2 mm/page_alloc.c | 16 +- mm/rmap.c | 14 +- net/ipv4/ip_forward.c | 68 ---------- net/ipv6/addrconf.c | 14 +- net/ipv6/ip6_output.c | 13 -- net/l2tp/l2tp_ppp.c | 4 34 files changed, 446 insertions(+), 164 deletions(-)
Andy Lutomirski (1):
x86_64/entry/xen: Do not invoke espfix64 on Xen
Boris Ostrovsky (1):
x86/espfix/xen: Fix allocation of pages for paravirt page tables
David Rientjes (1):
mm, thp: do not allow thp faults to avoid cpuset restrictions
Gao feng (1):
ipv6: reallocate addrconf router for ipv6 address when lo device up
Greg Kroah-Hartman (2):
Revert: "net: ip, ipv6: handle gso skbs in forwarding path" Linux 3.4.102
H. Peter Anvin (6):
Revert "x86-64, modify_ldt: Make support for 16-bit segments a runtime option" x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack x86, espfix: Move espfix definitions into a separate header file x86, espfix: Fix broken header guard
x86, espfix: Make espfix64 a Kconfig option, fix UML
x86, espfix: Make it possible to disable 16-bit support
James Bottomley (1):
scsi: handle flush errors properly
Jan Kara (1):
timer: Fix lock inversion between hrtimer_bases.lock and scheduler locks
John Stultz (1):
printk: rename printk_sched to printk_deferred
Konstantin Khlebnikov (1):
ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout
Milan Broz (1):
crypto: af_alg - properly label AF_ALG socket
Minfei Huang (1):
lib/btree.c: fix leak of whole btree nodes
Sasha Levin (1):
net/l2tp: don't fall back on UDP [get|set]sockopt
Vlastimil Babka (1):
mm: try_to_unmap_cluster() should lock_page() before mlocking
Greg KH
maintainerDocumentation/x86/x86_64/mm.txt +2 -0
@@ -12,6 +12,8 @@ ffffc90000000000 - ffffe8ffffffffff (=45 bits) vmalloc/ioremap space ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB) ... unused hole ... +ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks +... unused hole ... ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0 ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 4 -SUBLEVEL = 101 +SUBLEVEL = 102 EXTRAVERSION = NAME = Saber-toothed Squirrel
arch/arm/mm/idmap.c +7 -0
@@ -22,6 +22,13 @@ static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,pr_warning ("Failed to allocate identity pmd.\n" );return ; } +/* +* Copy the original PMD to ensure that the PMD entries for +* the kernel image are preserved. +*/ +if (!pud_none (*pud)) +memcpy (pmd,pmd_offset (pud,0 ), +PTRS_PER_PMD *sizeof (pmd_t));pud_populate (&init_mm, pud, pmd); pmd +=pmd_index (addr); }else
arch/x86/Kconfig +21 -4
@@ -915,10 +915,27 @@ config VM86 default y depends on X86_32 ---help--- - This option is required by programs like DOSEMU to run 16-bit legacy - code on X86 processors. It also may be needed by software like - XFree86 to initialize some video cards via BIOS. Disabling this - option saves about 6k. + This option is required by programs like DOSEMU to run + 16-bit real mode legacy code on x86 processors. It also may + be needed by software like XFree86 to initialize some video + cards via BIOS. Disabling this option saves about 6K. + +config X86_16BIT + bool "Enable support for 16-bit segments" if EXPERT + default y + ---help--- + This option is required by programs like Wine to run 16-bit + protected mode legacy code on x86 processors. Disabling + this option saves about 300 bytes on i386, or around 6K text + plus 16K runtime memory on x86-64, + +config X86_ESPFIX32 + def_bool y + depends on X86_16BIT && X86_32 + +config X86_ESPFIX64 + def_bool y + depends on X86_16BIT && X86_64 config TOSHIBA tristate "Toshiba Laptop support"
arch/x86/include/asm/espfix.h new file +16 -0
@@ -0,0 +1,16 @@ +#ifndef _ASM_X86_ESPFIX_H +#define _ASM_X86_ESPFIX_H + +#ifdef CONFIG_X86_64 + +#include <asm/percpu.h> + +DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack); +DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr); + +extern void init_espfix_bsp (void ); +extern void init_espfix_ap (void ); + +#endif /* CONFIG_X86_64 */ + +#endif /* _ASM_X86_ESPFIX_H */
arch/x86/include/asm/irqflags.h +1 -1
@@ -129,7 +129,7 @@ static inline notrace unsigned long arch_local_irq_save(void)#define PARAVIRT_ADJUST_EXCEPTION_FRAME /* */ -#define INTERRUPT_RETURN iretq +#define INTERRUPT_RETURN jmp native_iret#define USERGS_SYSRET64 \ swapgs; \ sysretq;
arch/x86/include/asm/pgtable_64_types.h +2 -0
@@ -59,5 +59,7 @@ typedef struct { pteval_t pte; } pte_t;#define MODULES_VADDR _AC(0xffffffffa0000000, UL)#define MODULES_END _AC(0xffffffffff000000, UL)#define MODULES_LEN (MODULES_END - MODULES_VADDR) +#define ESPFIX_PGD_ENTRY _AC(-2, UL) +#define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)#endif /* _ASM_X86_PGTABLE_64_DEFS_H */
arch/x86/include/asm/setup.h +2 -0
@@ -61,6 +61,8 @@ static inline void x86_ce4100_early_setup(void) { }#ifndef _SETUP +#include <asm/espfix.h> +/* * This is set up by the setup-routine at boot-time */
arch/x86/kernel/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o obj-y += syscall_$(BITS).o obj-$(CONFIG_X86_64) += vsyscall_64.o obj-$(CONFIG_X86_64) += vsyscall_emu_64.o +obj-$(CONFIG_X86_ESPFIX64) += espfix_64.o obj-y += bootflag.o e820.o obj-y += pci-dma.o quirks.o topology.o kdebugfs.o obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o
arch/x86/kernel/entry_32.S +12 -0
@@ -525,6 +525,7 @@ syscall_exit: restore_all: TRACE_IRQS_IRET restore_all_notrace: +#ifdef CONFIG_X86_ESPFIX32 movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS # Warning: PT_OLDSS(%esp) contains the wrong/random values if we # are returning to the kernel.
@@ -535,6 +536,7 @@ restore_all_notrace: cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax CFI_REMEMBER_STATE je ldt_ss # returning to user-space with LDT SS +#endif restore_nocheck: RESTORE_REGS 4 # skip orig_eax/error_code irq_return:
@@ -550,6 +552,7 @@ ENTRY(iret_exc) .long irq_return,iret_exc .previous +#ifdef CONFIG_X86_ESPFIX32 CFI_RESTORE_STATE ldt_ss: #ifdef CONFIG_PARAVIRT
@@ -593,6 +596,7 @@ ldt_ss: lss (%esp), %esp /* switch to espfix segment */ CFI_ADJUST_CFA_OFFSET -8 jmp restore_nocheck +#endif CFI_ENDPROC ENDPROC(system_call)
@@ -766,6 +770,7 @@ ENDPROC(ptregs_clone) * the high word of the segment base from the GDT and swiches to the * normal stack and adjusts ESP with the matching offset. */ +#ifdef CONFIG_X86_ESPFIX32 /* fixup the stack */ mov GDT_ESPFIX_SS + 4, %al /* bits 16..23 */ mov GDT_ESPFIX_SS + 7, %ah /* bits 24..31 */
@@ -775,8 +780,10 @@ ENDPROC(ptregs_clone) pushl_cfi %eax lss (%esp), %esp /* switch to the normal stack segment */ CFI_ADJUST_CFA_OFFSET -8 +#endif .endm .macro UNWIND_ESPFIX_STACK +#ifdef CONFIG_X86_ESPFIX32 movl %ss, %eax /* see if on espfix stack */ cmpw $__ESPFIX_SS, %ax
@@ -787,6 +794,7 @@ ENDPROC(ptregs_clone) /* switch to normal stack */ FIXUP_ESPFIX_STACK 27: +#endif .endm /*
@@ -1318,11 +1326,13 @@ END(debug) */ ENTRY(nmi) RING0_INT_FRAME +#ifdef CONFIG_X86_ESPFIX32 pushl_cfi %eax movl %ss, %eax cmpw $__ESPFIX_SS, %ax popl_cfi %eax je nmi_espfix_stack +#endif cmpl $ia32_sysenter_target,(%esp) je nmi_stack_fixup pushl_cfi %eax
@@ -1362,6 +1372,7 @@ nmi_debug_stack_check: FIX_STACK 24, nmi_stack_correct, 1 jmp nmi_stack_correct +#ifdef CONFIG_X86_ESPFIX32 nmi_espfix_stack: /* We have a RING0_INT_FRAME here. *
@@ -1383,6 +1394,7 @@ nmi_espfix_stack: lss 12+4(%esp), %esp # back to espfix stack CFI_ADJUST_CFA_OFFSET -24 jmp irq_return +#endif CFI_ENDPROC END(nmi)
arch/x86/kernel/entry_64.S +71 -9
117 lines not on this page · raw message
arch/x86/kernel/espfix_64.c new file +208 -0
208 lines not on this page · raw message
arch/x86/kernel/ldt.c +1 -9
@@ -20,8 +20,6 @@#include <asm/mmu_context.h> #include <asm/syscalls.h> -int sysctl_ldt16 =0 ; -#ifdef CONFIG_SMP static void flush_ldt (void *current_mm) {
@@ -231,16 +229,10 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) } } -/* -* On x86-64 we do not support 16-bit segments due to -* IRET leaking the high bits of the kernel stack address. -*/ -#ifdef CONFIG_X86_64 -if (!ldt_info.seg_32bit && !sysctl_ldt16) { +if (!IS_ENABLED (CONFIG_X86_16BIT ) && !ldt_info.seg_32bit) { error = -EINVAL ; goto out_unlock; } -#endif fill_ldt (&ldt, &ldt_info);if (oldmode)
arch/x86/kernel/paravirt_patch_64.c +0 -2
@@ -6,7 +6,6 @@ DEF_NATIVE(pv_irq_ops, irq_disable, "cli");DEF_NATIVE (pv_irq_ops, irq_enable,"sti" );DEF_NATIVE (pv_irq_ops, restore_fl,"pushq %rdi; popfq" );DEF_NATIVE (pv_irq_ops, save_fl,"pushfq; popq %rax" ); -DEF_NATIVE (pv_cpu_ops, iret,"iretq" );DEF_NATIVE (pv_mmu_ops, read_cr2,"movq %cr2, %rax" );DEF_NATIVE (pv_mmu_ops, read_cr3,"movq %cr3, %rax" );DEF_NATIVE (pv_mmu_ops, write_cr3,"movq %rdi, %cr3" );
@@ -50,7 +49,6 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,PATCH_SITE (pv_irq_ops, save_fl);PATCH_SITE (pv_irq_ops, irq_enable);PATCH_SITE (pv_irq_ops, irq_disable); -PATCH_SITE (pv_cpu_ops, iret);PATCH_SITE (pv_cpu_ops, irq_enable_sysexit);PATCH_SITE (pv_cpu_ops, usergs_sysret32);PATCH_SITE (pv_cpu_ops, usergs_sysret64);
arch/x86/kernel/smpboot.c +7 -0
@@ -271,6 +271,13 @@ notrace static void __cpuinit start_secondary(void *unused)check_tsc_sync_target ();/* +* Enable the espfix hack for this CPU +*/ +#ifdef CONFIG_X86_ESPFIX64 +init_espfix_ap (); +#endif + +/* * We need to hold call_lock, so there is no inconsistency * between the time smp_call_function() determines number of * IPI recipients, and the time when the determination is made
arch/x86/mm/dump_pagetables.c +28 -11
@@ -30,11 +30,13 @@ struct pg_state {unsigned long start_address;unsigned long current_address;const struct addr_marker *marker; +unsigned long lines; };struct addr_marker {unsigned long start_address;const char *name; +unsigned long max_lines; };/* indices for address_markers; keep sync'd w/ address_markers below */
@@ -45,6 +47,7 @@ enum address_markers_idx {LOW_KERNEL_NR ,VMALLOC_START_NR ,VMEMMAP_START_NR , +ESPFIX_START_NR ,HIGH_KERNEL_NR ,MODULES_VADDR_NR , MODULES_END_NR,
@@ -67,6 +70,7 @@ static struct addr_marker address_markers[] = { { PAGE_OFFSET, "Low Kernel Mapping" }, { VMALLOC_START, "vmalloc() Area" }, { VMEMMAP_START, "Vmemmap" }, + { ESPFIX_BASE_ADDR, "ESPfix Area", 16 }, { __START_KERNEL_map, "High Kernel Mapping" }, { MODULES_VADDR, "Modules" }, { MODULES_END, "End Modules" },
@@ -163,7 +167,7 @@ static void note_page(struct seq_file *m, struct pg_state *st, pgprot_t new_prot, int level) {pgprotval_t prot, cur; -static const char units[] ="KMGTPE" ; +static const char units[] ="BKMGTPE" ;/* * If we have a "break" in the series, we need to flush the state that
@@ -178,6 +182,7 @@ static void note_page(struct seq_file *m, struct pg_state *st, st->current_prot = new_prot; st->level = level; st->marker = address_markers; + st->lines =0 ;seq_printf (m,"---[ %s ]---\n" , st->marker->name); }else if (prot != cur || level != st->level || st->current_address >= st->marker[1 ].start_address) {
@@ -188,17 +193,21 @@ static void note_page(struct seq_file *m, struct pg_state *st,/* * Now print the actual finished series */ -seq_printf (m,"0x%0*lx-0x%0*lx " , - width, st->start_address, - width, st->current_address); - - delta = (st->current_address - st->start_address) >>10 ; -while (!(delta &1023 ) && unit[1 ]) { - delta >>=10 ; - unit++; +if (!st->marker->max_lines || + st->lines < st->marker->max_lines) { +seq_printf (m,"0x%0*lx-0x%0*lx " , + width, st->start_address, + width, st->current_address); + + delta = (st->current_address - st->start_address); +while (!(delta &1023 ) && unit[1 ]) { + delta >>=10 ; + unit++; + } +seq_printf (m,"%9lu%c " , delta, *unit); +printk_prot (m, st->current_prot, st->level); } -seq_printf (m,"%9lu%c " , delta, *unit); -printk_prot (m, st->current_prot, st->level); + st->lines++;/* * We print markers for special areas of address space,
@@ -206,7 +215,15 @@ static void note_page(struct seq_file *m, struct pg_state *st,* This helps in the interpretation. */ if (st->current_address >= st->marker[1 ].start_address) { +if (st->marker->max_lines && + st->lines > st->marker->max_lines) { +unsigned long nskip = + st->lines - st->marker->max_lines; +seq_printf (m,"... %lu entr%s skipped ... \n" , + nskip, nskip ==1 ?"y" :"ies" ); + } st->marker++; + st->lines =0 ;seq_printf (m,"---[ %s ]---\n" , st->marker->name); }
arch/x86/vdso/vdso32-setup.c +0 -8
@@ -41,7 +41,6 @@ enum {#ifdef CONFIG_X86_64 #define vdso_enabled sysctl_vsyscall32#define arch_setup_additional_pages syscall32_setup_pages -extern int sysctl_ldt16;#endif /*
@@ -381,13 +380,6 @@ static ctl_table abi_table2[] = { .mode = 0644, .proc_handler = proc_dointvec }, - { - .procname = "ldt16", - .data = &sysctl_ldt16, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec - }, {} };
crypto/af_alg.c +2 -0
@@ -21,6 +21,7 @@#include <linux/module.h> #include <linux/net.h> #include <linux/rwsem.h> +#include <linux/security.h> struct alg_type_list {const struct af_alg_type *type;
@@ -243,6 +244,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)sock_init_data (newsock, sk2);sock_graft (sk2, newsock); +security_sk_clone (sk, sk2); err = type->accept (ask->private, sk2);if (err) {
drivers/scsi/scsi_lib.c +8 -0
@@ -795,6 +795,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)scsi_next_command (cmd);return ; } + }else if (blk_rq_bytes (req) ==0 && result && !sense_deferred) { +/* +* Certain non BLOCK_PC requests are commands that don't +* actually transfer anything (FLUSH), so cannot use +* good_bytes != blk_rq_bytes(req) as the signal for an error. +* This sets the error explicitly for the problem case. +*/ + error =__scsi_error_from_host_byte (cmd, result); }/* no bidi support for !REQ_TYPE_BLOCK_PC yet */
include/linux/printk.h +3 -3
@@ -101,9 +101,9 @@ asmlinkage __printf(1, 2) __coldint printk (const char *fmt, ...);/* -* Special printk facility for scheduler use only, _DO_NOT_USE_ ! +* Special printk facility for scheduler/timekeeping use only, _DO_NOT_USE_ ! */ -__printf(1, 2) __cold int printk_sched(const char *fmt, ...); +__printf(1, 2) __cold int printk_deferred(const char *fmt, ...);/* * Please don't use printk_ratelimit(), because it shares ratelimiting state
@@ -133,7 +133,7 @@ int printk(const char *s, ...)return 0 ; } static inline __printf(1, 2) __cold -int printk_sched(const char *s, ...) +int printk_deferred(const char *s, ...) {return 0 ; }
include/linux/skbuff.h +0 -17
@@ -2608,22 +2608,5 @@ static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)return true; } - -/** -* skb_gso_network_seglen - Return length of individual segments of a gso packet -* -* @skb: GSO skb -* -* skb_gso_network_seglen is used to determine the real size of the -* individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). -* -* The MAC/L2 header is not accounted for. -*/ -static inline unsigned int skb_gso_network_seglen (const struct sk_buff *skb) -{ -unsigned int hdr_len =skb_transport_header (skb) - -skb_network_header (skb); -return hdr_len +skb_gso_transport_seglen (skb); -}#endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */
init/main.c +4 -0
@@ -606,6 +606,10 @@ asmlinkage void __init start_kernel(void)if (efi_enabled (EFI_RUNTIME_SERVICES ))efi_enter_virtual_mode ();#endif +#ifdef CONFIG_X86_ESPFIX64 +/* Should be run before the first non-init thread is created */ +init_espfix_bsp (); +#endif thread_info_cache_init ();cred_init ();fork_init (totalram_pages);
kernel/printk.c +1 -1
@@ -1653,7 +1653,7 @@ late_initcall(printk_late_init);#if definedCONFIG_PRINTK -int printk_sched (const char *fmt, ...) +int printk_deferred (const char *fmt, ...) {unsigned long flags;va_list args;
kernel/sched/core.c +1 -1
@@ -1313,7 +1313,7 @@ out:* leave kernel. */ if (p->mm &&printk_ratelimit ()) { -printk_sched ("process %d (%s) no longer affine to cpu%d\n" , +printk_deferred ("process %d (%s) no longer affine to cpu%d\n" ,task_pid_nr (p), p->comm, cpu); } }
kernel/sched/rt.c +1 -1
@@ -884,7 +884,7 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)if (!once) { once = true; -printk_sched ("sched: RT throttling activated\n" ); +printk_deferred ("sched: RT throttling activated\n" ); } }else {/*
kernel/time/clockevents.c +6 -4
@@ -143,7 +143,8 @@ static int clockevents_increase_min_delta(struct clock_event_device *dev) {/* Nothing to do if we already reached the limit */ if (dev->min_delta_ns >=MIN_DELTA_LIMIT ) { -printk (KERN_WARNING "CE: Reprogramming failure. Giving up\n" ); +printk_deferred (KERN_WARNING +"CE: Reprogramming failure. Giving up\n" ); dev->next_event.tv64 =KTIME_MAX ;return -ETIME ; }
@@ -156,9 +157,10 @@ static int clockevents_increase_min_delta(struct clock_event_device *dev)if (dev->min_delta_ns >MIN_DELTA_LIMIT ) dev->min_delta_ns =MIN_DELTA_LIMIT ; -printk (KERN_WARNING "CE: %s increased min_delta_ns to %llu nsec\n" , - dev->name ? dev->name :"?" , - (unsigned long long ) dev->min_delta_ns); +printk_deferred (KERN_WARNING +"CE: %s increased min_delta_ns to %llu nsec\n" , + dev->name ? dev->name :"?" , + (unsigned long long ) dev->min_delta_ns);return 0 ; }
lib/btree.c +1 -0
@@ -198,6 +198,7 @@ EXPORT_SYMBOL_GPL(btree_init);void btree_destroy (struct btree_head *head) { +mempool_free (head->node, head->mempool);mempool_destroy (head->mempool); head->mempool =NULL ; }
mm/mlock.c +2 -0
@@ -78,6 +78,7 @@ void __clear_page_mlock(struct page *page)*/ void mlock_vma_page (struct page *page) { +/* Serialize with page migration */ BUG_ON (!PageLocked (page));if (!TestSetPageMlocked (page)) {
@@ -105,6 +106,7 @@ void mlock_vma_page(struct page *page)*/ void munlock_vma_page (struct page *page) { +/* For try_to_munlock() and to serialize with page migration */ BUG_ON (!PageLocked (page));if (TestClearPageMlocked (page)) {
mm/page_alloc.c +8 -8
@@ -2187,7 +2187,7 @@ static inline int gfp_to_alloc_flags(gfp_t gfp_mask) {int alloc_flags =ALLOC_WMARK_MIN |ALLOC_CPUSET ; -const gfp_t wait = gfp_mask & __GFP_WAIT; +const bool atomic = !(gfp_mask & (__GFP_WAIT | __GFP_NO_KSWAPD));/* __GFP_HIGH is assumed to be the same as ALLOC_HIGH to save a branch. */ BUILD_BUG_ON (__GFP_HIGH != (__force gfp_t )ALLOC_HIGH );
@@ -2196,20 +2196,20 @@ gfp_to_alloc_flags(gfp_t gfp_mask)* The caller may dip into page reserves a bit more if the caller * cannot run direct reclaim, or if the caller has realtime scheduling * policy or is asking for __GFP_HIGH memory. GFP_ATOMIC requests will -* set both ALLOC_HARDER (!wait) and ALLOC_HIGH (__GFP_HIGH). +* set both ALLOC_HARDER (atomic == true) and ALLOC_HIGH (__GFP_HIGH). */ alloc_flags |= (__force int ) (gfp_mask & __GFP_HIGH); -if (!wait) { +if (atomic) {/* -* Not worth trying to allocate harder for -* __GFP_NOMEMALLOC even if it can't schedule. +* Not worth trying to allocate harder for __GFP_NOMEMALLOC even +* if it can't schedule. */ -if (!(gfp_mask & __GFP_NOMEMALLOC)) +if (!(gfp_mask & __GFP_NOMEMALLOC)) alloc_flags |=ALLOC_HARDER ;/* -* Ignore cpuset if GFP_ATOMIC (!wait) rather than fail alloc. -* See also cpuset_zone_allowed() comment in kernel/cpuset.c. +* Ignore cpuset mems for GFP_ATOMIC rather than fail, see the +* comment for __cpuset_node_allowed_softwall(). */ alloc_flags &= ~ALLOC_CPUSET ; }else if (unlikely (rt_task (current)) && !in_interrupt ())
mm/rmap.c +12 -2
@@ -1449,9 +1449,19 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount,BUG_ON (!page ||PageAnon (page));if (locked_vma) { -mlock_vma_page (page);/* no-op if already mlocked */ -if (page == check_page) +if (page == check_page) { +/* we know we have check_page locked */ +mlock_vma_page (page); ret =SWAP_MLOCK ; + }else if (trylock_page (page)) { +/* +* If we can lock the page, perform mlock. +* Otherwise leave the page alone, it will be +* eventually encountered again later. +*/ +mlock_vma_page (page); +unlock_page (page); + }continue ;/* don't unmap */ }
net/ipv4/ip_forward.c +2 -66
86 lines not on this page · raw message
net/ipv6/addrconf.c +12 -2
@@ -2438,8 +2438,18 @@ static void init_loopback(struct net_device *dev)if (sp_ifa->flags & (IFA_F_DADFAILED |IFA_F_TENTATIVE ))continue ; -if (sp_ifa->rt) -continue ; +if (sp_ifa->rt) { +/* This dst has been added to garbage list when +* lo device down, release this obsolete dst and +* reallocate a new router for ifa. +*/ +if (sp_ifa->rt->dst.obsolete >0 ) { +dst_release (&sp_ifa->rt->dst); + sp_ifa->rt =NULL ; + }else { +continue ; + } + } sp_rt =addrconf_dst_alloc (idev, &sp_ifa->addr,0 );
net/ipv6/ip6_output.c +1 -12
@@ -382,17 +382,6 @@ static inline int ip6_forward_finish(struct sk_buff *skb)return dst_output (skb); } -static bool ip6_pkt_too_big (const struct sk_buff *skb,unsigned int mtu) -{ -if (skb->len <= mtu || skb->local_df) -return false; - -if (skb_is_gso (skb) &&skb_gso_network_seglen (skb) <= mtu) -return false; - -return true; -} -int ip6_forward (struct sk_buff *skb) {struct dst_entry *dst =skb_dst (skb);
@@ -514,7 +503,7 @@ int ip6_forward(struct sk_buff *skb)if (mtu <IPV6_MIN_MTU ) mtu =IPV6_MIN_MTU ; -if (ip6_pkt_too_big (skb, mtu)) { +if (skb->len > mtu && !skb_is_gso (skb)) {/* Again, force OUTPUT device used as source address */ skb->dev = dst->dev;icmpv6_send (skb,ICMPV6_PKT_TOOBIG ,0 , mtu);
net/l2tp/l2tp_ppp.c +2 -2
@@ -1351,7 +1351,7 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,int err;if (level !=SOL_PPPOL2TP ) -return udp_prot.setsockopt (sk, level, optname, optval, optlen); +return -EINVAL ;if (optlen <sizeof (int ))return -EINVAL ;
@@ -1477,7 +1477,7 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,struct pppol2tp_session *ps;if (level !=SOL_PPPOL2TP ) -return udp_prot.getsockopt (sk, level, optname, optval, optlen); +return -EINVAL ;if (get_user (len, (int __user *) optlen))return -EFAULT ;