diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/ia64/include/asm/processor.h linux-libre-2.6.32.62-gnu1/arch/ia64/include/asm/processor.h
--- linux-libre-2.6.32.61-gnu1/arch/ia64/include/asm/processor.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/ia64/include/asm/processor.h	2014-05-19 01:54:39.000000000 -0400
@@ -361,7 +361,7 @@ struct thread_struct {
 	regs->loadrs = 0;									\
 	regs->r8 = get_dumpable(current->mm);	/* set "don't zap registers" flag */		\
 	regs->r12 = new_sp - 16;	/* allocate 16 byte scratch area */			\
-	if (unlikely(!get_dumpable(current->mm))) {							\
+	if (unlikely(get_dumpable(current->mm) != SUID_DUMP_USER)) {	\
 		/*										\
 		 * Zap scratch regs to avoid leaking bits between processes with different	\
 		 * uid/privileges.								\
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/s390/kernel/head64.S linux-libre-2.6.32.62-gnu1/arch/s390/kernel/head64.S
--- linux-libre-2.6.32.61-gnu1/arch/s390/kernel/head64.S	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/s390/kernel/head64.S	2014-05-19 01:54:39.000000000 -0400
@@ -124,7 +124,7 @@ startup_continue:
 	.quad	0			# cr12: tracing off
 	.quad	0			# cr13: home space segment table
 	.quad	0xc0000000		# cr14: machine check handling off
-	.quad	0			# cr15: linkage stack operations
+	.quad	.Llinkage_stack		# cr15: linkage stack operations
 .Lpcmsk:.quad	0x0000000180000000
 .L4malign:.quad 0xffffffffffc00000
 .Lscan2g:.quad	0x80000000 + 0x20000 - 8	# 2GB + 128K - 8
@@ -139,12 +139,15 @@ startup_continue:
 .Lparmaddr:
 	.quad	PARMAREA
 	.align	64
-.Lduct: .long	0,0,0,0,.Lduald,0,0,0
+.Lduct: .long	0,.Laste,.Laste,0,.Lduald,0,0,0
 	.long	0,0,0,0,0,0,0,0
+.Laste:	.quad	0,0xffffffffffffffff,0,0,0,0,0,0
 	.align	128
 .Lduald:.rept	8
 	.long	0x80000000,0,0,0	# invalid access-list entries
 	.endr
+.Llinkage_stack:
+	.long	0,0,0x89000000,0,0,0,0x8a000000,0
 
 	.org	0x12000
 	.globl	_ehead
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/um/kernel/exitcode.c linux-libre-2.6.32.62-gnu1/arch/um/kernel/exitcode.c
--- linux-libre-2.6.32.61-gnu1/arch/um/kernel/exitcode.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/um/kernel/exitcode.c	2014-05-19 01:54:39.000000000 -0400
@@ -42,9 +42,11 @@ static int write_proc_exitcode(struct fi
 			       unsigned long count, void *data)
 {
 	char *end, buf[sizeof("nnnnn\0")];
+	size_t size;
 	int tmp;
 
-	if (copy_from_user(buf, buffer, count))
+	size = min(count, sizeof(buf));
+	if (copy_from_user(buf, buffer, size))
 		return -EFAULT;
 
 	tmp = simple_strtol(buf, &end, 0);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/x86/include/asm/i387.h linux-libre-2.6.32.62-gnu1/arch/x86/include/asm/i387.h
--- linux-libre-2.6.32.61-gnu1/arch/x86/include/asm/i387.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/x86/include/asm/i387.h	2014-05-19 01:54:39.000000000 -0400
@@ -242,12 +242,13 @@ clear_state:
 	/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
 	   is pending.  Clear the x87 state here by setting it to fixed
 	   values. safe_address is a random variable that should be in L1 */
-	alternative_input(
-		GENERIC_NOP8 GENERIC_NOP2,
-		"emms\n\t"	  	/* clear stack tags */
-		"fildl %[addr]", 	/* set F?P to defined value */
-		X86_FEATURE_FXSAVE_LEAK,
-		[addr] "m" (safe_address));
+	if (unlikely(boot_cpu_has(X86_FEATURE_FXSAVE_LEAK))) {
+		asm volatile(
+			"fnclex\n\t"
+			"emms\n\t"
+			"fildl %[addr]"        /* set F?P to defined value */
+			: : [addr] "m" (safe_address));
+	}
 end:
 	task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/x86/include/asm/ptrace.h linux-libre-2.6.32.62-gnu1/arch/x86/include/asm/ptrace.h
--- linux-libre-2.6.32.61-gnu1/arch/x86/include/asm/ptrace.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/x86/include/asm/ptrace.h	2014-05-19 01:54:39.000000000 -0400
@@ -2,7 +2,6 @@
 #define _ASM_X86_PTRACE_H
 
 #include <linux/compiler.h>	/* For __user */
-#include <linux/linkage.h>	/* For asmregparm */
 #include <asm/ptrace-abi.h>
 #include <asm/processor-flags.h>
 
@@ -143,9 +142,6 @@ extern void send_sigtrap(struct task_str
 			 int error_code, int si_code);
 void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
 
-extern asmregparm long syscall_trace_enter(struct pt_regs *);
-extern asmregparm void syscall_trace_leave(struct pt_regs *);
-
 static inline unsigned long regs_return_value(struct pt_regs *regs)
 {
 	return regs->ax;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/x86/kernel/cpu/cpufreq/powernow-k6.c linux-libre-2.6.32.62-gnu1/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
--- linux-libre-2.6.32.61-gnu1/arch/x86/kernel/cpu/cpufreq/powernow-k6.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/x86/kernel/cpu/cpufreq/powernow-k6.c	2014-05-19 01:54:39.000000000 -0400
@@ -26,41 +26,108 @@
 static unsigned int                     busfreq;   /* FSB, in 10 kHz */
 static unsigned int                     max_multiplier;
 
+static unsigned int			param_busfreq = 0;
+static unsigned int			param_max_multiplier = 0;
+
+module_param_named(max_multiplier, param_max_multiplier, uint, S_IRUGO);
+MODULE_PARM_DESC(max_multiplier, "Maximum multiplier (allowed values: 20 30 35 40 45 50 55 60)");
+
+module_param_named(bus_frequency, param_busfreq, uint, S_IRUGO);
+MODULE_PARM_DESC(bus_frequency, "Bus frequency in kHz");
 
 /* Clock ratio multiplied by 10 - see table 27 in AMD#23446 */
 static struct cpufreq_frequency_table clock_ratio[] = {
-	{45,  /* 000 -> 4.5x */ 0},
+	{60,  /* 110 -> 6.0x */ 0},
+	{55,  /* 011 -> 5.5x */ 0},
 	{50,  /* 001 -> 5.0x */ 0},
+	{45,  /* 000 -> 4.5x */ 0},
 	{40,  /* 010 -> 4.0x */ 0},
-	{55,  /* 011 -> 5.5x */ 0},
-	{20,  /* 100 -> 2.0x */ 0},
-	{30,  /* 101 -> 3.0x */ 0},
-	{60,  /* 110 -> 6.0x */ 0},
 	{35,  /* 111 -> 3.5x */ 0},
+	{30,  /* 101 -> 3.0x */ 0},
+	{20,  /* 100 -> 2.0x */ 0},
 	{0, CPUFREQ_TABLE_END}
 };
 
+static const u8 index_to_register[8] = { 6, 3, 1, 0, 2, 7, 5, 4 };
+static const u8 register_to_index[8] = { 3, 2, 4, 1, 7, 6, 0, 5 };
+
+static const struct {
+	unsigned freq;
+	unsigned mult;
+} usual_frequency_table[] = {
+	{ 400000, 40 },	// 100   * 4
+	{ 450000, 45 }, // 100   * 4.5
+	{ 475000, 50 }, //  95   * 5
+	{ 500000, 50 }, // 100   * 5
+	{ 506250, 45 }, // 112.5 * 4.5
+	{ 533500, 55 }, //  97   * 5.5
+	{ 550000, 55 }, // 100   * 5.5
+	{ 562500, 50 }, // 112.5 * 5
+	{ 570000, 60 }, //  95   * 6
+	{ 600000, 60 }, // 100   * 6
+	{ 618750, 55 }, // 112.5 * 5.5
+	{ 660000, 55 }, // 120   * 5.5
+	{ 675000, 60 }, // 112.5 * 6
+	{ 720000, 60 }, // 120   * 6
+};
+
+#define FREQ_RANGE		3000
 
 /**
  * powernow_k6_get_cpu_multiplier - returns the current FSB multiplier
  *
- *   Returns the current setting of the frequency multiplier. Core clock
+ * Returns the current setting of the frequency multiplier. Core clock
  * speed is frequency of the Front-Side Bus multiplied with this value.
  */
 static int powernow_k6_get_cpu_multiplier(void)
 {
-	u64 invalue = 0;
+	unsigned long invalue = 0;
 	u32 msrval;
 
+	local_irq_disable();
+
 	msrval = POWERNOW_IOPORT + 0x1;
 	wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */
 	invalue = inl(POWERNOW_IOPORT + 0x8);
 	msrval = POWERNOW_IOPORT + 0x0;
 	wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */
 
-	return clock_ratio[(invalue >> 5)&7].index;
+	local_irq_enable();
+
+	return clock_ratio[register_to_index[(invalue >> 5)&7]].index;
 }
 
+static void powernow_k6_set_cpu_multiplier(unsigned int best_i)
+{
+	unsigned long outvalue, invalue;
+	unsigned long msrval;
+	unsigned long cr0;
+
+	/* we now need to transform best_i to the BVC format, see AMD#23446 */
+
+	/*
+	 * The processor doesn't respond to inquiry cycles while changing the
+	 * frequency, so we must disable cache.
+	 */
+	local_irq_disable();
+	cr0 = read_cr0();
+	write_cr0(cr0 | X86_CR0_CD);
+	wbinvd();
+
+	outvalue = (1<<12) | (1<<10) | (1<<9) | (index_to_register[best_i]<<5);
+
+	msrval = POWERNOW_IOPORT + 0x1;
+	wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */
+	invalue = inl(POWERNOW_IOPORT + 0x8);
+	invalue = invalue & 0x1f;
+	outvalue = outvalue | invalue;
+	outl(outvalue, (POWERNOW_IOPORT + 0x8));
+	msrval = POWERNOW_IOPORT + 0x0;
+	wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */
+
+	write_cr0(cr0);
+	local_irq_enable();
+}
 
 /**
  * powernow_k6_set_state - set the PowerNow! multiplier
@@ -70,8 +137,6 @@ static int powernow_k6_get_cpu_multiplie
  */
 static void powernow_k6_set_state(unsigned int best_i)
 {
-	unsigned long outvalue = 0, invalue = 0;
-	unsigned long msrval;
 	struct cpufreq_freqs freqs;
 
 	if (clock_ratio[best_i].index > max_multiplier) {
@@ -85,18 +150,7 @@ static void powernow_k6_set_state(unsign
 
 	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
 
-	/* we now need to transform best_i to the BVC format, see AMD#23446 */
-
-	outvalue = (1<<12) | (1<<10) | (1<<9) | (best_i<<5);
-
-	msrval = POWERNOW_IOPORT + 0x1;
-	wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */
-	invalue = inl(POWERNOW_IOPORT + 0x8);
-	invalue = invalue & 0xf;
-	outvalue = outvalue | invalue;
-	outl(outvalue , (POWERNOW_IOPORT + 0x8));
-	msrval = POWERNOW_IOPORT + 0x0;
-	wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */
+	powernow_k6_set_cpu_multiplier(best_i);
 
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 
@@ -141,18 +195,57 @@ static int powernow_k6_target(struct cpu
 	return 0;
 }
 
-
 static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
 {
 	unsigned int i, f;
 	int result;
+	unsigned khz;
 
 	if (policy->cpu != 0)
 		return -ENODEV;
 
-	/* get frequencies */
-	max_multiplier = powernow_k6_get_cpu_multiplier();
-	busfreq = cpu_khz / max_multiplier;
+	max_multiplier = 0;
+	khz = cpu_khz;
+	for (i = 0; i < ARRAY_SIZE(usual_frequency_table); i++) {
+		if (khz >= usual_frequency_table[i].freq - FREQ_RANGE &&
+		    khz <= usual_frequency_table[i].freq + FREQ_RANGE) {
+			khz = usual_frequency_table[i].freq;
+			max_multiplier = usual_frequency_table[i].mult;
+			break;
+		}
+	}
+	if (param_max_multiplier) {
+		for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
+			if (clock_ratio[i].index == param_max_multiplier) {
+				max_multiplier = param_max_multiplier;
+				goto have_max_multiplier;
+			}
+		}
+		printk(KERN_ERR "powernow-k6: invalid max_multiplier parameter, valid parameters 20, 30, 35, 40, 45, 50, 55, 60\n");
+		return -EINVAL;
+	}
+
+	if (!max_multiplier) {
+		printk(KERN_WARNING "powernow-k6: unknown frequency %u, cannot determine current multiplier\n", khz);
+		printk(KERN_WARNING "powernow-k6: use module parameters max_multiplier and bus_frequency\n");
+		return -EOPNOTSUPP;
+	}
+
+have_max_multiplier:
+	param_max_multiplier = max_multiplier;
+
+	if (param_busfreq) {
+		if (param_busfreq >= 50000 && param_busfreq <= 150000) {
+			busfreq = param_busfreq / 10;
+			goto have_busfreq;
+		}
+		printk(KERN_ERR "powernow-k6: invalid bus_frequency parameter, allowed range 50000 - 150000 kHz\n");
+		return -EINVAL;
+	}
+
+	busfreq = khz / max_multiplier;
+have_busfreq:
+	param_busfreq = busfreq * 10;
 
 	/* table init */
 	for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
@@ -164,7 +257,7 @@ static int powernow_k6_cpu_init(struct c
 	}
 
 	/* cpuinfo and default policy values */
-	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+	policy->cpuinfo.transition_latency = 500000;
 	policy->cur = busfreq * max_multiplier;
 
 	result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/arch/x86/kvm/lapic.c linux-libre-2.6.32.62-gnu1/arch/x86/kvm/lapic.c
--- linux-libre-2.6.32.61-gnu1/arch/x86/kvm/lapic.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/arch/x86/kvm/lapic.c	2014-05-19 01:54:39.000000000 -0400
@@ -519,7 +519,8 @@ static u32 apic_get_tmcct(struct kvm_lap
 	ASSERT(apic != NULL);
 
 	/* if initial count is 0, current count should also be 0 */
-	if (apic_get_reg(apic, APIC_TMICT) == 0)
+	if (apic_get_reg(apic, APIC_TMICT) == 0 ||
+		apic->lapic_timer.period == 0)
 		return 0;
 
 	remaining = hrtimer_get_remaining(&apic->lapic_timer.timer);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/crypto/ansi_cprng.c linux-libre-2.6.32.62-gnu1/crypto/ansi_cprng.c
--- linux-libre-2.6.32.61-gnu1/crypto/ansi_cprng.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/crypto/ansi_cprng.c	2014-05-19 01:54:39.000000000 -0400
@@ -232,11 +232,11 @@ remainder:
 	 */
 	if (byte_count < DEFAULT_BLK_SZ) {
 empty_rbuf:
-		for (; ctx->rand_data_valid < DEFAULT_BLK_SZ;
-			ctx->rand_data_valid++) {
+		while (ctx->rand_data_valid < DEFAULT_BLK_SZ) {
 			*ptr = ctx->rand_data[ctx->rand_data_valid];
 			ptr++;
 			byte_count--;
+			ctx->rand_data_valid++;
 			if (byte_count == 0)
 				goto done;
 		}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/crypto/api.c linux-libre-2.6.32.62-gnu1/crypto/api.c
--- linux-libre-2.6.32.61-gnu1/crypto/api.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/crypto/api.c	2014-05-19 01:54:39.000000000 -0400
@@ -40,6 +40,8 @@ static inline struct crypto_alg *crypto_
 	return alg;
 }
 
+static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg);
+
 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg)
 {
 	return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL;
@@ -150,8 +152,11 @@ static struct crypto_alg *crypto_larval_
 	}
 	up_write(&crypto_alg_sem);
 
-	if (alg != &larval->alg)
+	if (alg != &larval->alg) {
 		kfree(larval);
+		if (crypto_is_larval(alg))
+			alg = crypto_larval_wait(alg);
+	}
 
 	return alg;
 }
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/atm/idt77252.c linux-libre-2.6.32.62-gnu1/drivers/atm/idt77252.c
--- linux-libre-2.6.32.61-gnu1/drivers/atm/idt77252.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/atm/idt77252.c	2014-05-19 01:54:39.000000000 -0400
@@ -3557,6 +3557,7 @@ init_card(struct atm_dev *dev)
 	if (tmp) {
 		memcpy(card->atmdev->esi, tmp->dev_addr, 6);
 
+		dev_put(tmp);
 		printk("%s: ESI %02x:%02x:%02x:%02x:%02x:%02x\n",
 		       card->name, card->atmdev->esi[0], card->atmdev->esi[1],
 		       card->atmdev->esi[2], card->atmdev->esi[3],
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/block/cciss.c linux-libre-2.6.32.62-gnu1/drivers/block/cciss.c
--- linux-libre-2.6.32.61-gnu1/drivers/block/cciss.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/block/cciss.c	2014-05-19 01:54:39.000000000 -0400
@@ -1051,6 +1051,7 @@ static int cciss_ioctl32_big_passthru(st
 	int err;
 	u32 cp;
 
+	memset(&arg64, 0, sizeof(arg64));
 	err = 0;
 	err |=
 	    copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/block/cpqarray.c linux-libre-2.6.32.62-gnu1/drivers/block/cpqarray.c
--- linux-libre-2.6.32.61-gnu1/drivers/block/cpqarray.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/block/cpqarray.c	2014-05-19 01:54:39.000000000 -0400
@@ -1181,6 +1181,7 @@ out_passthru:
 		ida_pci_info_struct pciinfo;
 
 		if (!arg) return -EINVAL;
+		memset(&pciinfo, 0, sizeof(pciinfo));
 		pciinfo.bus = host->pci_dev->bus->number;
 		pciinfo.dev_fn = host->pci_dev->devfn;
 		pciinfo.board_id = host->board_id;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/block/floppy.c linux-libre-2.6.32.62-gnu1/drivers/block/floppy.c
--- linux-libre-2.6.32.61-gnu1/drivers/block/floppy.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/block/floppy.c	2014-05-19 01:54:39.000000000 -0400
@@ -3162,7 +3162,12 @@ static inline int raw_cmd_copyout(int cm
 	int ret;
 
 	while (ptr) {
-		COPYOUT(*ptr);
+		struct floppy_raw_cmd cmd = *ptr;
+		cmd.next = NULL;
+		cmd.kernel_data = NULL;
+		ret = copy_to_user((void __user *)param, &cmd, sizeof(cmd));
+		if (ret)
+			return -EFAULT;
 		param += sizeof(struct floppy_raw_cmd);
 		if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) {
 			if (ptr->length >= 0
@@ -3209,9 +3214,12 @@ static inline int raw_cmd_copyin(int cmd
 		if (!ptr)
 			return -ENOMEM;
 		*rcmd = ptr;
-		COPYIN(*ptr);
+		ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr));
 		ptr->next = NULL;
 		ptr->buffer_length = 0;
+		ptr->kernel_data = NULL;
+		if (ret)
+			return -EFAULT;
 		param += sizeof(struct floppy_raw_cmd);
 		if (ptr->cmd_count > 33)
 			/* the command may now also take up the space
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/block/nbd.c linux-libre-2.6.32.62-gnu1/drivers/block/nbd.c
--- linux-libre-2.6.32.61-gnu1/drivers/block/nbd.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/block/nbd.c	2014-05-19 01:54:39.000000000 -0400
@@ -655,7 +655,9 @@ static int __nbd_ioctl(struct block_devi
 
 		mutex_unlock(&lo->tx_lock);
 
-		thread = kthread_create(nbd_thread, lo, lo->disk->disk_name);
+		thread = kthread_create(nbd_thread, lo, "%s",
+					lo->disk->disk_name);
+
 		if (IS_ERR(thread)) {
 			mutex_lock(&lo->tx_lock);
 			return PTR_ERR(thread);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/cdrom/cdrom.c linux-libre-2.6.32.62-gnu1/drivers/cdrom/cdrom.c
--- linux-libre-2.6.32.61-gnu1/drivers/cdrom/cdrom.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/cdrom/cdrom.c	2014-05-19 01:54:39.000000000 -0400
@@ -2822,7 +2822,7 @@ static noinline int mmc_ioctl_cdrom_read
 	if (lba < 0)
 		return -EINVAL;
 
-	cgc->buffer = kmalloc(blocksize, GFP_KERNEL);
+	cgc->buffer = kzalloc(blocksize, GFP_KERNEL);
 	if (cgc->buffer == NULL)
 		return -ENOMEM;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/char/n_tty.c linux-libre-2.6.32.62-gnu1/drivers/char/n_tty.c
--- linux-libre-2.6.32.61-gnu1/drivers/char/n_tty.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/char/n_tty.c	2014-05-19 01:54:39.000000000 -0400
@@ -1969,7 +1969,9 @@ static ssize_t n_tty_write(struct tty_st
 				tty->ops->flush_chars(tty);
 		} else {
 			while (nr > 0) {
+				mutex_lock(&tty->output_lock);
 				c = tty->ops->write(tty, b, nr);
+				mutex_unlock(&tty->output_lock);
 				if (c < 0) {
 					retval = c;
 					goto break_out;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/connector/cn_proc.c linux-libre-2.6.32.62-gnu1/drivers/connector/cn_proc.c
--- linux-libre-2.6.32.61-gnu1/drivers/connector/cn_proc.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/connector/cn_proc.c	2014-05-19 01:54:39.000000000 -0400
@@ -59,6 +59,7 @@ void proc_fork_connector(struct task_str
 
 	msg = (struct cn_msg*)buffer;
 	ev = (struct proc_event*)msg->data;
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	get_seq(&msg->seq, &ev->cpu);
 	ktime_get_ts(&ts); /* get high res monotonic timestamp */
 	put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -71,6 +72,7 @@ void proc_fork_connector(struct task_str
 	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
 	msg->ack = 0; /* not used */
 	msg->len = sizeof(*ev);
+	msg->flags = 0; /* not used */
 	/*  If cn_netlink_send() failed, the data is not sent */
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
@@ -87,6 +89,7 @@ void proc_exec_connector(struct task_str
 
 	msg = (struct cn_msg*)buffer;
 	ev = (struct proc_event*)msg->data;
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	get_seq(&msg->seq, &ev->cpu);
 	ktime_get_ts(&ts); /* get high res monotonic timestamp */
 	put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -97,6 +100,7 @@ void proc_exec_connector(struct task_str
 	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
 	msg->ack = 0; /* not used */
 	msg->len = sizeof(*ev);
+	msg->flags = 0; /* not used */
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
@@ -113,6 +117,7 @@ void proc_id_connector(struct task_struc
 
 	msg = (struct cn_msg*)buffer;
 	ev = (struct proc_event*)msg->data;
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	ev->what = which_id;
 	ev->event_data.id.process_pid = task->pid;
 	ev->event_data.id.process_tgid = task->tgid;
@@ -136,6 +141,7 @@ void proc_id_connector(struct task_struc
 	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
 	msg->ack = 0; /* not used */
 	msg->len = sizeof(*ev);
+	msg->flags = 0; /* not used */
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
@@ -151,6 +157,7 @@ void proc_sid_connector(struct task_stru
 
 	msg = (struct cn_msg *)buffer;
 	ev = (struct proc_event *)msg->data;
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	get_seq(&msg->seq, &ev->cpu);
 	ktime_get_ts(&ts); /* get high res monotonic timestamp */
 	put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -161,6 +168,7 @@ void proc_sid_connector(struct task_stru
 	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
 	msg->ack = 0; /* not used */
 	msg->len = sizeof(*ev);
+	msg->flags = 0; /* not used */
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
@@ -176,8 +184,10 @@ void proc_exit_connector(struct task_str
 
 	msg = (struct cn_msg*)buffer;
 	ev = (struct proc_event*)msg->data;
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	get_seq(&msg->seq, &ev->cpu);
 	ktime_get_ts(&ts); /* get high res monotonic timestamp */
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
 	ev->what = PROC_EVENT_EXIT;
 	ev->event_data.exit.process_pid = task->pid;
@@ -188,6 +198,7 @@ void proc_exit_connector(struct task_str
 	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
 	msg->ack = 0; /* not used */
 	msg->len = sizeof(*ev);
+	msg->flags = 0; /* not used */
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
@@ -211,6 +222,7 @@ static void cn_proc_ack(int err, int rcv
 
 	msg = (struct cn_msg*)buffer;
 	ev = (struct proc_event*)msg->data;
+	memset(&ev->event_data, 0, sizeof(ev->event_data));
 	msg->seq = rcvd_seq;
 	ktime_get_ts(&ts); /* get high res monotonic timestamp */
 	put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
@@ -220,6 +232,7 @@ static void cn_proc_ack(int err, int rcv
 	memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
 	msg->ack = rcvd_ack + 1;
 	msg->len = sizeof(*ev);
+	msg->flags = 0; /* not used */
 	cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
 }
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/connector/connector.c linux-libre-2.6.32.62-gnu1/drivers/connector/connector.c
--- linux-libre-2.6.32.61-gnu1/drivers/connector/connector.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/connector/connector.c	2014-05-19 01:54:39.000000000 -0400
@@ -177,17 +177,18 @@ static int cn_call_callback(struct sk_bu
 static void cn_rx_skb(struct sk_buff *__skb)
 {
 	struct nlmsghdr *nlh;
-	int err;
 	struct sk_buff *skb;
+	int len, err;
 
 	skb = skb_get(__skb);
 
 	if (skb->len >= NLMSG_SPACE(0)) {
 		nlh = nlmsg_hdr(skb);
+		len = nlmsg_len(nlh);
 
-		if (nlh->nlmsg_len < sizeof(struct cn_msg) ||
+		if (len < (int)sizeof(struct cn_msg) ||
 		    skb->len < nlh->nlmsg_len ||
-		    nlh->nlmsg_len > CONNECTOR_MAX_MSG_SIZE) {
+		    len > CONNECTOR_MAX_MSG_SIZE) {
 			kfree_skb(skb);
 			return;
 		}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/hid/hid-core.c linux-libre-2.6.32.62-gnu1/drivers/hid/hid-core.c
--- linux-libre-2.6.32.61-gnu1/drivers/hid/hid-core.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/hid/hid-core.c	2014-05-19 01:54:39.000000000 -0400
@@ -58,6 +58,8 @@ static struct hid_report *hid_register_r
 	struct hid_report_enum *report_enum = device->report_enum + type;
 	struct hid_report *report;
 
+	if (id >= HID_MAX_IDS)
+		return NULL;
 	if (report_enum->report_id_hash[id])
 		return report_enum->report_id_hash[id];
 
@@ -368,8 +370,10 @@ static int hid_parser_global(struct hid_
 
 	case HID_GLOBAL_ITEM_TAG_REPORT_ID:
 		parser->global.report_id = item_udata(item);
-		if (parser->global.report_id == 0) {
-			dbg_hid("report_id 0 is invalid\n");
+		if (parser->global.report_id == 0 ||
+		    parser->global.report_id >= HID_MAX_IDS) {
+			dbg_hid("report_id %u is invalid\n",
+				parser->global.report_id);
 			return -1;
 		}
 		return 0;
@@ -545,7 +549,7 @@ static void hid_device_release(struct de
 	for (i = 0; i < HID_REPORT_TYPES; i++) {
 		struct hid_report_enum *report_enum = device->report_enum + i;
 
-		for (j = 0; j < 256; j++) {
+		for (j = 0; j < HID_MAX_IDS; j++) {
 			struct hid_report *report = report_enum->report_id_hash[j];
 			if (report)
 				hid_free_report(report);
@@ -804,6 +808,64 @@ static __inline__ int search(__s32 *arra
 	return -1;
 }
 
+static const char * const hid_report_names[] = {
+	"HID_INPUT_REPORT",
+	"HID_OUTPUT_REPORT",
+	"HID_FEATURE_REPORT",
+};
+/**
+ * hid_validate_values - validate existing device report's value indexes
+ *
+ * @device: hid device
+ * @type: which report type to examine
+ * @id: which report ID to examine (0 for first)
+ * @field_index: which report field to examine
+ * @report_counts: expected number of values
+ *
+ * Validate the number of values in a given field of a given report, after
+ * parsing.
+ */
+struct hid_report *hid_validate_values(struct hid_device *hid,
+				       unsigned int type, unsigned int id,
+				       unsigned int field_index,
+				       unsigned int report_counts)
+{
+	struct hid_report *report;
+
+	if (type > HID_FEATURE_REPORT) {
+		dev_err(&hid->dev, "invalid HID report type %u\n", type);
+		return NULL;
+	}
+
+	if (id >= HID_MAX_IDS) {
+		dev_err(&hid->dev, "invalid HID report id %u\n", id);
+		return NULL;
+	}
+
+	/*
+	 * Explicitly not using hid_get_report() here since it depends on
+	 * ->numbered being checked, which may not always be the case when
+	 * drivers go to access report values.
+	 */
+	report = hid->report_enum[type].report_id_hash[id];
+	if (!report) {
+		dev_err(&hid->dev, "missing %s %u\n", hid_report_names[type], id);
+		return NULL;
+	}
+	if (report->maxfield <= field_index) {
+		dev_err(&hid->dev, "not enough fields in %s %u\n",
+			hid_report_names[type], id);
+		return NULL;
+	}
+	if (report->field[field_index]->report_count < report_counts) {
+		dev_err(&hid->dev, "not enough values in %s %u field %u\n",
+			hid_report_names[type], id, field_index);
+		return NULL;
+	}
+	return report;
+}
+EXPORT_SYMBOL_GPL(hid_validate_values);
+
 /**
  * hid_match_report - check if driver's raw_event should be called
  *
@@ -979,7 +1041,12 @@ EXPORT_SYMBOL_GPL(hid_output_report);
 
 int hid_set_field(struct hid_field *field, unsigned offset, __s32 value)
 {
-	unsigned size = field->report_size;
+	unsigned size;
+
+	if (!field)
+		return -1;
+
+	size = field->report_size;
 
 	hid_dump_input(field->report->device, field->usage + offset, value);
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/hid/hid-lg2ff.c linux-libre-2.6.32.62-gnu1/drivers/hid/hid-lg2ff.c
--- linux-libre-2.6.32.61-gnu1/drivers/hid/hid-lg2ff.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/hid/hid-lg2ff.c	2014-05-19 01:54:39.000000000 -0400
@@ -65,26 +65,13 @@ int lg2ff_init(struct hid_device *hid)
 	struct hid_report *report;
 	struct hid_input *hidinput = list_entry(hid->inputs.next,
 						struct hid_input, list);
-	struct list_head *report_list =
-			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
 	int error;
 
-	if (list_empty(report_list)) {
-		dev_err(&hid->dev, "no output report found\n");
-		return -ENODEV;
-	}
-
-	report = list_entry(report_list->next, struct hid_report, list);
-
-	if (report->maxfield < 1) {
-		dev_err(&hid->dev, "output report is empty\n");
-		return -ENODEV;
-	}
-	if (report->field[0]->report_count < 7) {
-		dev_err(&hid->dev, "not enough values in the field\n");
+	/* Check that the report looks ok */
+	report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7);
+	if (!report)
 		return -ENODEV;
-	}
 
 	lg2ff = kmalloc(sizeof(struct lg2ff_device), GFP_KERNEL);
 	if (!lg2ff)
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/hid/hid-lgff.c linux-libre-2.6.32.62-gnu1/drivers/hid/hid-lgff.c
--- linux-libre-2.6.32.61-gnu1/drivers/hid/hid-lgff.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/hid/hid-lgff.c	2014-05-19 01:54:39.000000000 -0400
@@ -135,27 +135,14 @@ static void hid_lgff_set_autocenter(stru
 int lgff_init(struct hid_device* hid)
 {
 	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
-	struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
-	struct hid_report *report;
-	struct hid_field *field;
 	const signed short *ff_bits = ff_joystick;
 	int error;
 	int i;
 
-	/* Find the report to use */
-	if (list_empty(report_list)) {
-		err_hid("No output report found");
-		return -1;
-	}
-
 	/* Check that the report looks ok */
-	report = list_entry(report_list->next, struct hid_report, list);
-	field = report->field[0];
-	if (!field) {
-		err_hid("NULL field");
-		return -1;
-	}
+	if (!hid_validate_values(hid, HID_OUTPUT_REPORT, 0, 0, 7))
+		return -ENODEV;
 
 	for (i = 0; i < ARRAY_SIZE(devices); i++) {
 		if (dev->id.vendor == devices[i].idVendor &&
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/hid/hid-pl.c linux-libre-2.6.32.62-gnu1/drivers/hid/hid-pl.c
--- linux-libre-2.6.32.61-gnu1/drivers/hid/hid-pl.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/hid/hid-pl.c	2014-05-19 01:54:39.000000000 -0400
@@ -128,8 +128,14 @@ static int plff_init(struct hid_device *
 			strong = &report->field[0]->value[2];
 			weak = &report->field[0]->value[3];
 			debug("detected single-field device");
-		} else if (report->maxfield >= 4 && report->field[0]->maxusage == 1 &&
-				report->field[0]->usage[0].hid == (HID_UP_LED | 0x43)) {
+		} else if (report->field[0]->maxusage == 1 &&
+			   report->field[0]->usage[0].hid ==
+				(HID_UP_LED | 0x43) &&
+			   report->maxfield >= 4 &&
+			   report->field[0]->report_count >= 1 &&
+			   report->field[1]->report_count >= 1 &&
+			   report->field[2]->report_count >= 1 &&
+			   report->field[3]->report_count >= 1) {
 			report->field[0]->value[0] = 0x00;
 			report->field[1]->value[0] = 0x00;
 			strong = &report->field[2]->value[0];
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/hid/hid-zpff.c linux-libre-2.6.32.62-gnu1/drivers/hid/hid-zpff.c
--- linux-libre-2.6.32.61-gnu1/drivers/hid/hid-zpff.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/hid/hid-zpff.c	2014-05-19 01:54:39.000000000 -0400
@@ -68,21 +68,13 @@ static int zpff_init(struct hid_device *
 	struct hid_report *report;
 	struct hid_input *hidinput = list_entry(hid->inputs.next,
 						struct hid_input, list);
-	struct list_head *report_list =
-			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
 	struct input_dev *dev = hidinput->input;
-	int error;
-
-	if (list_empty(report_list)) {
-		dev_err(&hid->dev, "no output report found\n");
-		return -ENODEV;
-	}
-
-	report = list_entry(report_list->next, struct hid_report, list);
+	int i, error;
 
-	if (report->maxfield < 4) {
-		dev_err(&hid->dev, "not enough fields in report\n");
-		return -ENODEV;
+	for (i = 0; i < 4; i++) {
+		report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, i, 1);
+		if (!report)
+			return -ENODEV;
 	}
 
 	zpff = kzalloc(sizeof(struct zpff_device), GFP_KERNEL);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/isdn/isdnloop/isdnloop.c linux-libre-2.6.32.62-gnu1/drivers/isdn/isdnloop/isdnloop.c
--- linux-libre-2.6.32.61-gnu1/drivers/isdn/isdnloop/isdnloop.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/isdn/isdnloop/isdnloop.c	2014-05-19 01:54:39.000000000 -0400
@@ -517,9 +517,9 @@ static isdnloop_stat isdnloop_cmd_table[
 static void
 isdnloop_fake_err(isdnloop_card * card)
 {
-	char buf[60];
+	char buf[64];
 
-	sprintf(buf, "E%s", card->omsg);
+	snprintf(buf, sizeof(buf), "E%s", card->omsg);
 	isdnloop_fake(card, buf, -1);
 	isdnloop_fake(card, "NAK", -1);
 }
@@ -902,6 +902,8 @@ isdnloop_parse_cmd(isdnloop_card * card)
 		case 7:
 			/* 0x;EAZ */
 			p += 3;
+			if (strlen(p) >= sizeof(card->eazlist[0]))
+				break;
 			strcpy(card->eazlist[ch - 1], p);
 			break;
 		case 8:
@@ -1069,6 +1071,12 @@ isdnloop_start(isdnloop_card * card, isd
 		return -EBUSY;
 	if (copy_from_user((char *) &sdef, (char *) sdefp, sizeof(sdef)))
 		return -EFAULT;
+
+	for (i = 0; i < 3; i++) {
+		if (!memchr(sdef.num[i], 0, sizeof(sdef.num[i])))
+			return -EINVAL;
+	}
+
 	spin_lock_irqsave(&card->isdnloop_lock, flags);
 	switch (sdef.ptype) {
 		case ISDN_PTYPE_EURO:
@@ -1082,8 +1090,10 @@ isdnloop_start(isdnloop_card * card, isd
 				spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 				return -ENOMEM;
 			}
-			for (i = 0; i < 3; i++)
-				strcpy(card->s0num[i], sdef.num[i]);
+			for (i = 0; i < 3; i++) {
+				strlcpy(card->s0num[i], sdef.num[i],
+					sizeof(card->s0num[0]));
+			}
 			break;
 		case ISDN_PTYPE_1TR6:
 			if (isdnloop_fake(card, "DRV1.04TC-1TR6-CAPI-CNS-BASIS-29.11.95",
@@ -1096,7 +1106,7 @@ isdnloop_start(isdnloop_card * card, isd
 				spin_unlock_irqrestore(&card->isdnloop_lock, flags);
 				return -ENOMEM;
 			}
-			strcpy(card->s0num[0], sdef.num[0]);
+			strlcpy(card->s0num[0], sdef.num[0], sizeof(card->s0num[0]));
 			card->s0num[1][0] = '\0';
 			card->s0num[2][0] = '\0';
 			break;
@@ -1124,7 +1134,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop
 {
 	ulong a;
 	int i;
-	char cbuf[60];
+	char cbuf[80];
 	isdn_ctrl cmd;
 	isdnloop_cdef cdef;
 
@@ -1189,7 +1199,6 @@ isdnloop_command(isdn_ctrl * c, isdnloop
 				break;
 			if ((c->arg & 255) < ISDNLOOP_BCH) {
 				char *p;
-				char dial[50];
 				char dcode[4];
 
 				a = c->arg;
@@ -1201,10 +1210,10 @@ isdnloop_command(isdn_ctrl * c, isdnloop
 				} else
 					/* Normal Dial */
 					strcpy(dcode, "CAL");
-				strcpy(dial, p);
-				sprintf(cbuf, "%02d;D%s_R%s,%02d,%02d,%s\n", (int) (a + 1),
-					dcode, dial, c->parm.setup.si1,
-				c->parm.setup.si2, c->parm.setup.eazmsn);
+				snprintf(cbuf, sizeof(cbuf),
+					 "%02d;D%s_R%s,%02d,%02d,%s\n", (int) (a + 1),
+					 dcode, p, c->parm.setup.si1,
+					 c->parm.setup.si2, c->parm.setup.eazmsn);
 				i = isdnloop_writecmd(cbuf, strlen(cbuf), 0, card);
 			}
 			break;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/isdn/mISDN/socket.c linux-libre-2.6.32.62-gnu1/drivers/isdn/mISDN/socket.c
--- linux-libre-2.6.32.61-gnu1/drivers/isdn/mISDN/socket.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/isdn/mISDN/socket.c	2014-05-19 01:54:39.000000000 -0400
@@ -115,7 +115,6 @@ mISDN_sock_recvmsg(struct kiocb *iocb, s
 {
 	struct sk_buff		*skb;
 	struct sock		*sk = sock->sk;
-	struct sockaddr_mISDN	*maddr;
 
 	int		copied, err;
 
@@ -133,9 +132,9 @@ mISDN_sock_recvmsg(struct kiocb *iocb, s
 	if (!skb)
 		return err;
 
-	if (msg->msg_namelen >= sizeof(struct sockaddr_mISDN)) {
-		msg->msg_namelen = sizeof(struct sockaddr_mISDN);
-		maddr = (struct sockaddr_mISDN *)msg->msg_name;
+	if (msg->msg_name) {
+		struct sockaddr_mISDN *maddr = msg->msg_name;
+
 		maddr->family = AF_ISDN;
 		maddr->dev = _pms(sk)->dev->id;
 		if ((sk->sk_protocol == ISDN_P_LAPD_TE) ||
@@ -148,11 +147,7 @@ mISDN_sock_recvmsg(struct kiocb *iocb, s
 			maddr->sapi = _pms(sk)->ch.addr & 0xFF;
 			maddr->tei =  (_pms(sk)->ch.addr >> 8) & 0xFF;
 		}
-	} else {
-		if (msg->msg_namelen)
-			printk(KERN_WARNING "%s: too small namelen %d\n",
-			    __func__, msg->msg_namelen);
-		msg->msg_namelen = 0;
+		msg->msg_namelen = sizeof(*maddr);
 	}
 
 	copied = skb->len + MISDN_HEADER_LEN;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/md/dm-snap-persistent.c linux-libre-2.6.32.62-gnu1/drivers/md/dm-snap-persistent.c
--- linux-libre-2.6.32.61-gnu1/drivers/md/dm-snap-persistent.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/md/dm-snap-persistent.c	2014-05-19 01:54:39.000000000 -0400
@@ -252,6 +252,14 @@ static chunk_t area_location(struct psto
 	return 1 + ((ps->exceptions_per_area + 1) * area);
 }
 
+static void skip_metadata(struct pstore *ps)
+{
+	uint32_t stride = ps->exceptions_per_area + 1;
+	chunk_t next_free = ps->next_free;
+	if (sector_div(next_free, stride) == 1)
+		ps->next_free++;
+}
+
 /*
  * Read or write a metadata area.  Remembering to skip the first
  * chunk which holds the header.
@@ -481,6 +489,8 @@ static int read_exceptions(struct pstore
 
 	ps->current_area--;
 
+	skip_metadata(ps);
+
 	return 0;
 }
 
@@ -587,8 +597,6 @@ static int persistent_prepare_exception(
 					struct dm_snap_exception *e)
 {
 	struct pstore *ps = get_info(store);
-	uint32_t stride;
-	chunk_t next_free;
 	sector_t size = get_dev_size(store->cow->bdev);
 
 	/* Is there enough room ? */
@@ -601,10 +609,8 @@ static int persistent_prepare_exception(
 	 * Move onto the next free pending, making sure to take
 	 * into account the location of the metadata chunks.
 	 */
-	stride = (ps->exceptions_per_area + 1);
-	next_free = ++ps->next_free;
-	if (sector_div(next_free, stride) == 1)
-		ps->next_free++;
+	ps->next_free++;
+	skip_metadata(ps);
 
 	atomic_inc(&ps->pending_count);
 	return 0;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/arcnet/arcnet.c linux-libre-2.6.32.62-gnu1/drivers/net/arcnet/arcnet.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/arcnet/arcnet.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/arcnet/arcnet.c	2014-05-19 01:54:39.000000000 -0400
@@ -1008,7 +1008,7 @@ static void arcnet_rx(struct net_device
 
 	soft = &pkt.soft.rfc1201;
 
-	lp->hw.copy_from_card(dev, bufnum, 0, &pkt, sizeof(ARC_HDR_SIZE));
+	lp->hw.copy_from_card(dev, bufnum, 0, &pkt, ARC_HDR_SIZE);
 	if (pkt.hard.offset[0]) {
 		ofs = pkt.hard.offset[0];
 		length = 256 - ofs;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_3ad.c linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_3ad.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_3ad.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_3ad.c	2014-05-19 01:54:39.000000000 -0400
@@ -1846,8 +1846,6 @@ void bond_3ad_initiate_agg_selection(str
 	BOND_AD_INFO(bond).agg_select_mode = bond->params.ad_select;
 }
 
-static u16 aggregator_identifier;
-
 /**
  * bond_3ad_initialize - initialize a bond's 802.3ad parameters and structures
  * @bond: bonding struct to work on
@@ -1862,7 +1860,7 @@ void bond_3ad_initialize(struct bonding
 	if (MAC_ADDRESS_COMPARE(&(BOND_AD_INFO(bond).system.sys_mac_addr),
 				bond->dev->dev_addr)) {
 
-		aggregator_identifier = 0;
+		BOND_AD_INFO(bond).aggregator_identifier = 0;
 
 		BOND_AD_INFO(bond).lacp_fast = lacp_fast;
 		BOND_AD_INFO(bond).system.sys_priority = 0xFFFF;
@@ -1937,7 +1935,7 @@ int bond_3ad_bind_slave(struct slave *sl
 		ad_initialize_agg(aggregator);
 
 		aggregator->aggregator_mac_address = *((struct mac_addr *)bond->dev->dev_addr);
-		aggregator->aggregator_identifier = (++aggregator_identifier);
+		aggregator->aggregator_identifier = ++BOND_AD_INFO(bond).aggregator_identifier;
 		aggregator->slave = slave;
 		aggregator->is_active = 0;
 		aggregator->num_of_ports = 0;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_3ad.h linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_3ad.h
--- linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_3ad.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_3ad.h	2014-05-19 01:54:39.000000000 -0400
@@ -253,6 +253,7 @@ struct ad_system {
 struct ad_bond_info {
 	struct ad_system system;	    /* 802.3ad system structure */
 	u32 agg_select_timer;	    // Timer to select aggregator after all adapter's hand shakes
+	u16 aggregator_identifier;
 	u32 agg_select_mode;	    // Mode of selection of active aggregator(bandwidth/count)
 	int lacp_fast;		/* whether fast periodic tx should be
 				 * requested
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_main.c linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_main.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_main.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_main.c	2014-05-19 01:54:39.000000000 -0400
@@ -1794,6 +1794,7 @@ int bond_release(struct net_device *bond
 	struct bonding *bond = netdev_priv(bond_dev);
 	struct slave *slave, *oldcurrent;
 	struct sockaddr addr;
+	int old_flags = bond_dev->flags;
 
 	/* slave is not a slave or master is not master of this slave */
 	if (!(slave_dev->flags & IFF_SLAVE) ||
@@ -1929,12 +1930,18 @@ int bond_release(struct net_device *bond
 	 * already taken care of above when we detached the slave
 	 */
 	if (!USES_PRIMARY(bond->params.mode)) {
-		/* unset promiscuity level from slave */
-		if (bond_dev->flags & IFF_PROMISC)
+		/* unset promiscuity level from slave
+		 * NOTE: The NETDEV_CHANGEADDR call above may change the value
+		 * of the IFF_PROMISC flag in the bond_dev, but we need the
+		 * value of that flag before that change, as that was the value
+		 * when this slave was attached, so we cache at the start of the
+		 * function and use it here. Same goes for ALLMULTI below
+		 */
+		if (old_flags & IFF_PROMISC)
 			dev_set_promiscuity(slave_dev, -1);
 
 		/* unset allmulti level from slave */
-		if (bond_dev->flags & IFF_ALLMULTI)
+		if (old_flags & IFF_ALLMULTI)
 			dev_set_allmulti(slave_dev, -1);
 
 		/* flush master's mc_list from slave */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_sysfs.c linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_sysfs.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/bonding/bond_sysfs.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/bonding/bond_sysfs.c	2014-05-19 01:54:39.000000000 -0400
@@ -755,6 +755,8 @@ static ssize_t bonding_store_downdelay(s
 	int new_value, ret = count;
 	struct bonding *bond = to_bond(d);
 
+	if (!rtnl_trylock())
+		return restart_syscall();
 	if (!(bond->params.miimon)) {
 		pr_err(DRV_NAME
 		       ": %s: Unable to set down delay as MII monitoring is disabled\n",
@@ -795,6 +797,7 @@ static ssize_t bonding_store_downdelay(s
 	}
 
 out:
+	rtnl_unlock();
 	return ret;
 }
 static DEVICE_ATTR(downdelay, S_IRUGO | S_IWUSR,
@@ -817,6 +820,8 @@ static ssize_t bonding_store_updelay(str
 	int new_value, ret = count;
 	struct bonding *bond = to_bond(d);
 
+	if (!rtnl_trylock())
+		return restart_syscall();
 	if (!(bond->params.miimon)) {
 		pr_err(DRV_NAME
 		       ": %s: Unable to set up delay as MII monitoring is disabled\n",
@@ -856,6 +861,7 @@ static ssize_t bonding_store_updelay(str
 	}
 
 out:
+	rtnl_unlock();
 	return ret;
 }
 static DEVICE_ATTR(updelay, S_IRUGO | S_IWUSR,
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/can/dev.c linux-libre-2.6.32.62-gnu1/drivers/net/can/dev.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/can/dev.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/can/dev.c	2014-05-19 01:54:39.000000000 -0400
@@ -595,12 +595,12 @@ static size_t can_get_size(const struct
 	size_t size;
 
 	size = nla_total_size(sizeof(u32));   /* IFLA_CAN_STATE */
-	size += sizeof(struct can_ctrlmode);  /* IFLA_CAN_CTRLMODE */
+	size += nla_total_size(sizeof(struct can_ctrlmode));  /* IFLA_CAN_CTRLMODE */
 	size += nla_total_size(sizeof(u32));  /* IFLA_CAN_RESTART_MS */
-	size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */
-	size += sizeof(struct can_clock);     /* IFLA_CAN_CLOCK */
+	size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */
+	size += nla_total_size(sizeof(struct can_clock));     /* IFLA_CAN_CLOCK */
 	if (priv->bittiming_const)	      /* IFLA_CAN_BITTIMING_CONST */
-		size += sizeof(struct can_bittiming_const);
+		size += nla_total_size(sizeof(struct can_bittiming_const));
 
 	return size;
 }
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/davinci_emac.c linux-libre-2.6.32.62-gnu1/drivers/net/davinci_emac.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/davinci_emac.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/davinci_emac.c	2014-05-19 01:54:39.000000000 -0400
@@ -960,7 +960,7 @@ static void emac_dev_mcast_set(struct ne
 			mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
 			emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
 		}
-		if (ndev->mc_count > 0) {
+		else if (ndev->mc_count > 0) {
 			struct dev_mc_list *mc_ptr;
 			mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
 			emac_add_mcast(priv, EMAC_ALL_MULTI_CLR, NULL);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/dummy.c linux-libre-2.6.32.62-gnu1/drivers/net/dummy.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/dummy.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/dummy.c	2014-05-19 01:54:39.000000000 -0400
@@ -137,11 +137,15 @@ static int __init dummy_init_module(void
 
 	rtnl_lock();
 	err = __rtnl_link_register(&dummy_link_ops);
+	if (err < 0)
+		goto out;
 
 	for (i = 0; i < numdummies && !err; i++)
 		err = dummy_init_one();
 	if (err < 0)
 		__rtnl_link_unregister(&dummy_link_ops);
+
+out:
 	rtnl_unlock();
 
 	return err;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/gianfar.c linux-libre-2.6.32.62-gnu1/drivers/net/gianfar.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/gianfar.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/gianfar.c	2014-05-19 01:54:39.000000000 -0400
@@ -365,7 +365,7 @@ static int gfar_probe(struct of_device *
 	priv->vlgrp = NULL;
 
 	if (priv->device_flags & FSL_GIANFAR_DEV_HAS_VLAN)
-		dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+		dev->features |= NETIF_F_HW_VLAN_RX;
 
 	if (priv->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) {
 		priv->extended_hash = 1;
@@ -1451,12 +1451,6 @@ static void gfar_vlan_rx_register(struct
 	priv->vlgrp = grp;
 
 	if (grp) {
-		/* Enable VLAN tag insertion */
-		tempval = gfar_read(&priv->regs->tctrl);
-		tempval |= TCTRL_VLINS;
-
-		gfar_write(&priv->regs->tctrl, tempval);
-
 		/* Enable VLAN tag extraction */
 		tempval = gfar_read(&priv->regs->rctrl);
 		tempval |= (RCTRL_VLEX | RCTRL_PRSDEP_INIT);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/hamradio/hdlcdrv.c linux-libre-2.6.32.62-gnu1/drivers/net/hamradio/hdlcdrv.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/hamradio/hdlcdrv.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/hamradio/hdlcdrv.c	2014-05-19 01:54:39.000000000 -0400
@@ -572,6 +572,8 @@ static int hdlcdrv_ioctl(struct net_devi
 	case HDLCDRVCTL_CALIBRATE:
 		if(!capable(CAP_SYS_RAWIO))
 			return -EPERM;
+		if (bi.data.calibrate > INT_MAX / s->par.bitrate)
+			return -EINVAL;
 		s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16;
 		return 0;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/hamradio/yam.c linux-libre-2.6.32.62-gnu1/drivers/net/hamradio/yam.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/hamradio/yam.c	2013-06-10 14:53:52.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/hamradio/yam.c	2014-05-20 09:27:34.000000000 -0400
@@ -1060,6 +1060,7 @@ static int yam_ioctl(struct net_device *
 		break;
 
 	case SIOCYAMGCFG:
+		memset(&yi, 0, sizeof(yi));
 		yi.cfg.mask = 0xffffffff;
 		yi.cfg.iobase = yp->iobase;
 		yi.cfg.irq = yp->irq;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/ifb.c linux-libre-2.6.32.62-gnu1/drivers/net/ifb.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/ifb.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/ifb.c	2014-05-19 01:54:39.000000000 -0400
@@ -33,6 +33,7 @@
 #include <linux/etherdevice.h>
 #include <linux/init.h>
 #include <linux/moduleparam.h>
+#include <linux/sched.h>
 #include <net/pkt_sched.h>
 #include <net/net_namespace.h>
 
@@ -268,11 +269,17 @@ static int __init ifb_init_module(void)
 
 	rtnl_lock();
 	err = __rtnl_link_register(&ifb_link_ops);
+	if (err < 0)
+		goto out;
 
-	for (i = 0; i < numifbs && !err; i++)
+	for (i = 0; i < numifbs && !err; i++) {
 		err = ifb_init_one(i);
+		cond_resched();
+	}
 	if (err)
 		__rtnl_link_unregister(&ifb_link_ops);
+
+out:
 	rtnl_unlock();
 
 	return err;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/ll_temac_main.c linux-libre-2.6.32.62-gnu1/drivers/net/ll_temac_main.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/ll_temac_main.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/ll_temac_main.c	2014-05-19 01:54:39.000000000 -0400
@@ -190,6 +190,12 @@ static int temac_dma_bd_init(struct net_
 		       lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
 	temac_dma_out32(lp, TX_CURDESC_PTR, lp->tx_bd_p);
 
+	/* Init descriptor indexes */
+	lp->tx_bd_ci = 0;
+	lp->tx_bd_next = 0;
+	lp->tx_bd_tail = 0;
+	lp->rx_bd_ci = 0;
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/pppoe.c linux-libre-2.6.32.62-gnu1/drivers/net/pppoe.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/pppoe.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/pppoe.c	2014-05-19 01:54:39.000000000 -0400
@@ -992,8 +992,6 @@ static int pppoe_recvmsg(struct kiocb *i
 	if (error < 0)
 		goto end;
 
-	m->msg_namelen = 0;
-
 	if (skb) {
 		total_len = min_t(size_t, total_len, skb->len);
 		error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/pppol2tp.c linux-libre-2.6.32.62-gnu1/drivers/net/pppol2tp.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/pppol2tp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/pppol2tp.c	2014-05-19 01:54:39.000000000 -0400
@@ -829,8 +829,6 @@ static int pppol2tp_recvmsg(struct kiocb
 	if (sk->sk_state & PPPOX_BOUND)
 		goto end;
 
-	msg->msg_namelen = 0;
-
 	err = 0;
 	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
 				flags & MSG_DONTWAIT, &err);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/sunvnet.c linux-libre-2.6.32.62-gnu1/drivers/net/sunvnet.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/sunvnet.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/sunvnet.c	2014-05-19 01:54:39.000000000 -0400
@@ -1260,6 +1260,8 @@ static int vnet_port_remove(struct vio_d
 		dev_set_drvdata(&vdev->dev, NULL);
 
 		kfree(port);
+
+		unregister_netdev(vp->dev);
 	}
 	return 0;
 }
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/tg3.c linux-libre-2.6.32.62-gnu1/drivers/net/tg3.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/tg3.c	2013-06-10 14:53:44.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/tg3.c	2014-05-20 09:27:27.000000000 -0400
@@ -4548,8 +4548,7 @@ static int tg3_rx(struct tg3_napi *tnapi
 
 		work_mask |= opaque_key;
 
-		if ((desc->err_vlan & RXD_ERR_MASK) != 0 &&
-		    (desc->err_vlan != RXD_ERR_ODD_NIBBLE_RCVD_MII)) {
+		if (desc->err_vlan & RXD_ERR_MASK) {
 		drop_it:
 			tg3_recycle_rx(tnapi, opaque_key,
 				       desc_idx, *post_ptr);
@@ -5574,12 +5573,12 @@ static int tg3_change_mtu(struct net_dev
 
 	tg3_netif_stop(tp);
 
+	tg3_set_mtu(dev, tp, new_mtu);
+
 	tg3_full_lock(tp, 1);
 
 	tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 
-	tg3_set_mtu(dev, tp, new_mtu);
-
 	err = tg3_restart_hw(tp, 0);
 
 	if (!err)
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/tg3.h linux-libre-2.6.32.62-gnu1/drivers/net/tg3.h
--- linux-libre-2.6.32.61-gnu1/drivers/net/tg3.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/tg3.h	2014-05-19 01:54:39.000000000 -0400
@@ -2219,7 +2219,11 @@ struct tg3_rx_buffer_desc {
 #define RXD_ERR_TOO_SMALL		0x00400000
 #define RXD_ERR_NO_RESOURCES		0x00800000
 #define RXD_ERR_HUGE_FRAME		0x01000000
-#define RXD_ERR_MASK			0xffff0000
+
+#define RXD_ERR_MASK	(RXD_ERR_BAD_CRC | RXD_ERR_COLLISION |		\
+			 RXD_ERR_LINK_LOST | RXD_ERR_PHY_DECODE |	\
+			 RXD_ERR_MAC_ABRT | RXD_ERR_TOO_SMALL |		\
+			 RXD_ERR_NO_RESOURCES | RXD_ERR_HUGE_FRAME)
 
 	u32				reserved;
 	u32				opaque;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/usb/dm9601.c linux-libre-2.6.32.62-gnu1/drivers/net/usb/dm9601.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/usb/dm9601.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/usb/dm9601.c	2014-05-19 01:54:39.000000000 -0400
@@ -382,7 +382,7 @@ static void dm9601_set_multicast(struct
 	if (net->flags & IFF_PROMISC) {
 		rx_ctl |= 0x02;
 	} else if (net->flags & IFF_ALLMULTI || net->mc_count > DM_MAX_MCAST) {
-		rx_ctl |= 0x04;
+		rx_ctl |= 0x08;
 	} else if (net->mc_count) {
 		struct dev_mc_list *mc_list = net->mc_list;
 		int i;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/virtio_net.c linux-libre-2.6.32.62-gnu1/drivers/net/virtio_net.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/virtio_net.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/virtio_net.c	2014-05-19 01:54:39.000000000 -0400
@@ -904,7 +904,8 @@ static int virtnet_probe(struct virtio_d
 	/* If we can receive ANY GSO packets, we must allocate large ones. */
 	if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4)
 	    || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6)
-	    || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN))
+	    || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN)
+	    || virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO))
 		vi->big_packets = true;
 
 	if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/wan/farsync.c linux-libre-2.6.32.62-gnu1/drivers/net/wan/farsync.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/wan/farsync.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/wan/farsync.c	2014-05-19 01:54:39.000000000 -0400
@@ -1971,6 +1971,7 @@ fst_get_iface(struct fst_card_info *card
 	}
 
 	i = port->index;
+	memset(&sync, 0, sizeof(sync));
 	sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed);
 	/* Lucky card and linux use same encoding here */
 	sync.clock_type = FST_RDB(card, portConfig[i].internalClock) ==
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/wan/wanxl.c linux-libre-2.6.32.62-gnu1/drivers/net/wan/wanxl.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/wan/wanxl.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/wan/wanxl.c	2014-05-19 01:54:39.000000000 -0400
@@ -354,6 +354,7 @@ static int wanxl_ioctl(struct net_device
 			ifr->ifr_settings.size = size; /* data size wanted */
 			return -ENOBUFS;
 		}
+		memset(&line, 0, sizeof(line));
 		line.clock_type = get_status(port)->clocking;
 		line.clock_rate = 0;
 		line.loopback = 0;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/wireless/b43/main.c linux-libre-2.6.32.62-gnu1/drivers/net/wireless/b43/main.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/wireless/b43/main.c	2013-06-10 14:54:19.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/wireless/b43/main.c	2014-05-20 09:28:01.000000000 -0400
@@ -2254,7 +2254,7 @@ static int b43_maybe_reject_firmware(str
 	for (i = 0; i < B43_NR_FWTYPES; i++) {
 		errmsg = ctx->errors[i];
 		if (strlen(errmsg))
-			b43err(dev->wl, errmsg);
+			b43err(dev->wl, "%s", errmsg);
 	}
 	b43_print_fw_helptext(dev->wl, 1);
 	err = -ENOENT;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/net/wireless/libertas/debugfs.c linux-libre-2.6.32.62-gnu1/drivers/net/wireless/libertas/debugfs.c
--- linux-libre-2.6.32.61-gnu1/drivers/net/wireless/libertas/debugfs.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/net/wireless/libertas/debugfs.c	2014-05-19 01:54:39.000000000 -0400
@@ -925,7 +925,10 @@ static ssize_t lbs_debugfs_write(struct
 	char *p2;
 	struct debug_data *d = (struct debug_data *)f->private_data;
 
-	pdata = kmalloc(cnt, GFP_KERNEL);
+	if (cnt == 0)
+		return 0;
+
+	pdata = kmalloc(cnt + 1, GFP_KERNEL);
 	if (pdata == NULL)
 		return 0;
 
@@ -934,6 +937,7 @@ static ssize_t lbs_debugfs_write(struct
 		kfree(pdata);
 		return 0;
 	}
+	pdata[cnt] = '\0';
 
 	p0 = pdata;
 	for (i = 0; i < num_of_items; i++) {
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/pci/intel-iommu.c linux-libre-2.6.32.62-gnu1/drivers/pci/intel-iommu.c
--- linux-libre-2.6.32.61-gnu1/drivers/pci/intel-iommu.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/pci/intel-iommu.c	2014-05-19 01:54:39.000000000 -0400
@@ -1434,6 +1434,10 @@ static void domain_exit(struct dmar_doma
 	if (!domain)
 		return;
 
+	/* Flush any lazy unmaps that may reference this domain */
+	if (!intel_iommu_strict)
+		flush_unmaps_timeout(0);
+
 	domain_remove_dev_info(domain);
 	/* destroy iovas */
 	put_iova_domain(&domain->iovad);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/s390/net/qeth_core_main.c linux-libre-2.6.32.62-gnu1/drivers/s390/net/qeth_core_main.c
--- linux-libre-2.6.32.61-gnu1/drivers/s390/net/qeth_core_main.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/s390/net/qeth_core_main.c	2014-05-19 01:54:39.000000000 -0400
@@ -3557,7 +3557,7 @@ int qeth_snmp_command(struct qeth_card *
 	struct qeth_cmd_buffer *iob;
 	struct qeth_ipa_cmd *cmd;
 	struct qeth_snmp_ureq *ureq;
-	int req_len;
+	unsigned int req_len;
 	struct qeth_arp_query_info qinfo = {0, };
 	int rc = 0;
 
@@ -3573,6 +3573,10 @@ int qeth_snmp_command(struct qeth_card *
 	/* skip 4 bytes (data_len struct member) to get req_len */
 	if (copy_from_user(&req_len, udata + sizeof(int), sizeof(int)))
 		return -EFAULT;
+	if (req_len > (QETH_BUFSIZE - IPA_PDU_HEADER_SIZE -
+		       sizeof(struct qeth_ipacmd_hdr) -
+		       sizeof(struct qeth_ipacmd_setadpparms_hdr)))
+		return -EINVAL;
 	ureq = kmalloc(req_len+sizeof(struct qeth_snmp_ureq_hdr), GFP_KERNEL);
 	if (!ureq) {
 		QETH_DBF_TEXT(TRACE, 2, "snmpnome");
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/scsi/aacraid/commctrl.c linux-libre-2.6.32.62-gnu1/drivers/scsi/aacraid/commctrl.c
--- linux-libre-2.6.32.61-gnu1/drivers/scsi/aacraid/commctrl.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/scsi/aacraid/commctrl.c	2014-05-19 01:54:39.000000000 -0400
@@ -507,7 +507,8 @@ static int aac_send_raw_srb(struct aac_d
 		goto cleanup;
 	}
 
-	if (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr))) {
+	if ((fibsize < (sizeof(struct user_aac_srb) - sizeof(struct user_sgentry))) ||
+	    (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr)))) {
 		rcode = -EINVAL;
 		goto cleanup;
 	}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/scsi/aacraid/linit.c linux-libre-2.6.32.62-gnu1/drivers/scsi/aacraid/linit.c
--- linux-libre-2.6.32.61-gnu1/drivers/scsi/aacraid/linit.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/scsi/aacraid/linit.c	2014-05-19 01:54:39.000000000 -0400
@@ -754,6 +754,8 @@ static long aac_compat_do_ioctl(struct a
 static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
 {
 	struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
+	if (!capable(CAP_SYS_RAWIO))
+		return -EPERM;
 	return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg);
 }
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/staging/comedi/drivers/ni_65xx.c linux-libre-2.6.32.62-gnu1/drivers/staging/comedi/drivers/ni_65xx.c
--- linux-libre-2.6.32.61-gnu1/drivers/staging/comedi/drivers/ni_65xx.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/staging/comedi/drivers/ni_65xx.c	2014-05-19 01:54:39.000000000 -0400
@@ -410,28 +410,25 @@ static int ni_65xx_dio_insn_bits(struct
 				 struct comedi_subdevice *s,
 				 struct comedi_insn *insn, unsigned int *data)
 {
-	unsigned base_bitfield_channel;
-	const unsigned max_ports_per_bitfield = 5;
+	int base_bitfield_channel;
 	unsigned read_bits = 0;
-	unsigned j;
+	int last_port_offset = ni_65xx_port_by_channel(s->n_chan - 1);
+	int port_offset;
+
 	if (insn->n != 2)
 		return -EINVAL;
 	base_bitfield_channel = CR_CHAN(insn->chanspec);
-	for (j = 0; j < max_ports_per_bitfield; ++j) {
-		const unsigned port_offset = ni_65xx_port_by_channel(base_bitfield_channel) + j;
-		const unsigned port =
-		    sprivate(s)->base_port + port_offset;
-		unsigned base_port_channel;
+	for (port_offset = ni_65xx_port_by_channel(base_bitfield_channel);
+	     port_offset <= last_port_offset; port_offset++) {
+		unsigned port = sprivate(s)->base_port + port_offset;
+		int base_port_channel = port_offset * ni_65xx_channels_per_port;
 		unsigned port_mask, port_data, port_read_bits;
-		int bitshift;
-		if (port >= ni_65xx_total_num_ports(board(dev)))
+		int bitshift = base_port_channel - base_bitfield_channel;
+
+		if (bitshift >= 32)
 			break;
-		base_port_channel = port_offset * ni_65xx_channels_per_port;
 		port_mask = data[0];
 		port_data = data[1];
-		bitshift = base_port_channel - base_bitfield_channel;
-		if (bitshift >= 32 || bitshift <= -32)
-			break;
 		if (bitshift > 0) {
 			port_mask >>= bitshift;
 			port_data >>= bitshift;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/uio/uio.c linux-libre-2.6.32.62-gnu1/drivers/uio/uio.c
--- linux-libre-2.6.32.61-gnu1/drivers/uio/uio.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/uio/uio.c	2014-05-19 01:54:39.000000000 -0400
@@ -669,16 +669,30 @@ static int uio_mmap_physical(struct vm_a
 {
 	struct uio_device *idev = vma->vm_private_data;
 	int mi = uio_find_mem_index(vma);
+	struct uio_mem *mem;
 	if (mi < 0)
 		return -EINVAL;
+	mem = idev->info->mem + mi;
+
+	if (vma->vm_end - vma->vm_start > mem->size)
+		return -EINVAL;
 
 	vma->vm_flags |= VM_IO | VM_RESERVED;
 
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
+	/*
+	 * We cannot use the vm_iomap_memory() helper here,
+	 * because vma->vm_pgoff is the map index we looked
+	 * up above in uio_find_mem_index(), rather than an
+	 * actual page offset into the mmap.
+	 *
+	 * So we just do the physical mmap without a page
+	 * offset.
+	 */
 	return remap_pfn_range(vma,
 			       vma->vm_start,
-			       idev->info->mem[mi].addr >> PAGE_SHIFT,
+			       mem->addr >> PAGE_SHIFT,
 			       vma->vm_end - vma->vm_start,
 			       vma->vm_page_prot);
 }
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/video/au1100fb.c linux-libre-2.6.32.62-gnu1/drivers/video/au1100fb.c
--- linux-libre-2.6.32.61-gnu1/drivers/video/au1100fb.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/video/au1100fb.c	2014-05-19 01:54:39.000000000 -0400
@@ -392,39 +392,15 @@ void au1100fb_fb_rotate(struct fb_info *
 int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
 {
 	struct au1100fb_device *fbdev;
-	unsigned int len;
-	unsigned long start=0, off;
 
 	fbdev = to_au1100fb_device(fbi);
 
-	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
-		return -EINVAL;
-	}
-
-	start = fbdev->fb_phys & PAGE_MASK;
-	len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len);
-
-	off = vma->vm_pgoff << PAGE_SHIFT;
-
-	if ((vma->vm_end - vma->vm_start + off) > len) {
-		return -EINVAL;
-	}
-
-	off += start;
-	vma->vm_pgoff = off >> PAGE_SHIFT;
-
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 	pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
 
 	vma->vm_flags |= VM_IO;
 
-	if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
-				vma->vm_end - vma->vm_start,
-				vma->vm_page_prot)) {
-		return -EAGAIN;
-	}
-
-	return 0;
+	return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len);
 }
 
 /* fb_cursor
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/drivers/video/au1200fb.c linux-libre-2.6.32.62-gnu1/drivers/video/au1200fb.c
--- linux-libre-2.6.32.61-gnu1/drivers/video/au1200fb.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/drivers/video/au1200fb.c	2014-05-19 01:54:39.000000000 -0400
@@ -1241,42 +1241,18 @@ static int au1200fb_fb_blank(int blank_m
  * method mainly to allow the use of the TLB streaming flag (CCA=6)
  */
 static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
-
 {
-	unsigned int len;
-	unsigned long start=0, off;
 	struct au1200fb_device *fbdev = (struct au1200fb_device *) info;
 
 #ifdef CONFIG_PM
 	au1xxx_pm_access(LCD_pm_dev);
 #endif
-
-	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
-		return -EINVAL;
-	}
-
-	start = fbdev->fb_phys & PAGE_MASK;
-	len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len);
-
-	off = vma->vm_pgoff << PAGE_SHIFT;
-
-	if ((vma->vm_end - vma->vm_start + off) > len) {
-		return -EINVAL;
-	}
-
-	off += start;
-	vma->vm_pgoff = off >> PAGE_SHIFT;
-
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 	pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */
 
 	vma->vm_flags |= VM_IO;
 
-	return io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
-				  vma->vm_end - vma->vm_start,
-				  vma->vm_page_prot);
-
-	return 0;
+	return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len);
 }
 
 static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/fs/exec.c linux-libre-2.6.32.62-gnu1/fs/exec.c
--- linux-libre-2.6.32.61-gnu1/fs/exec.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/fs/exec.c	2014-05-19 01:54:39.000000000 -0400
@@ -1793,6 +1793,12 @@ void set_dumpable(struct mm_struct *mm,
 	}
 }
 
+/*
+ * This returns the actual value of the suid_dumpable flag. For things
+ * that are using this for checking for privilege transitions, it must
+ * test against SUID_DUMP_USER rather than treating it as a boolean
+ * value.
+ */
 int get_dumpable(struct mm_struct *mm)
 {
 	int ret;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/fs/partitions/check.c linux-libre-2.6.32.62-gnu1/fs/partitions/check.c
--- linux-libre-2.6.32.61-gnu1/fs/partitions/check.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/fs/partitions/check.c	2014-05-19 01:54:39.000000000 -0400
@@ -476,7 +476,7 @@ void register_disk(struct gendisk *disk)
 
 	ddev->parent = disk->driverfs_dev;
 
-	dev_set_name(ddev, disk->disk_name);
+	dev_set_name(ddev, "%s", disk->disk_name);
 
 	/* delay uevents, until we scanned partition table */
 	dev_set_uevent_suppress(ddev, 1);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/fs/xfs/linux-2.6/xfs_ioctl32.c linux-libre-2.6.32.62-gnu1/fs/xfs/linux-2.6/xfs_ioctl32.c
--- linux-libre-2.6.32.61-gnu1/fs/xfs/linux-2.6/xfs_ioctl32.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/fs/xfs/linux-2.6/xfs_ioctl32.c	2014-05-19 01:54:39.000000000 -0400
@@ -361,7 +361,8 @@ xfs_compat_attrlist_by_handle(
 	if (copy_from_user(&al_hreq, arg,
 			   sizeof(compat_xfs_fsop_attrlist_handlereq_t)))
 		return -XFS_ERROR(EFAULT);
-	if (al_hreq.buflen > XATTR_LIST_MAX)
+	if (al_hreq.buflen < sizeof(struct attrlist) ||
+	    al_hreq.buflen > XATTR_LIST_MAX)
 		return -XFS_ERROR(EINVAL);
 
 	/*
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/fs/xfs/linux-2.6/xfs_ioctl.c linux-libre-2.6.32.62-gnu1/fs/xfs/linux-2.6/xfs_ioctl.c
--- linux-libre-2.6.32.61-gnu1/fs/xfs/linux-2.6/xfs_ioctl.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/fs/xfs/linux-2.6/xfs_ioctl.c	2014-05-19 01:54:39.000000000 -0400
@@ -410,7 +410,8 @@ xfs_attrlist_by_handle(
 		return -XFS_ERROR(EPERM);
 	if (copy_from_user(&al_hreq, arg, sizeof(xfs_fsop_attrlist_handlereq_t)))
 		return -XFS_ERROR(EFAULT);
-	if (al_hreq.buflen > XATTR_LIST_MAX)
+	if (al_hreq.buflen < sizeof(struct attrlist) ||
+	    al_hreq.buflen > XATTR_LIST_MAX)
 		return -XFS_ERROR(EINVAL);
 
 	/*
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/binfmts.h linux-libre-2.6.32.62-gnu1/include/linux/binfmts.h
--- linux-libre-2.6.32.61-gnu1/include/linux/binfmts.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/binfmts.h	2014-05-19 01:54:39.000000000 -0400
@@ -107,9 +107,6 @@ extern int flush_old_exec(struct linux_b
 extern void setup_new_exec(struct linux_binprm * bprm);
 
 extern int suid_dumpable;
-#define SUID_DUMP_DISABLE	0	/* No setuid dumping */
-#define SUID_DUMP_USER		1	/* Dump as user of process */
-#define SUID_DUMP_ROOT		2	/* Dump as root */
 
 /* Stack area protections */
 #define EXSTACK_DEFAULT   0	/* Whatever the arch defaults to */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/hid.h linux-libre-2.6.32.62-gnu1/include/linux/hid.h
--- linux-libre-2.6.32.61-gnu1/include/linux/hid.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/hid.h	2014-05-19 01:54:39.000000000 -0400
@@ -410,10 +410,12 @@ struct hid_report {
 	struct hid_device *device;			/* associated device */
 };
 
+#define HID_MAX_IDS 256
+
 struct hid_report_enum {
 	unsigned numbered;
 	struct list_head report_list;
-	struct hid_report *report_id_hash[256];
+	struct hid_report *report_id_hash[HID_MAX_IDS];
 };
 
 #define HID_REPORT_TYPES 3
@@ -691,6 +693,10 @@ int hidinput_find_field(struct hid_devic
 void hid_output_report(struct hid_report *report, __u8 *data);
 struct hid_device *hid_allocate_device(void);
 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
+struct hid_report *hid_validate_values(struct hid_device *hid,
+				       unsigned int type, unsigned int id,
+				       unsigned int field_index,
+				       unsigned int report_counts);
 int hid_check_keys_pressed(struct hid_device *hid);
 int hid_connect(struct hid_device *hid, unsigned int connect_mask);
 void hid_disconnect(struct hid_device *hid);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/icmpv6.h linux-libre-2.6.32.62-gnu1/include/linux/icmpv6.h
--- linux-libre-2.6.32.61-gnu1/include/linux/icmpv6.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/icmpv6.h	2014-05-19 01:54:39.000000000 -0400
@@ -123,6 +123,8 @@ static inline struct icmp6hdr *icmp6_hdr
 #define ICMPV6_NOT_NEIGHBOUR		2
 #define ICMPV6_ADDR_UNREACH		3
 #define ICMPV6_PORT_UNREACH		4
+#define ICMPV6_POLICY_FAIL		5
+#define ICMPV6_REJECT_ROUTE		6
 
 /*
  *	Codes for Time Exceeded
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/if_pppox.h linux-libre-2.6.32.62-gnu1/include/linux/if_pppox.h
--- linux-libre-2.6.32.61-gnu1/include/linux/if_pppox.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/if_pppox.h	2014-05-19 01:54:39.000000000 -0400
@@ -108,11 +108,11 @@ struct pppoe_tag {
 
 struct pppoe_hdr {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
-	__u8 ver : 4;
 	__u8 type : 4;
+	__u8 ver : 4;
 #elif defined(__BIG_ENDIAN_BITFIELD)
-	__u8 type : 4;
 	__u8 ver : 4;
+	__u8 type : 4;
 #else
 #error	"Please fix <asm/byteorder.h>"
 #endif
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/ipv6.h linux-libre-2.6.32.62-gnu1/include/linux/ipv6.h
--- linux-libre-2.6.32.61-gnu1/include/linux/ipv6.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/ipv6.h	2014-05-19 01:54:39.000000000 -0400
@@ -248,6 +248,7 @@ struct inet6_skb_parm {
 
 #define IP6SKB_XFRM_TRANSFORMED	1
 #define IP6SKB_FORWARDED	2
+#define IP6SKB_FRAGMENTED      16
 };
 
 #define IP6CB(skb)	((struct inet6_skb_parm*)((skb)->cb))
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/mm.h linux-libre-2.6.32.62-gnu1/include/linux/mm.h
--- linux-libre-2.6.32.61-gnu1/include/linux/mm.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/mm.h	2014-05-19 01:54:39.000000000 -0400
@@ -1243,6 +1243,8 @@ int vm_insert_pfn(struct vm_area_struct
 			unsigned long pfn);
 int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
 			unsigned long pfn);
+int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
+
 
 struct page *follow_page(struct vm_area_struct *, unsigned long address,
 			unsigned int foll_flags);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/net.h linux-libre-2.6.32.62-gnu1/include/linux/net.h
--- linux-libre-2.6.32.61-gnu1/include/linux/net.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/net.h	2014-05-19 01:54:39.000000000 -0400
@@ -187,6 +187,14 @@ struct proto_ops {
 				      int optname, char __user *optval, int __user *optlen);
 	int		(*sendmsg)   (struct kiocb *iocb, struct socket *sock,
 				      struct msghdr *m, size_t total_len);
+	/* Notes for implementing recvmsg:
+	 * ===============================
+	 * msg->msg_namelen should get updated by the recvmsg handlers
+	 * iff msg_name != NULL. It is by default 0 to prevent
+	 * returning uninitialized memory to user space.  The recvfrom
+	 * handlers can assume that msg.msg_name is either NULL or has
+	 * a minimum size of sizeof(struct sockaddr_storage).
+	 */
 	int		(*recvmsg)   (struct kiocb *iocb, struct socket *sock,
 				      struct msghdr *m, size_t total_len,
 				      int flags);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/sched.h linux-libre-2.6.32.62-gnu1/include/linux/sched.h
--- linux-libre-2.6.32.61-gnu1/include/linux/sched.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/sched.h	2014-05-19 01:54:39.000000000 -0400
@@ -442,6 +442,10 @@ static inline unsigned long get_mm_hiwat
 extern void set_dumpable(struct mm_struct *mm, int value);
 extern int get_dumpable(struct mm_struct *mm);
 
+#define SUID_DUMP_DISABLE	0	/* No setuid dumping */
+#define SUID_DUMP_USER		1	/* Dump as user of process */
+#define SUID_DUMP_ROOT		2	/* Dump as root */
+
 /* mm flags */
 /* dumpable bits */
 #define MMF_DUMPABLE      0  /* core dump is permitted */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/linux/skbuff.h linux-libre-2.6.32.62-gnu1/include/linux/skbuff.h
--- linux-libre-2.6.32.61-gnu1/include/linux/skbuff.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/linux/skbuff.h	2014-05-19 01:54:39.000000000 -0400
@@ -641,6 +641,16 @@ static inline int skb_cloned(const struc
 	       (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1;
 }
 
+static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
+{
+	might_sleep_if(pri & __GFP_WAIT);
+
+	if (skb_cloned(skb))
+		return pskb_expand_head(skb, 0, 0, pri);
+
+	return 0;
+}
+
 /**
  *	skb_header_cloned - is the header a clone
  *	@skb: buffer to check
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/net/dst.h linux-libre-2.6.32.62-gnu1/include/net/dst.h
--- linux-libre-2.6.32.61-gnu1/include/net/dst.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/net/dst.h	2014-05-19 01:54:39.000000000 -0400
@@ -286,11 +286,22 @@ static inline int __xfrm_lookup(struct n
 {
 	return 0;
 }
+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
+{
+	return NULL;
+}
+
 #else
 extern int xfrm_lookup(struct net *net, struct dst_entry **dst_p,
 		       struct flowi *fl, struct sock *sk, int flags);
 extern int __xfrm_lookup(struct net *net, struct dst_entry **dst_p,
 			 struct flowi *fl, struct sock *sk, int flags);
+
+/* skb attached with this dst needs transformation if dst->xfrm is valid */
+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
+{
+	return dst->xfrm;
+}
 #endif
 #endif
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/net/ip.h linux-libre-2.6.32.62-gnu1/include/net/ip.h
--- linux-libre-2.6.32.61-gnu1/include/net/ip.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/net/ip.h	2014-05-19 01:54:39.000000000 -0400
@@ -391,7 +391,7 @@ extern int	compat_ip_getsockopt(struct s
 			int optname, char __user *optval, int __user *optlen);
 extern int	ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct sock *));
 
-extern int 	ip_recv_error(struct sock *sk, struct msghdr *msg, int len);
+extern int 	ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len);
 extern void	ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, 
 			      __be16 port, u32 info, u8 *payload);
 extern void	ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/net/ipv6.h linux-libre-2.6.32.62-gnu1/include/net/ipv6.h
--- linux-libre-2.6.32.61-gnu1/include/net/ipv6.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/net/ipv6.h	2014-05-19 01:54:39.000000000 -0400
@@ -567,7 +567,8 @@ extern int			compat_ipv6_getsockopt(stru
 extern int			ip6_datagram_connect(struct sock *sk, 
 						     struct sockaddr *addr, int addr_len);
 
-extern int 			ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
+extern int 			ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
+						int *addr_len);
 extern void			ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
 						u32 info, u8 *payload);
 extern void			ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/net/sctp/command.h linux-libre-2.6.32.62-gnu1/include/net/sctp/command.h
--- linux-libre-2.6.32.61-gnu1/include/net/sctp/command.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/net/sctp/command.h	2014-05-19 01:54:39.000000000 -0400
@@ -108,6 +108,7 @@ typedef enum {
 	SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
 	SCTP_CMD_SEND_MSG,	 /* Send the whole use message */
 	SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
+	SCTP_CMD_SET_ASOC,	 /* Restore association context */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/net/udp.h linux-libre-2.6.32.62-gnu1/include/net/udp.h
--- linux-libre-2.6.32.61-gnu1/include/net/udp.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/net/udp.h	2014-05-19 01:54:39.000000000 -0400
@@ -134,6 +134,7 @@ extern void	udp_err(struct sk_buff *, u3
 
 extern int	udp_sendmsg(struct kiocb *iocb, struct sock *sk,
 			    struct msghdr *msg, size_t len);
+extern int udp_push_pending_frames(struct sock *sk);
 extern void	udp_flush_pending_frames(struct sock *sk);
 
 extern int	udp_rcv(struct sk_buff *skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/include/scsi/scsi_netlink.h linux-libre-2.6.32.62-gnu1/include/scsi/scsi_netlink.h
--- linux-libre-2.6.32.61-gnu1/include/scsi/scsi_netlink.h	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/include/scsi/scsi_netlink.h	2014-05-19 01:54:39.000000000 -0400
@@ -23,7 +23,7 @@
 #define SCSI_NETLINK_H
 
 #include <linux/netlink.h>
-
+#include <linux/types.h>
 
 /*
  * This file intended to be included by both kernel and user space
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/kernel/kmod.c linux-libre-2.6.32.62-gnu1/kernel/kmod.c
--- linux-libre-2.6.32.61-gnu1/kernel/kmod.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/kernel/kmod.c	2014-05-19 01:54:39.000000000 -0400
@@ -560,6 +560,10 @@ int call_usermodehelper_exec(struct subp
 	BUG_ON(atomic_read(&sub_info->cred->usage) != 1);
 	validate_creds(sub_info->cred);
 
+	if (!sub_info->path) {
+		call_usermodehelper_freeinfo(sub_info);
+		return -EINVAL;
+	}
 	helper_lock();
 	if (sub_info->path[0] == '\0')
 		goto out;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/kernel/ptrace.c linux-libre-2.6.32.62-gnu1/kernel/ptrace.c
--- linux-libre-2.6.32.61-gnu1/kernel/ptrace.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/kernel/ptrace.c	2014-05-19 01:54:39.000000000 -0400
@@ -187,7 +187,7 @@ int __ptrace_may_access(struct task_stru
 	smp_rmb();
 	if (task->mm)
 		dumpable = get_dumpable(task->mm);
-	if (!dumpable && !capable(CAP_SYS_PTRACE))
+	if (dumpable != SUID_DUMP_USER && !capable(CAP_SYS_PTRACE))
 		return -EPERM;
 
 	return security_ptrace_access_check(task, mode);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/kernel/softirq.c linux-libre-2.6.32.62-gnu1/kernel/softirq.c
--- linux-libre-2.6.32.61-gnu1/kernel/softirq.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/kernel/softirq.c	2014-05-19 01:54:39.000000000 -0400
@@ -194,8 +194,12 @@ void local_bh_enable_ip(unsigned long ip
 EXPORT_SYMBOL(local_bh_enable_ip);
 
 /*
- * We restart softirq processing for at most 2 ms,
- * and if need_resched() is not set.
+ * We restart softirq processing for at most MAX_SOFTIRQ_RESTART times,
+ * but break the loop if need_resched() is set or after 2 ms.
+ * The MAX_SOFTIRQ_TIME provides a nice upper bound in most cases, but in
+ * certain cases, such as stop_machine(), jiffies may cease to
+ * increment and so we need the MAX_SOFTIRQ_RESTART limit as
+ * well to make sure we eventually return from this method.
  *
  * These limits have been established via experimentation.
  * The two things to balance is latency against fairness -
@@ -203,6 +207,7 @@ EXPORT_SYMBOL(local_bh_enable_ip);
  * should not be able to lock up the box.
  */
 #define MAX_SOFTIRQ_TIME  msecs_to_jiffies(2)
+#define MAX_SOFTIRQ_RESTART 10
 
 asmlinkage void __do_softirq(void)
 {
@@ -210,6 +215,7 @@ asmlinkage void __do_softirq(void)
 	__u32 pending;
 	unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
 	int cpu;
+	int max_restart = MAX_SOFTIRQ_RESTART;
 
 	pending = local_softirq_pending();
 	account_system_vtime(current);
@@ -254,7 +260,8 @@ restart:
 
 	pending = local_softirq_pending();
 	if (pending) {
-		if (time_before(jiffies, end) && !need_resched())
+		if (time_before(jiffies, end) && !need_resched() &&
+		    --max_restart)
 			goto restart;
 
 		wakeup_softirqd();
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/lib/nlattr.c linux-libre-2.6.32.62-gnu1/lib/nlattr.c
--- linux-libre-2.6.32.61-gnu1/lib/nlattr.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/lib/nlattr.c	2014-05-19 01:54:39.000000000 -0400
@@ -299,9 +299,15 @@ int nla_memcmp(const struct nlattr *nla,
  */
 int nla_strcmp(const struct nlattr *nla, const char *str)
 {
-	int len = strlen(str) + 1;
-	int d = nla_len(nla) - len;
+	int len = strlen(str);
+	char *buf = nla_data(nla);
+	int attrlen = nla_len(nla);
+	int d;
 
+	if (attrlen > 0 && buf[attrlen - 1] == '\0')
+		attrlen--;
+
+	d = attrlen - len;
 	if (d == 0)
 		d = memcmp(nla_data(nla), str, len);
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/lib/random32.c linux-libre-2.6.32.62-gnu1/lib/random32.c
--- linux-libre-2.6.32.61-gnu1/lib/random32.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/lib/random32.c	2014-05-19 01:54:39.000000000 -0400
@@ -96,7 +96,7 @@ void srandom32(u32 entropy)
 	 */
 	for_each_possible_cpu (i) {
 		struct rnd_state *state = &per_cpu(net_rand_state, i);
-		state->s1 = __seed(state->s1 ^ entropy, 1);
+		state->s1 = __seed(state->s1 ^ entropy, 2);
 	}
 }
 EXPORT_SYMBOL(srandom32);
@@ -113,9 +113,9 @@ static int __init random32_init(void)
 		struct rnd_state *state = &per_cpu(net_rand_state,i);
 
 #define LCG(x)	((x) * 69069)	/* super-duper LCG */
-		state->s1 = __seed(LCG(i + jiffies), 1);
-		state->s2 = __seed(LCG(state->s1), 7);
-		state->s3 = __seed(LCG(state->s2), 15);
+		state->s1 = __seed(LCG(i + jiffies), 2);
+		state->s2 = __seed(LCG(state->s1), 8);
+		state->s3 = __seed(LCG(state->s2), 16);
 
 		/* "warm it up" */
 		__random32(state);
@@ -142,9 +142,9 @@ static int __init random32_reseed(void)
 		u32 seeds[3];
 
 		get_random_bytes(&seeds, sizeof(seeds));
-		state->s1 = __seed(seeds[0], 1);
-		state->s2 = __seed(seeds[1], 7);
-		state->s3 = __seed(seeds[2], 15);
+		state->s1 = __seed(seeds[0], 2);
+		state->s2 = __seed(seeds[1], 8);
+		state->s3 = __seed(seeds[2], 16);
 
 		/* mix it in */
 		__random32(state);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/Makefile linux-libre-2.6.32.62-gnu1/Makefile
--- linux-libre-2.6.32.61-gnu1/Makefile	2013-06-10 14:49:36.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/Makefile	2014-05-20 09:23:07.000000000 -0400
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 32
-EXTRAVERSION = .61-gnu1
+EXTRAVERSION = .62-gnu1
 NAME = Man-Eating Seals of Antiquity
 
 # *DOCUMENTATION*
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/mm/memory.c linux-libre-2.6.32.62-gnu1/mm/memory.c
--- linux-libre-2.6.32.61-gnu1/mm/memory.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/mm/memory.c	2014-05-19 01:54:39.000000000 -0400
@@ -1811,6 +1811,53 @@ int remap_pfn_range(struct vm_area_struc
 }
 EXPORT_SYMBOL(remap_pfn_range);
 
+/**
+ * vm_iomap_memory - remap memory to userspace
+ * @vma: user vma to map to
+ * @start: start of area
+ * @len: size of area
+ *
+ * This is a simplified io_remap_pfn_range() for common driver use. The
+ * driver just needs to give us the physical memory range to be mapped,
+ * we'll figure out the rest from the vma information.
+ *
+ * NOTE! Some drivers might want to tweak vma->vm_page_prot first to get
+ * whatever write-combining details or similar.
+ */
+int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len)
+{
+	unsigned long vm_len, pfn, pages;
+
+	/* Check that the physical memory area passed in looks valid */
+	if (start + len < start)
+		return -EINVAL;
+	/*
+	 * You *really* shouldn't map things that aren't page-aligned,
+	 * but we've historically allowed it because IO memory might
+	 * just have smaller alignment.
+	 */
+	len += start & ~PAGE_MASK;
+	pfn = start >> PAGE_SHIFT;
+	pages = (len + ~PAGE_MASK) >> PAGE_SHIFT;
+	if (pfn + pages < pfn)
+		return -EINVAL;
+
+	/* We start the mapping 'vm_pgoff' pages into the area */
+	if (vma->vm_pgoff > pages)
+		return -EINVAL;
+	pfn += vma->vm_pgoff;
+	pages -= vma->vm_pgoff;
+
+	/* Can we fit all of the mapping? */
+	vm_len = vma->vm_end - vma->vm_start;
+	if (vm_len >> PAGE_SHIFT > pages)
+		return -EINVAL;
+
+	/* Ok, let it rip */
+	return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot);
+}
+EXPORT_SYMBOL(vm_iomap_memory);
+
 static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
 				     unsigned long addr, unsigned long end,
 				     pte_fn_t fn, void *data)
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/8021q/vlan_dev.c linux-libre-2.6.32.62-gnu1/net/8021q/vlan_dev.c
--- linux-libre-2.6.32.61-gnu1/net/8021q/vlan_dev.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/8021q/vlan_dev.c	2014-05-19 01:54:39.000000000 -0400
@@ -220,6 +220,8 @@ vlan_dev_get_egress_qos_mask(struct net_
 {
 	struct vlan_priority_tci_mapping *mp;
 
+	smp_rmb(); /* coupled with smp_wmb() in vlan_dev_set_egress_priority() */
+
 	mp = vlan_dev_info(dev)->egress_priority_map[(skb->priority & 0xF)];
 	while (mp) {
 		if (mp->priority == skb->priority) {
@@ -418,6 +420,11 @@ int vlan_dev_set_egress_priority(const s
 	np->next = mp;
 	np->priority = skb_prio;
 	np->vlan_qos = vlan_qos;
+	/* Before inserting this element in hash table, make sure all its fields
+	 * are committed to memory.
+	 * coupled with smp_rmb() in vlan_dev_get_egress_qos_mask()
+	 */
+	smp_wmb();
 	vlan->egress_priority_map[skb_prio & 0xF] = np;
 	if (vlan_qos)
 		vlan->nr_egress_mappings++;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/8021q/vlan_netlink.c linux-libre-2.6.32.62-gnu1/net/8021q/vlan_netlink.c
--- linux-libre-2.6.32.61-gnu1/net/8021q/vlan_netlink.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/8021q/vlan_netlink.c	2014-05-19 01:54:39.000000000 -0400
@@ -169,7 +169,7 @@ static size_t vlan_get_size(const struct
 	struct vlan_dev_info *vlan = vlan_dev_info(dev);
 
 	return nla_total_size(2) +	/* IFLA_VLAN_ID */
-	       sizeof(struct ifla_vlan_flags) + /* IFLA_VLAN_FLAGS */
+	       nla_total_size(sizeof(struct ifla_vlan_flags)) + /* IFLA_VLAN_FLAGS */
 	       vlan_qos_map_size(vlan->nr_ingress_mappings) +
 	       vlan_qos_map_size(vlan->nr_egress_mappings);
 }
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/appletalk/ddp.c linux-libre-2.6.32.62-gnu1/net/appletalk/ddp.c
--- linux-libre-2.6.32.61-gnu1/net/appletalk/ddp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/appletalk/ddp.c	2014-05-19 01:54:39.000000000 -0400
@@ -1703,7 +1703,6 @@ static int atalk_recvmsg(struct kiocb *i
 			 size_t size, int flags)
 {
 	struct sock *sk = sock->sk;
-	struct sockaddr_at *sat = (struct sockaddr_at *)msg->msg_name;
 	struct ddpehdr *ddp;
 	int copied = 0;
 	int offset = 0;
@@ -1728,14 +1727,13 @@ static int atalk_recvmsg(struct kiocb *i
 	}
 	err = skb_copy_datagram_iovec(skb, offset, msg->msg_iov, copied);
 
-	if (!err) {
-		if (sat) {
-			sat->sat_family      = AF_APPLETALK;
-			sat->sat_port        = ddp->deh_sport;
-			sat->sat_addr.s_node = ddp->deh_snode;
-			sat->sat_addr.s_net  = ddp->deh_snet;
-		}
-		msg->msg_namelen = sizeof(*sat);
+	if (!err && msg->msg_name) {
+		struct sockaddr_at *sat = msg->msg_name;
+		sat->sat_family      = AF_APPLETALK;
+		sat->sat_port        = ddp->deh_sport;
+		sat->sat_addr.s_node = ddp->deh_snode;
+		sat->sat_addr.s_net  = ddp->deh_snet;
+		msg->msg_namelen     = sizeof(*sat);
 	}
 
 	skb_free_datagram(sk, skb);	/* Free the datagram. */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/atm/common.c linux-libre-2.6.32.62-gnu1/net/atm/common.c
--- linux-libre-2.6.32.61-gnu1/net/atm/common.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/atm/common.c	2014-05-19 01:54:39.000000000 -0400
@@ -473,8 +473,6 @@ int vcc_recvmsg(struct kiocb *iocb, stru
 	struct sk_buff *skb;
 	int copied, error = -EINVAL;
 
-	msg->msg_namelen = 0;
-
 	if (sock->state != SS_CONNECTED)
 		return -ENOTCONN;
 	if (flags & ~MSG_DONTWAIT)		/* only handle MSG_DONTWAIT */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ax25/af_ax25.c linux-libre-2.6.32.62-gnu1/net/ax25/af_ax25.c
--- linux-libre-2.6.32.61-gnu1/net/ax25/af_ax25.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ax25/af_ax25.c	2014-05-19 01:54:39.000000000 -0400
@@ -1648,11 +1648,11 @@ static int ax25_recvmsg(struct kiocb *io
 
 	skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
 
-	if (msg->msg_namelen != 0) {
-		struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name;
+	if (msg->msg_name) {
 		ax25_digi digi;
 		ax25_address src;
 		const unsigned char *mac = skb_mac_header(skb);
+		struct sockaddr_ax25 *sax = msg->msg_name;
 
 		memset(sax, 0, sizeof(struct full_sockaddr_ax25));
 		ax25_addr_parse(mac + 1, skb->data - mac - 1, &src, NULL,
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/bluetooth/af_bluetooth.c linux-libre-2.6.32.62-gnu1/net/bluetooth/af_bluetooth.c
--- linux-libre-2.6.32.61-gnu1/net/bluetooth/af_bluetooth.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/bluetooth/af_bluetooth.c	2014-05-19 01:54:39.000000000 -0400
@@ -240,8 +240,6 @@ int bt_sock_recvmsg(struct kiocb *iocb,
 	if (flags & (MSG_OOB))
 		return -EOPNOTSUPP;
 
-	msg->msg_namelen = 0;
-
 	if (!(skb = skb_recv_datagram(sk, flags, noblock, &err))) {
 		if (sk->sk_shutdown & RCV_SHUTDOWN)
 			return 0;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/bluetooth/hci_sock.c linux-libre-2.6.32.62-gnu1/net/bluetooth/hci_sock.c
--- linux-libre-2.6.32.61-gnu1/net/bluetooth/hci_sock.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/bluetooth/hci_sock.c	2014-05-19 01:54:39.000000000 -0400
@@ -370,8 +370,6 @@ static int hci_sock_recvmsg(struct kiocb
 	if (!(skb = skb_recv_datagram(sk, flags, noblock, &err)))
 		return err;
 
-	msg->msg_namelen = 0;
-
 	copied = skb->len;
 	if (len < copied) {
 		msg->msg_flags |= MSG_TRUNC;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/bluetooth/rfcomm/sock.c linux-libre-2.6.32.62-gnu1/net/bluetooth/rfcomm/sock.c
--- linux-libre-2.6.32.61-gnu1/net/bluetooth/rfcomm/sock.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/bluetooth/rfcomm/sock.c	2014-05-19 01:54:39.000000000 -0400
@@ -652,15 +652,12 @@ static int rfcomm_sock_recvmsg(struct ki
 
 	if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) {
 		rfcomm_dlc_accept(d);
-		msg->msg_namelen = 0;
 		return 0;
 	}
 
 	if (flags & MSG_OOB)
 		return -EOPNOTSUPP;
 
-	msg->msg_namelen = 0;
-
 	BT_DBG("sk %p size %zu", sk, size);
 
 	lock_sock(sk);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/bridge/br_if.c linux-libre-2.6.32.62-gnu1/net/bridge/br_if.c
--- linux-libre-2.6.32.61-gnu1/net/bridge/br_if.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/bridge/br_if.c	2014-05-19 01:54:39.000000000 -0400
@@ -162,6 +162,8 @@ static void del_br(struct net_bridge *br
 		del_nbp(p);
 	}
 
+	br_fdb_delete_by_port(br, NULL, 1);
+
 	del_timer_sync(&br->gc_timer);
 
 	br_sysfs_delbr(br->dev);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/bridge/br_stp.c linux-libre-2.6.32.62-gnu1/net/bridge/br_stp.c
--- linux-libre-2.6.32.61-gnu1/net/bridge/br_stp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/bridge/br_stp.c	2014-05-19 01:54:39.000000000 -0400
@@ -192,7 +192,7 @@ static inline void br_record_config_info
 	p->designated_age = jiffies + bpdu->message_age;
 
 	mod_timer(&p->message_age_timer, jiffies
-		  + (p->br->max_age - bpdu->message_age));
+		  + (bpdu->max_age - bpdu->message_age));
 }
 
 /* called under bridge lock */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/compat.c linux-libre-2.6.32.62-gnu1/net/compat.c
--- linux-libre-2.6.32.61-gnu1/net/compat.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/compat.c	2014-05-19 01:54:39.000000000 -0400
@@ -69,6 +69,8 @@ int get_compat_msghdr(struct msghdr *kms
 	    __get_user(kmsg->msg_controllen, &umsg->msg_controllen) ||
 	    __get_user(kmsg->msg_flags, &umsg->msg_flags))
 		return -EFAULT;
+	if (kmsg->msg_namelen > sizeof(struct sockaddr_storage))
+		kmsg->msg_namelen = sizeof(struct sockaddr_storage);
 	kmsg->msg_name = compat_ptr(tmp1);
 	kmsg->msg_iov = compat_ptr(tmp2);
 	kmsg->msg_control = compat_ptr(tmp3);
@@ -89,7 +91,8 @@ int verify_compat_iovec(struct msghdr *k
 			if (err < 0)
 				return err;
 		}
-		kern_msg->msg_name = kern_address;
+		if (kern_msg->msg_name)
+			kern_msg->msg_name = kern_address;
 	} else
 		kern_msg->msg_name = NULL;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/dev.c linux-libre-2.6.32.62-gnu1/net/core/dev.c
--- linux-libre-2.6.32.61-gnu1/net/core/dev.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/dev.c	2014-05-19 01:54:39.000000000 -0400
@@ -3388,7 +3388,7 @@ static void dev_change_rx_flags(struct n
 {
 	const struct net_device_ops *ops = dev->netdev_ops;
 
-	if ((dev->flags & IFF_UP) && ops->ndo_change_rx_flags)
+	if (ops->ndo_change_rx_flags)
 		ops->ndo_change_rx_flags(dev, flags);
 }
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/drop_monitor.c linux-libre-2.6.32.62-gnu1/net/core/drop_monitor.c
--- linux-libre-2.6.32.61-gnu1/net/core/drop_monitor.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/drop_monitor.c	2014-05-19 01:54:39.000000000 -0400
@@ -63,7 +63,6 @@ static struct genl_family net_drop_monit
 	.hdrsize        = 0,
 	.name           = "NET_DM",
 	.version        = 2,
-	.maxattr        = NET_DM_CMD_MAX,
 };
 
 static DEFINE_PER_CPU(struct per_cpu_dm_data, dm_cpu_data);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/fib_rules.c linux-libre-2.6.32.62-gnu1/net/core/fib_rules.c
--- linux-libre-2.6.32.61-gnu1/net/core/fib_rules.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/fib_rules.c	2014-05-19 01:54:39.000000000 -0400
@@ -381,7 +381,8 @@ static int fib_nl_delrule(struct sk_buff
 		if (frh->action && (frh->action != rule->action))
 			continue;
 
-		if (frh->table && (frh_get_table(frh, tb) != rule->table))
+		if (frh_get_table(frh, tb) &&
+		    (frh_get_table(frh, tb) != rule->table))
 			continue;
 
 		if (tb[FRA_PRIORITY] &&
@@ -632,6 +633,13 @@ static int fib_rules_event(struct notifi
 			attach_rules(&ops->rules_list, dev);
 		break;
 
+	case NETDEV_CHANGENAME:
+		list_for_each_entry(ops, &net->rules_ops, list) {
+			detach_rules(&ops->rules_list, dev);
+			attach_rules(&ops->rules_list, dev);
+		}
+		break;
+
 	case NETDEV_UNREGISTER:
 		list_for_each_entry(ops, &net->rules_ops, list)
 			detach_rules(&ops->rules_list, dev);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/iovec.c linux-libre-2.6.32.62-gnu1/net/core/iovec.c
--- linux-libre-2.6.32.61-gnu1/net/core/iovec.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/iovec.c	2014-05-19 01:54:39.000000000 -0400
@@ -47,7 +47,8 @@ int verify_iovec(struct msghdr *m, struc
 			if (err < 0)
 				return err;
 		}
-		m->msg_name = address;
+		if (m->msg_name)
+			m->msg_name = address;
 	} else {
 		m->msg_name = NULL;
 	}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/neighbour.c linux-libre-2.6.32.62-gnu1/net/core/neighbour.c
--- linux-libre-2.6.32.61-gnu1/net/core/neighbour.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/neighbour.c	2014-05-19 01:54:39.000000000 -0400
@@ -222,7 +222,7 @@ static void neigh_flush_dev(struct neigh
 				   we must kill timers etc. and move
 				   it to safe state.
 				 */
-				skb_queue_purge(&n->arp_queue);
+				__skb_queue_purge(&n->arp_queue);
 				n->output = neigh_blackhole;
 				if (n->nud_state & NUD_VALID)
 					n->nud_state = NUD_NOARP;
@@ -276,7 +276,7 @@ static struct neighbour *neigh_alloc(str
 	if (!n)
 		goto out_entries;
 
-	skb_queue_head_init(&n->arp_queue);
+	__skb_queue_head_init(&n->arp_queue);
 	rwlock_init(&n->lock);
 	n->updated	  = n->used = now;
 	n->nud_state	  = NUD_NONE;
@@ -646,7 +646,9 @@ void neigh_destroy(struct neighbour *nei
 			kfree(hh);
 	}
 
-	skb_queue_purge(&neigh->arp_queue);
+	write_lock_bh(&neigh->lock);
+	__skb_queue_purge(&neigh->arp_queue);
+	write_unlock_bh(&neigh->lock);
 
 	dev_put(neigh->dev);
 	neigh_parms_put(neigh->parms);
@@ -789,7 +791,7 @@ static void neigh_invalidate(struct neig
 		neigh->ops->error_report(neigh, skb);
 		write_lock(&neigh->lock);
 	}
-	skb_queue_purge(&neigh->arp_queue);
+	__skb_queue_purge(&neigh->arp_queue);
 }
 
 /* Called when a timer expires for a neighbour entry. */
@@ -1105,7 +1107,7 @@ int neigh_update(struct neighbour *neigh
 			n1->output(skb);
 			write_lock_bh(&neigh->lock);
 		}
-		skb_queue_purge(&neigh->arp_queue);
+		__skb_queue_purge(&neigh->arp_queue);
 	}
 out:
 	if (update_isrouter) {
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/pktgen.c linux-libre-2.6.32.62-gnu1/net/core/pktgen.c
--- linux-libre-2.6.32.61-gnu1/net/core/pktgen.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/pktgen.c	2014-05-19 01:54:39.000000000 -0400
@@ -2495,6 +2495,8 @@ static int process_ipsec(struct pktgen_d
 		if (x) {
 			int ret;
 			__u8 *eth;
+			struct iphdr *iph;
+
 			nhead = x->props.header_len - skb_headroom(skb);
 			if (nhead > 0) {
 				ret = pskb_expand_head(skb, nhead, 0, GFP_ATOMIC);
@@ -2517,6 +2519,11 @@ static int process_ipsec(struct pktgen_d
 			eth = (__u8 *) skb_push(skb, ETH_HLEN);
 			memcpy(eth, pkt_dev->hh, 12);
 			*(u16 *) &eth[12] = protocol;
+
+			/* Update IPv4 header len as well as checksum value */
+			iph = ip_hdr(skb);
+			iph->tot_len = htons(skb->len - ETH_HLEN);
+			ip_send_check(iph);
 		}
 	}
 	return 1;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/core/sysctl_net_core.c linux-libre-2.6.32.62-gnu1/net/core/sysctl_net_core.c
--- linux-libre-2.6.32.61-gnu1/net/core/sysctl_net_core.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/core/sysctl_net_core.c	2014-05-19 01:54:39.000000000 -0400
@@ -14,6 +14,9 @@
 #include <net/ip.h>
 #include <net/sock.h>
 
+static int zero = 0;
+static int ushort_max = 65535;
+
 static struct ctl_table net_core_table[] = {
 #ifdef CONFIG_NET
 	{
@@ -116,7 +119,9 @@ static struct ctl_table netns_core_table
 		.data		= &init_net.core.sysctl_somaxconn,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec
+		.extra1		= &zero,
+		.extra2		= &ushort_max,
+		.proc_handler	= proc_dointvec_minmax
 	},
 	{ .ctl_name = 0 }
 };
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/datagram.c linux-libre-2.6.32.62-gnu1/net/ipv4/datagram.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/datagram.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/datagram.c	2014-05-19 01:54:39.000000000 -0400
@@ -52,7 +52,7 @@ int ip4_datagram_connect(struct sock *sk
 			       inet->sport, usin->sin_port, sk, 1);
 	if (err) {
 		if (err == -ENETUNREACH)
-			IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
+			IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
 		return err;
 	}
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/igmp.c linux-libre-2.6.32.62-gnu1/net/ipv4/igmp.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/igmp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/igmp.c	2014-05-19 01:54:39.000000000 -0400
@@ -697,7 +697,7 @@ static void igmp_gq_timer_expire(unsigne
 
 	in_dev->mr_gq_running = 0;
 	igmpv3_send_report(in_dev, NULL);
-	__in_dev_put(in_dev);
+	in_dev_put(in_dev);
 }
 
 static void igmp_ifc_timer_expire(unsigned long data)
@@ -709,7 +709,7 @@ static void igmp_ifc_timer_expire(unsign
 		in_dev->mr_ifc_count--;
 		igmp_ifc_start_timer(in_dev, IGMP_Unsolicited_Report_Interval);
 	}
-	__in_dev_put(in_dev);
+	in_dev_put(in_dev);
 }
 
 static void igmp_ifc_event(struct in_device *in_dev)
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/inet_diag.c linux-libre-2.6.32.62-gnu1/net/ipv4/inet_diag.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/inet_diag.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/inet_diag.c	2014-05-19 01:54:39.000000000 -0400
@@ -814,7 +814,7 @@ next_normal:
 			++num;
 		}
 
-		if (r->idiag_states & TCPF_TIME_WAIT) {
+		if (r->idiag_states & (TCPF_TIME_WAIT | TCPF_FIN_WAIT2)) {
 			struct inet_timewait_sock *tw;
 
 			inet_twsk_for_each(tw, node,
@@ -822,6 +822,8 @@ next_normal:
 
 				if (num < s_num)
 					goto next_dying;
+				if (!(r->idiag_states & (1 << tw->tw_substate)))
+					goto next_dying;
 				if (r->id.idiag_sport != tw->tw_sport &&
 				    r->id.idiag_sport)
 					goto next_dying;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/inet_hashtables.c linux-libre-2.6.32.62-gnu1/net/ipv4/inet_hashtables.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/inet_hashtables.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/inet_hashtables.c	2014-05-19 01:54:39.000000000 -0400
@@ -247,7 +247,7 @@ begintw:
 			}
 			if (unlikely(!INET_TW_MATCH(sk, net, hash, acookie,
 				 saddr, daddr, ports, dif))) {
-				sock_put(sk);
+				inet_twsk_put(inet_twsk(sk));
 				goto begintw;
 			}
 			goto out;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/ipip.c linux-libre-2.6.32.62-gnu1/net/ipv4/ipip.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/ipip.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/ipip.c	2014-05-19 01:54:39.000000000 -0400
@@ -408,6 +408,7 @@ static netdev_tx_t ipip_tunnel_xmit(stru
 	if (tos&1)
 		tos = old_iph->tos;
 
+	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	if (!dst) {
 		/* NBMA tunnel */
 		if ((rt = skb_rtable(skb)) == NULL) {
@@ -494,7 +495,6 @@ static netdev_tx_t ipip_tunnel_xmit(stru
 	skb->transport_header = skb->network_header;
 	skb_push(skb, sizeof(struct iphdr));
 	skb_reset_network_header(skb);
-	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 	IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
 			      IPSKB_REROUTED);
 	skb_dst_drop(skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/ip_output.c linux-libre-2.6.32.62-gnu1/net/ipv4/ip_output.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/ip_output.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/ip_output.c	2014-05-19 01:54:39.000000000 -0400
@@ -320,13 +320,13 @@ int ip_queue_xmit(struct sk_buff *skb, i
 	/* Skip all of this if the packet is already routed,
 	 * f.e. by something like SCTP.
 	 */
+	rcu_read_lock();
 	rt = skb_rtable(skb);
 	if (rt != NULL)
 		goto packet_routed;
 
 	/* Make sure we can route this packet. */
 	rt = (struct rtable *)__sk_dst_check(sk, 0);
-	rcu_read_lock();
 	inet_opt = rcu_dereference(inet->inet_opt);
 	if (rt == NULL) {
 		__be32 daddr;
@@ -875,7 +875,7 @@ int ip_append_data(struct sock *sk,
 	skb = skb_peek_tail(&sk->sk_write_queue);
 
 	inet->cork.length += length;
-	if (((length > mtu) || (skb && skb_is_gso(skb))) &&
+	if (((length > mtu) || (skb && skb_has_frags(skb))) &&
 	    (sk->sk_protocol == IPPROTO_UDP) &&
 	    (rt->u.dst.dev->features & NETIF_F_UFO)) {
 		err = ip_ufo_append_data(sk, getfrag, from, length, hh_len,
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/ip_sockglue.c linux-libre-2.6.32.62-gnu1/net/ipv4/ip_sockglue.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/ip_sockglue.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/ip_sockglue.c	2014-05-19 01:54:39.000000000 -0400
@@ -356,7 +356,7 @@ void ip_local_error(struct sock *sk, int
 /*
  *	Handle MSG_ERRQUEUE
  */
-int ip_recv_error(struct sock *sk, struct msghdr *msg, int len)
+int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
 {
 	struct sock_exterr_skb *serr;
 	struct sk_buff *skb, *skb2;
@@ -393,6 +393,7 @@ int ip_recv_error(struct sock *sk, struc
 						   serr->addr_offset);
 		sin->sin_port = serr->port;
 		memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
+		*addr_len = sizeof(*sin);
 	}
 
 	memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err));
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/raw.c linux-libre-2.6.32.62-gnu1/net/ipv4/raw.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/raw.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/raw.c	2014-05-19 01:54:39.000000000 -0400
@@ -681,11 +681,8 @@ static int raw_recvmsg(struct kiocb *ioc
 	if (flags & MSG_OOB)
 		goto out;
 
-	if (addr_len)
-		*addr_len = sizeof(*sin);
-
 	if (flags & MSG_ERRQUEUE) {
-		err = ip_recv_error(sk, msg, len);
+		err = ip_recv_error(sk, msg, len, addr_len);
 		goto out;
 	}
 
@@ -711,6 +708,7 @@ static int raw_recvmsg(struct kiocb *ioc
 		sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
 		sin->sin_port = 0;
 		memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
+		*addr_len = sizeof(*sin);
 	}
 	if (inet->cmsg_flags)
 		ip_cmsg_recv(msg, skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/sysctl_net_ipv4.c linux-libre-2.6.32.62-gnu1/net/ipv4/sysctl_net_ipv4.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/sysctl_net_ipv4.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/sysctl_net_ipv4.c	2014-05-19 01:54:39.000000000 -0400
@@ -23,6 +23,8 @@
 
 static int zero;
 static int tcp_retr1_max = 255;
+static int tcp_syn_retries_min = 1;
+static int tcp_syn_retries_max = MAX_TCP_SYNCNT;
 static int ip_local_port_range_min[] = { 1, 1 };
 static int ip_local_port_range_max[] = { 65535, 65535 };
 
@@ -237,7 +239,9 @@ static struct ctl_table ipv4_table[] = {
 		.data		= &ipv4_config.no_pmtu_disc,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= &tcp_syn_retries_min,
+		.extra2		= &tcp_syn_retries_max
 	},
 	{
 		.ctl_name	= NET_IPV4_NONLOCAL_BIND,
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/tcp.c linux-libre-2.6.32.62-gnu1/net/ipv4/tcp.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/tcp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/tcp.c	2014-05-19 01:54:39.000000000 -0400
@@ -2826,7 +2826,11 @@ int tcp_md5_hash_skb_data(struct tcp_md5
 
 	for (i = 0; i < shi->nr_frags; ++i) {
 		const struct skb_frag_struct *f = &shi->frags[i];
-		sg_set_page(&sg, f->page, f->size, f->page_offset);
+		unsigned int offset = f->page_offset;
+		struct page *page = f->page + (offset >> PAGE_SHIFT);
+
+		sg_set_page(&sg, page, f->size,
+			    offset_in_page(offset));
 		if (crypto_hash_update(desc, &sg, f->size))
 			return 1;
 	}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/tcp_cubic.c linux-libre-2.6.32.62-gnu1/net/ipv4/tcp_cubic.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/tcp_cubic.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/tcp_cubic.c	2014-05-19 01:54:39.000000000 -0400
@@ -90,6 +90,7 @@ struct bictcp {
 	u32	ack_cnt;	/* number of acks */
 	u32	tcp_cwnd;	/* estimated tcp cwnd */
 #define ACK_RATIO_SHIFT	4
+#define ACK_RATIO_LIMIT (32u << ACK_RATIO_SHIFT)
 	u16	delayed_ack;	/* estimate the ratio of Packets/ACKs << 4 */
 	u8	sample_cnt;	/* number of samples to decide curr_rtt */
 	u8	found;		/* the exit point is found? */
@@ -379,8 +380,12 @@ static void bictcp_acked(struct sock *sk
 	u32 delay;
 
 	if (icsk->icsk_ca_state == TCP_CA_Open) {
-		cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT;
-		ca->delayed_ack += cnt;
+		u32 ratio = ca->delayed_ack;
+
+		ratio -= ca->delayed_ack >> ACK_RATIO_SHIFT;
+		ratio += cnt;
+
+		ca->delayed_ack = clamp(ratio, 1U, ACK_RATIO_LIMIT);
 	}
 
 	/* Some calls are for duplicates without timetamps */
@@ -388,7 +393,7 @@ static void bictcp_acked(struct sock *sk
 		return;
 
 	/* Discard delay samples right after fast recovery */
-	if ((s32)(tcp_time_stamp - ca->epoch_start) < HZ)
+	if (ca->epoch_start && (s32)(tcp_time_stamp - ca->epoch_start) < HZ)
 		return;
 
 	delay = usecs_to_jiffies(rtt_us) << 3;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/tcp_ipv4.c linux-libre-2.6.32.62-gnu1/net/ipv4/tcp_ipv4.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/tcp_ipv4.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/tcp_ipv4.c	2014-05-19 01:54:39.000000000 -0400
@@ -174,7 +174,7 @@ int tcp_v4_connect(struct sock *sk, stru
 			       inet->sport, usin->sin_port, sk, 1);
 	if (tmp < 0) {
 		if (tmp == -ENETUNREACH)
-			IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
+			IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
 		return tmp;
 	}
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/tcp_output.c linux-libre-2.6.32.62-gnu1/net/ipv4/tcp_output.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/tcp_output.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/tcp_output.c	2014-05-19 01:54:39.000000000 -0400
@@ -744,6 +744,9 @@ static void tcp_queue_skb(struct sock *s
 static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb,
 				 unsigned int mss_now)
 {
+	/* Make sure we own this skb before messing gso_size/gso_segs */
+	WARN_ON_ONCE(skb_cloned(skb));
+
 	if (skb->len <= mss_now || !sk_can_gso(sk) ||
 	    skb->ip_summed == CHECKSUM_NONE) {
 		/* Avoid the costly divide in the normal
@@ -824,9 +827,7 @@ int tcp_fragment(struct sock *sk, struct
 	if (nsize < 0)
 		nsize = 0;
 
-	if (skb_cloned(skb) &&
-	    skb_is_nonlinear(skb) &&
-	    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+	if (skb_unclone(skb, GFP_ATOMIC))
 		return -ENOMEM;
 
 	/* Get a new skb... force flag on. */
@@ -948,11 +949,9 @@ int tcp_trim_head(struct sock *sk, struc
 	sk_mem_uncharge(sk, len);
 	sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
 
-	/* Any change of skb->len requires recalculation of tso
-	 * factor and mss.
-	 */
+	/* Any change of skb->len requires recalculation of tso factor. */
 	if (tcp_skb_pcount(skb) > 1)
-		tcp_set_skb_tso_segs(sk, skb, tcp_current_mss(sk));
+		tcp_set_skb_tso_segs(sk, skb, tcp_skb_mss(skb));
 
 	return 0;
 }
@@ -1932,6 +1931,8 @@ int tcp_retransmit_skb(struct sock *sk,
 		int oldpcount = tcp_skb_pcount(skb);
 
 		if (unlikely(oldpcount > 1)) {
+			if (skb_unclone(skb, GFP_ATOMIC))
+				return -ENOMEM;
 			tcp_init_tso_segs(sk, skb, cur_mss);
 			tcp_adjust_pcount(sk, skb, oldpcount - tcp_skb_pcount(skb));
 		}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv4/udp.c linux-libre-2.6.32.62-gnu1/net/ipv4/udp.c
--- linux-libre-2.6.32.61-gnu1/net/ipv4/udp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv4/udp.c	2014-05-19 01:54:39.000000000 -0400
@@ -513,7 +513,7 @@ static void udp4_hwcsum_outgoing(struct
 /*
  * Push out all pending data as one UDP datagram. Socket is locked.
  */
-static int udp_push_pending_frames(struct sock *sk)
+int udp_push_pending_frames(struct sock *sk)
 {
 	struct udp_sock  *up = udp_sk(sk);
 	struct inet_sock *inet = inet_sk(sk);
@@ -575,6 +575,7 @@ out:
 	up->pending = 0;
 	return err;
 }
+EXPORT_SYMBOL(udp_push_pending_frames);
 
 int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 		size_t len)
@@ -723,7 +724,7 @@ int udp_sendmsg(struct kiocb *iocb, stru
 		err = ip_route_output_flow(net, &rt, &fl, sk, 1);
 		if (err) {
 			if (err == -ENETUNREACH)
-				IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES);
+				IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES);
 			goto out;
 		}
 
@@ -941,14 +942,8 @@ int udp_recvmsg(struct kiocb *iocb, stru
 	int err;
 	int is_udplite = IS_UDPLITE(sk);
 
-	/*
-	 *	Check any passed addresses
-	 */
-	if (addr_len)
-		*addr_len = sizeof(*sin);
-
 	if (flags & MSG_ERRQUEUE)
-		return ip_recv_error(sk, msg, len);
+		return ip_recv_error(sk, msg, len, addr_len);
 
 try_again:
 	skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0),
@@ -1001,6 +996,7 @@ try_again:
 		sin->sin_port = udp_hdr(skb)->source;
 		sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
 		memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
+		*addr_len = sizeof(*sin);
 	}
 	if (inet->cmsg_flags)
 		ip_cmsg_recv(msg, skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/addrconf.c linux-libre-2.6.32.62-gnu1/net/ipv6/addrconf.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/addrconf.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/addrconf.c	2014-05-19 01:54:39.000000000 -0400
@@ -920,12 +920,10 @@ retry:
 	if (ifp->flags & IFA_F_OPTIMISTIC)
 		addr_flags |= IFA_F_OPTIMISTIC;
 
-	ift = !max_addresses ||
-	      ipv6_count_addresses(idev) < max_addresses ?
-		ipv6_add_addr(idev, &addr, tmp_plen,
-			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK,
-			      addr_flags) : NULL;
-	if (!ift || IS_ERR(ift)) {
+	ift = ipv6_add_addr(idev, &addr, tmp_plen,
+			    ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK,
+			    addr_flags);
+	if (IS_ERR(ift)) {
 		in6_ifa_put(ifp);
 		in6_dev_put(idev);
 		printk(KERN_INFO
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/datagram.c linux-libre-2.6.32.62-gnu1/net/ipv6/datagram.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/datagram.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/datagram.c	2014-05-19 01:54:39.000000000 -0400
@@ -281,7 +281,7 @@ void ipv6_local_error(struct sock *sk, i
 /*
  *	Handle MSG_ERRQUEUE
  */
-int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
+int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct sock_exterr_skb *serr;
@@ -333,6 +333,7 @@ int ipv6_recv_error(struct sock *sk, str
 				      htonl(0xffff),
 				      *(__be32 *)(nh + serr->addr_offset));
 		}
+		*addr_len = sizeof(*sin);
 	}
 
 	memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err));
@@ -341,6 +342,7 @@ int ipv6_recv_error(struct sock *sk, str
 	if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) {
 		sin->sin6_family = AF_INET6;
 		sin->sin6_flowinfo = 0;
+		sin->sin6_port = 0;
 		sin->sin6_scope_id = 0;
 		if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) {
 			ipv6_addr_copy(&sin->sin6_addr, &ipv6_hdr(skb)->saddr);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/icmp.c linux-libre-2.6.32.62-gnu1/net/ipv6/icmp.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/icmp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/icmp.c	2014-05-19 01:54:39.000000000 -0400
@@ -903,6 +903,14 @@ static const struct icmp6_err {
 		.err	= ECONNREFUSED,
 		.fatal	= 1,
 	},
+	{	/* POLICY_FAIL */
+		.err	= EACCES,
+		.fatal	= 1,
+	},
+	{	/* REJECT_ROUTE	*/
+		.err	= EACCES,
+		.fatal	= 1,
+	},
 };
 
 int icmpv6_err_convert(u8 type, u8 code, int *err)
@@ -914,7 +922,7 @@ int icmpv6_err_convert(u8 type, u8 code,
 	switch (type) {
 	case ICMPV6_DEST_UNREACH:
 		fatal = 1;
-		if (code <= ICMPV6_PORT_UNREACH) {
+		if (code < ARRAY_SIZE(tab_unreach)) {
 			*err  = tab_unreach[code].err;
 			fatal = tab_unreach[code].fatal;
 		}
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/inet6_connection_sock.c linux-libre-2.6.32.62-gnu1/net/ipv6/inet6_connection_sock.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/inet6_connection_sock.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/inet6_connection_sock.c	2014-05-19 01:54:39.000000000 -0400
@@ -57,7 +57,7 @@ EXPORT_SYMBOL_GPL(inet6_csk_bind_conflic
  * request_sock (formerly open request) hash tables.
  */
 static u32 inet6_synq_hash(const struct in6_addr *raddr, const __be16 rport,
-			   const u32 rnd, const u16 synq_hsize)
+			   const u32 rnd, const u32 synq_hsize)
 {
 	u32 a = (__force u32)raddr->s6_addr32[0];
 	u32 b = (__force u32)raddr->s6_addr32[1];
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/inet6_hashtables.c linux-libre-2.6.32.62-gnu1/net/ipv6/inet6_hashtables.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/inet6_hashtables.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/inet6_hashtables.c	2014-05-19 01:54:39.000000000 -0400
@@ -104,7 +104,7 @@ begintw:
 				goto out;
 			}
 			if (!INET6_TW_MATCH(sk, net, hash, saddr, daddr, ports, dif)) {
-				sock_put(sk);
+				inet_twsk_put(inet_twsk(sk));
 				goto begintw;
 			}
 			goto out;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/ip6_fib.c linux-libre-2.6.32.62-gnu1/net/ipv6/ip6_fib.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/ip6_fib.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/ip6_fib.c	2014-05-19 01:54:39.000000000 -0400
@@ -846,14 +846,22 @@ static struct fib6_node * fib6_lookup_1(
 
 			if (ipv6_prefix_equal(&key->addr, args->addr, key->plen)) {
 #ifdef CONFIG_IPV6_SUBTREES
-				if (fn->subtree)
-					fn = fib6_lookup_1(fn->subtree, args + 1);
+				if (fn->subtree) {
+					struct fib6_node *sfn;
+					sfn = fib6_lookup_1(fn->subtree,
+							    args + 1);
+					if (!sfn)
+						goto backtrack;
+					fn = sfn;
+				}
 #endif
-				if (!fn || fn->fn_flags & RTN_RTINFO)
+				if (fn->fn_flags & RTN_RTINFO)
 					return fn;
 			}
 		}
-
+#ifdef CONFIG_IPV6_SUBTREES
+backtrack:
+#endif
 		if (fn->fn_flags & RTN_ROOT)
 			break;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/ip6_output.c linux-libre-2.6.32.62-gnu1/net/ipv6/ip6_output.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/ip6_output.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/ip6_output.c	2014-05-19 01:54:39.000000000 -0400
@@ -91,8 +91,8 @@ static int ip6_output_finish(struct sk_b
 	else if (dst->neighbour)
 		return dst->neighbour->output(skb);
 
-	IP6_INC_STATS_BH(dev_net(dst->dev),
-			 ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
+	IP6_INC_STATS(dev_net(dst->dev),
+	              ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
 	kfree_skb(skb);
 	return -EINVAL;
 
@@ -920,11 +920,17 @@ static struct dst_entry *ip6_sk_dst_chec
 					  struct flowi *fl)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
-	struct rt6_info *rt = (struct rt6_info *)dst;
+	struct rt6_info *rt;
 
 	if (!dst)
 		goto out;
 
+	if (dst->ops->family != AF_INET6) {
+		dst_release(dst);
+		return NULL;
+	}
+
+	rt = (struct rt6_info *)dst;
 	/* Yes, checking route validity in not connected
 	 * case is not very simple. Take into account,
 	 * that we do not support routing by source, TOS,
@@ -1080,6 +1086,8 @@ static inline int ip6_ufo_append_data(st
 	 * udp datagram
 	 */
 	if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) {
+		struct frag_hdr fhdr;
+
 		skb = sock_alloc_send_skb(sk,
 			hh_len + fragheaderlen + transhdrlen + 20,
 			(flags & MSG_DONTWAIT), &err);
@@ -1101,12 +1109,6 @@ static inline int ip6_ufo_append_data(st
 		skb->ip_summed = CHECKSUM_PARTIAL;
 		skb->csum = 0;
 		sk->sk_sndmsg_off = 0;
-	}
-
-	err = skb_append_datato_frags(sk,skb, getfrag, from,
-				      (length - transhdrlen));
-	if (!err) {
-		struct frag_hdr fhdr;
 
 		/* Specify the length of each IPv6 datagram fragment.
 		 * It has to be a multiple of 8.
@@ -1117,15 +1119,10 @@ static inline int ip6_ufo_append_data(st
 		ipv6_select_ident(&fhdr, rt);
 		skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
 		__skb_queue_tail(&sk->sk_write_queue, skb);
-
-		return 0;
 	}
-	/* There is not enough support do UPD LSO,
-	 * so follow normal path
-	 */
-	kfree_skb(skb);
 
-	return err;
+	return skb_append_datato_frags(sk, skb, getfrag, from,
+				       (length - transhdrlen));
 }
 
 static inline struct ipv6_opt_hdr *ip6_opt_dup(struct ipv6_opt_hdr *src,
@@ -1168,7 +1165,7 @@ int ip6_append_data(struct sock *sk, int
 			if (WARN_ON(np->cork.opt))
 				return -EINVAL;
 
-			np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation);
+			np->cork.opt = kzalloc(opt->tot_len, sk->sk_allocation);
 			if (unlikely(np->cork.opt == NULL))
 				return -ENOBUFS;
 
@@ -1258,18 +1255,20 @@ int ip6_append_data(struct sock *sk, int
 	 */
 
 	inet->cork.length += length;
-	if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) &&
+	skb = skb_peek_tail(&sk->sk_write_queue);
+	if (((length > mtu) ||
+	     (skb && skb_has_frags(skb))) &&
+	    (sk->sk_protocol == IPPROTO_UDP) &&
 	    (rt->u.dst.dev->features & NETIF_F_UFO)) {
-
-		err = ip6_ufo_append_data(sk, getfrag, from, length, hh_len,
-					  fragheaderlen, transhdrlen, mtu,
-					  flags, rt);
+		err = ip6_ufo_append_data(sk, getfrag, from, length,
+					  hh_len, fragheaderlen,
+					  transhdrlen, mtu, flags, rt);
 		if (err)
 			goto error;
 		return 0;
 	}
 
-	if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL)
+	if (!skb)
 		goto alloc_new_skb;
 
 	while (length > 0) {
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/mcast.c linux-libre-2.6.32.62-gnu1/net/ipv6/mcast.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/mcast.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/mcast.c	2014-05-19 01:54:39.000000000 -0400
@@ -2208,7 +2208,7 @@ static void mld_gq_timer_expire(unsigned
 
 	idev->mc_gq_running = 0;
 	mld_send_report(idev, NULL);
-	__in6_dev_put(idev);
+	in6_dev_put(idev);
 }
 
 static void mld_ifc_timer_expire(unsigned long data)
@@ -2221,7 +2221,7 @@ static void mld_ifc_timer_expire(unsigne
 		if (idev->mc_ifc_count)
 			mld_ifc_start_timer(idev, idev->mc_maxdelay);
 	}
-	__in6_dev_put(idev);
+	in6_dev_put(idev);
 }
 
 static void mld_ifc_event(struct inet6_dev *idev)
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/ndisc.c linux-libre-2.6.32.62-gnu1/net/ipv6/ndisc.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/ndisc.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/ndisc.c	2014-05-19 01:54:39.000000000 -0400
@@ -449,7 +449,6 @@ struct sk_buff *ndisc_build_skb(struct n
 	struct sk_buff *skb;
 	struct icmp6hdr *hdr;
 	int len;
-	int err;
 	u8 *opt;
 
 	if (!dev->addr_len)
@@ -459,14 +458,12 @@ struct sk_buff *ndisc_build_skb(struct n
 	if (llinfo)
 		len += ndisc_opt_addr_space(dev);
 
-	skb = sock_alloc_send_skb(sk,
-				  (MAX_HEADER + sizeof(struct ipv6hdr) +
-				   len + LL_ALLOCATED_SPACE(dev)),
-				  1, &err);
+	skb = alloc_skb((MAX_HEADER + sizeof(struct ipv6hdr) +
+			 len + LL_ALLOCATED_SPACE(dev)), GFP_ATOMIC);
 	if (!skb) {
 		ND_PRINTK0(KERN_ERR
-			   "ICMPv6 ND: %s() failed to allocate an skb, err=%d.\n",
-			   __func__, err);
+			   "ICMPv6 ND: %s() failed to allocate an skb.\n",
+			   __func__);
 		return NULL;
 	}
 
@@ -494,6 +491,11 @@ struct sk_buff *ndisc_build_skb(struct n
 					   csum_partial(hdr,
 							len, 0));
 
+	/* Manually assign socket ownership as we avoid calling
+	 * sock_alloc_send_pskb() to bypass wmem buffer limits
+	 */
+	skb_set_owner_w(skb, sk);
+
 	return skb;
 }
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/raw.c linux-libre-2.6.32.62-gnu1/net/ipv6/raw.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/raw.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/raw.c	2014-05-19 01:54:39.000000000 -0400
@@ -456,11 +456,8 @@ static int rawv6_recvmsg(struct kiocb *i
 	if (flags & MSG_OOB)
 		return -EOPNOTSUPP;
 
-	if (addr_len)
-		*addr_len=sizeof(*sin6);
-
 	if (flags & MSG_ERRQUEUE)
-		return ipv6_recv_error(sk, msg, len);
+		return ipv6_recv_error(sk, msg, len, addr_len);
 
 	skb = skb_recv_datagram(sk, flags, noblock, &err);
 	if (!skb)
@@ -495,6 +492,7 @@ static int rawv6_recvmsg(struct kiocb *i
 		sin6->sin6_scope_id = 0;
 		if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
 			sin6->sin6_scope_id = IP6CB(skb)->iif;
+		*addr_len = sizeof(*sin6);
 	}
 
 	sock_recv_timestamp(msg, sk, skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/reassembly.c linux-libre-2.6.32.62-gnu1/net/ipv6/reassembly.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/reassembly.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/reassembly.c	2014-05-19 01:54:39.000000000 -0400
@@ -503,6 +503,7 @@ static int ip6_frag_reasm(struct frag_qu
 	head->tstamp = fq->q.stamp;
 	ipv6_hdr(head)->payload_len = htons(payload_len);
 	IP6CB(head)->nhoff = nhoff;
+	IP6CB(head)->flags |= IP6SKB_FRAGMENTED;
 
 	/* Yes, and fold redundant checksum back. 8) */
 	if (head->ip_summed == CHECKSUM_COMPLETE)
@@ -537,6 +538,9 @@ static int ipv6_frag_rcv(struct sk_buff
 	struct ipv6hdr *hdr = ipv6_hdr(skb);
 	struct net *net = dev_net(skb_dst(skb)->dev);
 
+	if (IP6CB(skb)->flags & IP6SKB_FRAGMENTED)
+		goto fail_hdr;
+
 	IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS);
 
 	/* Jumbo payload inhibits frag. header */
@@ -557,6 +561,7 @@ static int ipv6_frag_rcv(struct sk_buff
 				 ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMOKS);
 
 		IP6CB(skb)->nhoff = (u8 *)fhdr - skb_network_header(skb);
+		IP6CB(skb)->flags |= IP6SKB_FRAGMENTED;
 		return 1;
 	}
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/route.c linux-libre-2.6.32.62-gnu1/net/ipv6/route.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/route.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/route.c	2014-05-19 01:54:39.000000000 -0400
@@ -495,8 +495,11 @@ int rt6_route_rcv(struct net_device *dev
 		prefix = &prefix_buf;
 	}
 
-	rt = rt6_get_route_info(net, prefix, rinfo->prefix_len, gwaddr,
-				dev->ifindex);
+	if (rinfo->prefix_len == 0)
+		rt = rt6_get_dflt_router(gwaddr, dev);
+	else
+		rt = rt6_get_route_info(net, prefix, rinfo->prefix_len,
+					gwaddr, dev->ifindex);
 
 	if (rt && !lifetime) {
 		ip6_del_rt(rt);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipv6/udp.c linux-libre-2.6.32.62-gnu1/net/ipv6/udp.c
--- linux-libre-2.6.32.61-gnu1/net/ipv6/udp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipv6/udp.c	2014-05-19 01:54:39.000000000 -0400
@@ -200,11 +200,8 @@ int udpv6_recvmsg(struct kiocb *iocb, st
 	int is_udplite = IS_UDPLITE(sk);
 	int is_udp4;
 
-	if (addr_len)
-		*addr_len=sizeof(struct sockaddr_in6);
-
 	if (flags & MSG_ERRQUEUE)
-		return ipv6_recv_error(sk, msg, len);
+		return ipv6_recv_error(sk, msg, len, addr_len);
 
 try_again:
 	skb = __skb_recv_datagram(sk, flags | (noblock ? MSG_DONTWAIT : 0),
@@ -273,7 +270,7 @@ try_again:
 			if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)
 				sin6->sin6_scope_id = IP6CB(skb)->iif;
 		}
-
+		*addr_len = sizeof(*sin6);
 	}
 	if (is_udp4) {
 		if (inet->cmsg_flags)
@@ -690,11 +687,16 @@ static int udp_v6_push_pending_frames(st
 	struct udphdr *uh;
 	struct udp_sock  *up = udp_sk(sk);
 	struct inet_sock *inet = inet_sk(sk);
-	struct flowi *fl = &inet->cork.fl;
+	struct flowi *fl;
 	int err = 0;
 	int is_udplite = IS_UDPLITE(sk);
 	__wsum csum = 0;
 
+	if (up->pending == AF_INET)
+		return udp_push_pending_frames(sk);
+
+	fl = &inet->cork.fl;
+
 	/* Grab the skbuff where UDP header space exists. */
 	if ((skb = skb_peek(&sk->sk_write_queue)) == NULL)
 		goto out;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/ipx/af_ipx.c linux-libre-2.6.32.62-gnu1/net/ipx/af_ipx.c
--- linux-libre-2.6.32.61-gnu1/net/ipx/af_ipx.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/ipx/af_ipx.c	2014-05-19 01:54:39.000000000 -0400
@@ -1808,8 +1808,6 @@ static int ipx_recvmsg(struct kiocb *ioc
 	if (skb->tstamp.tv64)
 		sk->sk_stamp = skb->tstamp;
 
-	msg->msg_namelen = sizeof(*sipx);
-
 	if (sipx) {
 		sipx->sipx_family	= AF_IPX;
 		sipx->sipx_port		= ipx->ipx_source.sock;
@@ -1817,6 +1815,7 @@ static int ipx_recvmsg(struct kiocb *ioc
 		sipx->sipx_network	= IPX_SKB_CB(skb)->ipx_source_net;
 		sipx->sipx_type 	= ipx->ipx_type;
 		sipx->sipx_zero		= 0;
+		msg->msg_namelen	= sizeof(*sipx);
 	}
 	rc = copied;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/irda/af_irda.c linux-libre-2.6.32.62-gnu1/net/irda/af_irda.c
--- linux-libre-2.6.32.61-gnu1/net/irda/af_irda.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/irda/af_irda.c	2014-05-19 01:54:39.000000000 -0400
@@ -1338,8 +1338,6 @@ static int irda_recvmsg_dgram(struct kio
 	if ((err = sock_error(sk)) < 0)
 		return err;
 
-	msg->msg_namelen = 0;
-
 	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
 				flags & MSG_DONTWAIT, &err);
 	if (!skb)
@@ -1402,8 +1400,6 @@ static int irda_recvmsg_stream(struct ki
 	target = sock_rcvlowat(sk, flags & MSG_WAITALL, size);
 	timeo = sock_rcvtimeo(sk, noblock);
 
-	msg->msg_namelen = 0;
-
 	do {
 		int chunk;
 		struct sk_buff *skb = skb_dequeue(&sk->sk_receive_queue);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/iucv/af_iucv.c linux-libre-2.6.32.62-gnu1/net/iucv/af_iucv.c
--- linux-libre-2.6.32.61-gnu1/net/iucv/af_iucv.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/iucv/af_iucv.c	2014-05-19 01:54:39.000000000 -0400
@@ -1160,8 +1160,6 @@ static int iucv_sock_recvmsg(struct kioc
 	struct sk_buff *skb, *rskb, *cskb;
 	int err = 0;
 
-	msg->msg_namelen = 0;
-
 	if ((sk->sk_state == IUCV_DISCONN || sk->sk_state == IUCV_SEVERED) &&
 	    skb_queue_empty(&iucv->backlog_skb_q) &&
 	    skb_queue_empty(&sk->sk_receive_queue) &&
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/key/af_key.c linux-libre-2.6.32.62-gnu1/net/key/af_key.c
--- linux-libre-2.6.32.61-gnu1/net/key/af_key.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/key/af_key.c	2014-05-19 01:54:39.000000000 -0400
@@ -1726,6 +1726,7 @@ static int key_notify_sa_flush(struct km
 	hdr->sadb_msg_version = PF_KEY_V2;
 	hdr->sadb_msg_errno = (uint8_t) 0;
 	hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
+	hdr->sadb_msg_reserved = 0;
 
 	pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
 
@@ -2078,6 +2079,7 @@ static int pfkey_xfrm_policy2msg(struct
 			pol->sadb_x_policy_type = IPSEC_POLICY_NONE;
 	}
 	pol->sadb_x_policy_dir = dir+1;
+	pol->sadb_x_policy_reserved = 0;
 	pol->sadb_x_policy_id = xp->index;
 	pol->sadb_x_policy_priority = xp->priority;
 
@@ -2693,7 +2695,9 @@ static int key_notify_policy_flush(struc
 	hdr->sadb_msg_pid = c->pid;
 	hdr->sadb_msg_version = PF_KEY_V2;
 	hdr->sadb_msg_errno = (uint8_t) 0;
+	hdr->sadb_msg_satype = SADB_SATYPE_UNSPEC;
 	hdr->sadb_msg_len = (sizeof(struct sadb_msg) / sizeof(uint64_t));
+	hdr->sadb_msg_reserved = 0;
 	pfkey_broadcast(skb_out, GFP_ATOMIC, BROADCAST_ALL, NULL, c->net);
 	return 0;
 
@@ -3108,7 +3112,9 @@ static int pfkey_send_acquire(struct xfr
 	pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
 	pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC;
 	pol->sadb_x_policy_dir = dir+1;
+	pol->sadb_x_policy_reserved = 0;
 	pol->sadb_x_policy_id = xp->index;
+	pol->sadb_x_policy_priority = xp->priority;
 
 	/* Set sadb_comb's. */
 	if (x->id.proto == IPPROTO_AH)
@@ -3496,6 +3502,7 @@ static int pfkey_send_migrate(struct xfr
 	pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
 	pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC;
 	pol->sadb_x_policy_dir = dir + 1;
+	pol->sadb_x_policy_reserved = 0;
 	pol->sadb_x_policy_id = 0;
 	pol->sadb_x_policy_priority = 0;
 
@@ -3590,7 +3597,6 @@ static int pfkey_recvmsg(struct kiocb *k
 	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
 		goto out;
 
-	msg->msg_namelen = 0;
 	skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &err);
 	if (skb == NULL)
 		goto out;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/llc/af_llc.c linux-libre-2.6.32.62-gnu1/net/llc/af_llc.c
--- linux-libre-2.6.32.61-gnu1/net/llc/af_llc.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/llc/af_llc.c	2014-05-19 01:54:39.000000000 -0400
@@ -669,13 +669,11 @@ static int llc_ui_recvmsg(struct kiocb *
 	struct llc_sock *llc = llc_sk(sk);
 	size_t copied = 0;
 	u32 peek_seq = 0;
-	u32 *seq;
+	u32 *seq, skb_len;
 	unsigned long used;
 	int target;	/* Read at least this many bytes */
 	long timeo;
 
-	msg->msg_namelen = 0;
-
 	lock_sock(sk);
 	copied = -ENOTCONN;
 	if (unlikely(sk->sk_type == SOCK_STREAM && sk->sk_state == TCP_LISTEN))
@@ -769,6 +767,7 @@ static int llc_ui_recvmsg(struct kiocb *
 		}
 		continue;
 	found_ok_skb:
+		skb_len = skb->len;
 		/* Ok so how much can we use? */
 		used = skb->len - offset;
 		if (len < used)
@@ -799,7 +798,7 @@ static int llc_ui_recvmsg(struct kiocb *
 			goto copy_uaddr;
 
 		/* Partial read */
-		if (used + offset < skb->len)
+		if (used + offset < skb_len)
 			continue;
 	} while (len > 0);
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/netfilter/ipvs/ip_vs_proto_tcp.c linux-libre-2.6.32.62-gnu1/net/netfilter/ipvs/ip_vs_proto_tcp.c
--- linux-libre-2.6.32.61-gnu1/net/netfilter/ipvs/ip_vs_proto_tcp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/netfilter/ipvs/ip_vs_proto_tcp.c	2014-05-19 01:54:39.000000000 -0400
@@ -147,15 +147,15 @@ tcp_partial_csum_update(int af, struct t
 #ifdef CONFIG_IP_VS_IPV6
 	if (af == AF_INET6)
 		tcph->check =
-			csum_fold(ip_vs_check_diff16(oldip->ip6, newip->ip6,
+			~csum_fold(ip_vs_check_diff16(oldip->ip6, newip->ip6,
 					 ip_vs_check_diff2(oldlen, newlen,
-						~csum_unfold(tcph->check))));
+						csum_unfold(tcph->check))));
 	else
 #endif
 	tcph->check =
-		csum_fold(ip_vs_check_diff4(oldip->ip, newip->ip,
+		~csum_fold(ip_vs_check_diff4(oldip->ip, newip->ip,
 				ip_vs_check_diff2(oldlen, newlen,
-						~csum_unfold(tcph->check))));
+						csum_unfold(tcph->check))));
 }
 
 
@@ -269,7 +269,7 @@ tcp_dnat_handler(struct sk_buff *skb,
 	 *	Adjust TCP checksums
 	 */
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		tcp_partial_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
+		tcp_partial_csum_update(cp->af, tcph, &cp->vaddr, &cp->daddr,
 					htons(oldlen),
 					htons(skb->len - tcphoff));
 	} else if (!cp->app) {
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/netfilter/ipvs/ip_vs_proto_udp.c linux-libre-2.6.32.62-gnu1/net/netfilter/ipvs/ip_vs_proto_udp.c
--- linux-libre-2.6.32.61-gnu1/net/netfilter/ipvs/ip_vs_proto_udp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/netfilter/ipvs/ip_vs_proto_udp.c	2014-05-19 01:54:39.000000000 -0400
@@ -154,15 +154,15 @@ udp_partial_csum_update(int af, struct u
 #ifdef CONFIG_IP_VS_IPV6
 	if (af == AF_INET6)
 		uhdr->check =
-			csum_fold(ip_vs_check_diff16(oldip->ip6, newip->ip6,
+			~csum_fold(ip_vs_check_diff16(oldip->ip6, newip->ip6,
 					 ip_vs_check_diff2(oldlen, newlen,
-						~csum_unfold(uhdr->check))));
+						csum_unfold(uhdr->check))));
 	else
 #endif
 	uhdr->check =
-		csum_fold(ip_vs_check_diff4(oldip->ip, newip->ip,
+		~csum_fold(ip_vs_check_diff4(oldip->ip, newip->ip,
 				ip_vs_check_diff2(oldlen, newlen,
-						~csum_unfold(uhdr->check))));
+						csum_unfold(uhdr->check))));
 }
 
 
@@ -205,7 +205,7 @@ udp_snat_handler(struct sk_buff *skb,
 	 *	Adjust UDP checksums
 	 */
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr,
+		udp_partial_csum_update(cp->af, udph, &cp->vaddr, &cp->daddr,
 					htons(oldlen),
 					htons(skb->len - udphoff));
 	} else if (!cp->app && (udph->check != 0)) {
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/netfilter/nf_conntrack_proto_dccp.c linux-libre-2.6.32.62-gnu1/net/netfilter/nf_conntrack_proto_dccp.c
--- linux-libre-2.6.32.61-gnu1/net/netfilter/nf_conntrack_proto_dccp.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/netfilter/nf_conntrack_proto_dccp.c	2014-05-19 01:54:39.000000000 -0400
@@ -430,7 +430,7 @@ static bool dccp_new(struct nf_conn *ct,
 	const char *msg;
 	u_int8_t state;
 
-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
+	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
 	BUG_ON(dh == NULL);
 
 	state = dccp_state_table[CT_DCCP_ROLE_CLIENT][dh->dccph_type][CT_DCCP_NONE];
@@ -479,7 +479,7 @@ static int dccp_packet(struct nf_conn *c
 	u_int8_t type, old_state, new_state;
 	enum ct_dccp_roles role;
 
-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
+	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
 	BUG_ON(dh == NULL);
 	type = dh->dccph_type;
 
@@ -570,7 +570,7 @@ static int dccp_error(struct net *net, s
 	unsigned int cscov;
 	const char *msg;
 
-	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
+	dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
 	if (dh == NULL) {
 		msg = "nf_ct_dccp: short packet ";
 		goto out_invalid;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/netlink/af_netlink.c linux-libre-2.6.32.62-gnu1/net/netlink/af_netlink.c
--- linux-libre-2.6.32.61-gnu1/net/netlink/af_netlink.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/netlink/af_netlink.c	2014-05-19 01:54:39.000000000 -0400
@@ -1400,8 +1400,6 @@ static int netlink_recvmsg(struct kiocb
 	}
 #endif
 
-	msg->msg_namelen = 0;
-
 	copied = data_skb->len;
 	if (len < copied) {
 		msg->msg_flags |= MSG_TRUNC;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/netrom/af_netrom.c linux-libre-2.6.32.62-gnu1/net/netrom/af_netrom.c
--- linux-libre-2.6.32.61-gnu1/net/netrom/af_netrom.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/netrom/af_netrom.c	2014-05-19 01:54:39.000000000 -0400
@@ -1184,10 +1184,9 @@ static int nr_recvmsg(struct kiocb *iocb
 		sax->sax25_family = AF_NETROM;
 		skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call,
 			      AX25_ADDR_LEN);
+		msg->msg_namelen = sizeof(*sax);
 	}
 
-	msg->msg_namelen = sizeof(*sax);
-
 	skb_free_datagram(sk, skb);
 
 	release_sock(sk);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/packet/af_packet.c linux-libre-2.6.32.62-gnu1/net/packet/af_packet.c
--- linux-libre-2.6.32.61-gnu1/net/packet/af_packet.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/packet/af_packet.c	2014-05-19 01:54:39.000000000 -0400
@@ -1423,7 +1423,6 @@ static int packet_recvmsg(struct kiocb *
 	struct sock *sk = sock->sk;
 	struct sk_buff *skb;
 	int copied, err;
-	struct sockaddr_ll *sll;
 
 	err = -EINVAL;
 	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
@@ -1455,22 +1454,10 @@ static int packet_recvmsg(struct kiocb *
 	if (skb == NULL)
 		goto out;
 
-	/*
-	 *	If the address length field is there to be filled in, we fill
-	 *	it in now.
-	 */
-
-	sll = &PACKET_SKB_CB(skb)->sa.ll;
-	if (sock->type == SOCK_PACKET)
-		msg->msg_namelen = sizeof(struct sockaddr_pkt);
-	else
-		msg->msg_namelen = sll->sll_halen + offsetof(struct sockaddr_ll, sll_addr);
-
-	/*
-	 *	You lose any data beyond the buffer you gave. If it worries a
-	 *	user program they can ask the device for its MTU anyway.
+	/* You lose any data beyond the buffer you gave. If it worries
+	 * a user program they can ask the device for its MTU
+	 * anyway.
 	 */
-
 	copied = skb->len;
 	if (copied > len) {
 		copied = len;
@@ -1483,9 +1470,20 @@ static int packet_recvmsg(struct kiocb *
 
 	sock_recv_timestamp(msg, sk, skb);
 
-	if (msg->msg_name)
+	if (msg->msg_name) {
+		/* If the address length field is there to be filled
+		 * in, we fill it in now.
+		 */
+		if (sock->type == SOCK_PACKET) {
+			msg->msg_namelen = sizeof(struct sockaddr_pkt);
+		} else {
+			struct sockaddr_ll *sll = &PACKET_SKB_CB(skb)->sa.ll;
+			msg->msg_namelen = sll->sll_halen +
+				offsetof(struct sockaddr_ll, sll_addr);
+		}
 		memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa,
 		       msg->msg_namelen);
+	}
 
 	if (pkt_sk(sk)->auxdata) {
 		struct tpacket_auxdata aux;
@@ -1525,12 +1523,12 @@ static int packet_getname_spkt(struct so
 		return -EOPNOTSUPP;
 
 	uaddr->sa_family = AF_PACKET;
+	memset(uaddr->sa_data, 0, sizeof(uaddr->sa_data));
 	dev = dev_get_by_index(sock_net(sk), pkt_sk(sk)->ifindex);
 	if (dev) {
-		strncpy(uaddr->sa_data, dev->name, 14);
+		strlcpy(uaddr->sa_data, dev->name, sizeof(uaddr->sa_data));
 		dev_put(dev);
-	} else
-		memset(uaddr->sa_data, 0, 14);
+	}
 	*uaddr_len = sizeof(*uaddr);
 
 	return 0;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/phonet/datagram.c linux-libre-2.6.32.62-gnu1/net/phonet/datagram.c
--- linux-libre-2.6.32.61-gnu1/net/phonet/datagram.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/phonet/datagram.c	2014-05-19 01:54:39.000000000 -0400
@@ -122,9 +122,6 @@ static int pn_recvmsg(struct kiocb *iocb
 	if (flags & MSG_OOB)
 		goto out_nofree;
 
-	if (addr_len)
-		*addr_len = sizeof(sa);
-
 	skb = skb_recv_datagram(sk, flags, noblock, &rval);
 	if (skb == NULL)
 		goto out_nofree;
@@ -145,8 +142,10 @@ static int pn_recvmsg(struct kiocb *iocb
 
 	rval = (flags & MSG_TRUNC) ? skb->len : copylen;
 
-	if (msg->msg_name != NULL)
-		memcpy(msg->msg_name, &sa, sizeof(struct sockaddr_pn));
+	if (msg->msg_name != NULL) {
+		memcpy(msg->msg_name, &sa, sizeof(sa));
+		*addr_len = sizeof(sa);
+	}
 
 out:
 	skb_free_datagram(sk, skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/rds/ib.c linux-libre-2.6.32.62-gnu1/net/rds/ib.c
--- linux-libre-2.6.32.61-gnu1/net/rds/ib.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/rds/ib.c	2014-05-19 01:54:39.000000000 -0400
@@ -235,7 +235,8 @@ static int rds_ib_laddr_check(__be32 add
 	ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin);
 	/* due to this, we will claim to support iWARP devices unless we
 	   check node_type. */
-	if (ret || cm_id->device->node_type != RDMA_NODE_IB_CA)
+	if (ret || !cm_id->device ||
+	    cm_id->device->node_type != RDMA_NODE_IB_CA)
 		ret = -EADDRNOTAVAIL;
 
 	rdsdebug("addr %pI4 ret %d node type %d\n",
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/rds/iw.c linux-libre-2.6.32.62-gnu1/net/rds/iw.c
--- linux-libre-2.6.32.61-gnu1/net/rds/iw.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/rds/iw.c	2014-05-19 01:54:39.000000000 -0400
@@ -237,7 +237,8 @@ static int rds_iw_laddr_check(__be32 add
 	ret = rdma_bind_addr(cm_id, (struct sockaddr *)&sin);
 	/* due to this, we will claim to support IB devices unless we
 	   check node_type. */
-	if (ret || cm_id->device->node_type != RDMA_NODE_RNIC)
+	if (ret || !cm_id->device ||
+	    cm_id->device->node_type != RDMA_NODE_RNIC)
 		ret = -EADDRNOTAVAIL;
 
 	rdsdebug("addr %pI4 ret %d node type %d\n",
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/rds/recv.c linux-libre-2.6.32.62-gnu1/net/rds/recv.c
--- linux-libre-2.6.32.61-gnu1/net/rds/recv.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/rds/recv.c	2014-05-19 01:54:39.000000000 -0400
@@ -410,8 +410,6 @@ int rds_recvmsg(struct kiocb *iocb, stru
 
 	rdsdebug("size %zu flags 0x%x timeo %ld\n", size, msg_flags, timeo);
 
-	msg->msg_namelen = 0;
-
 	if (msg_flags & MSG_OOB)
 		goto out;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/rose/af_rose.c linux-libre-2.6.32.62-gnu1/net/rose/af_rose.c
--- linux-libre-2.6.32.61-gnu1/net/rose/af_rose.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/rose/af_rose.c	2014-05-19 01:54:39.000000000 -0400
@@ -1238,7 +1238,6 @@ static int rose_recvmsg(struct kiocb *io
 {
 	struct sock *sk = sock->sk;
 	struct rose_sock *rose = rose_sk(sk);
-	struct sockaddr_rose *srose = (struct sockaddr_rose *)msg->msg_name;
 	size_t copied;
 	unsigned char *asmptr;
 	struct sk_buff *skb;
@@ -1274,24 +1273,19 @@ static int rose_recvmsg(struct kiocb *io
 
 	skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
 
-	if (srose != NULL) {
-		memset(srose, 0, msg->msg_namelen);
+	if (msg->msg_name) {
+		struct sockaddr_rose *srose;
+		struct full_sockaddr_rose *full_srose = msg->msg_name;
+
+		memset(msg->msg_name, 0, sizeof(struct full_sockaddr_rose));
+		srose = msg->msg_name;
 		srose->srose_family = AF_ROSE;
 		srose->srose_addr   = rose->dest_addr;
 		srose->srose_call   = rose->dest_call;
 		srose->srose_ndigis = rose->dest_ndigis;
-		if (msg->msg_namelen >= sizeof(struct full_sockaddr_rose)) {
-			struct full_sockaddr_rose *full_srose = (struct full_sockaddr_rose *)msg->msg_name;
-			for (n = 0 ; n < rose->dest_ndigis ; n++)
-				full_srose->srose_digis[n] = rose->dest_digis[n];
-			msg->msg_namelen = sizeof(struct full_sockaddr_rose);
-		} else {
-			if (rose->dest_ndigis >= 1) {
-				srose->srose_ndigis = 1;
-				srose->srose_digi = rose->dest_digis[0];
-			}
-			msg->msg_namelen = sizeof(struct sockaddr_rose);
-		}
+		for (n = 0 ; n < rose->dest_ndigis ; n++)
+			full_srose->srose_digis[n] = rose->dest_digis[n];
+		msg->msg_namelen = sizeof(struct full_sockaddr_rose);
 	}
 
 	skb_free_datagram(sk, skb);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/rxrpc/ar-recvmsg.c linux-libre-2.6.32.62-gnu1/net/rxrpc/ar-recvmsg.c
--- linux-libre-2.6.32.61-gnu1/net/rxrpc/ar-recvmsg.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/rxrpc/ar-recvmsg.c	2014-05-19 01:54:39.000000000 -0400
@@ -142,10 +142,13 @@ int rxrpc_recvmsg(struct kiocb *iocb, st
 
 		/* copy the peer address and timestamp */
 		if (!continue_call) {
-			if (msg->msg_name && msg->msg_namelen > 0)
+			if (msg->msg_name) {
+				size_t len =
+					sizeof(call->conn->trans->peer->srx);
 				memcpy(msg->msg_name,
-				       &call->conn->trans->peer->srx,
-				       sizeof(call->conn->trans->peer->srx));
+				       &call->conn->trans->peer->srx, len);
+				msg->msg_namelen = len;
+			}
 			sock_recv_timestamp(msg, &rx->sk, skb);
 		}
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sched/sch_atm.c linux-libre-2.6.32.62-gnu1/net/sched/sch_atm.c
--- linux-libre-2.6.32.61-gnu1/net/sched/sch_atm.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sched/sch_atm.c	2014-05-19 01:54:39.000000000 -0400
@@ -628,6 +628,7 @@ static int atm_tc_dump_class(struct Qdis
 		struct sockaddr_atmpvc pvc;
 		int state;
 
+		memset(&pvc, 0, sizeof(pvc));
 		pvc.sap_family = AF_ATMPVC;
 		pvc.sap_addr.itf = flow->vcc->dev ? flow->vcc->dev->number : -1;
 		pvc.sap_addr.vpi = flow->vcc->vpi;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sched/sch_cbq.c linux-libre-2.6.32.62-gnu1/net/sched/sch_cbq.c
--- linux-libre-2.6.32.61-gnu1/net/sched/sch_cbq.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sched/sch_cbq.c	2014-05-19 01:54:39.000000000 -0400
@@ -1458,6 +1458,7 @@ static __inline__ int cbq_dump_wrr(struc
 	unsigned char *b = skb_tail_pointer(skb);
 	struct tc_cbq_wrropt opt;
 
+	memset(&opt, 0, sizeof(opt));
 	opt.flags = 0;
 	opt.allot = cl->allot;
 	opt.priority = cl->priority+1;
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sched/sch_htb.c linux-libre-2.6.32.62-gnu1/net/sched/sch_htb.c
--- linux-libre-2.6.32.61-gnu1/net/sched/sch_htb.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sched/sch_htb.c	2014-05-19 01:54:39.000000000 -0400
@@ -85,7 +85,7 @@ struct htb_class {
 	unsigned int children;
 	struct htb_class *parent;	/* parent class */
 
-	int prio;		/* these two are used only by leaves... */
+	u32 prio;		/* these two are used only by leaves... */
 	int quantum;		/* but stored for parent-to-leaf return */
 
 	union {
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sctp/output.c linux-libre-2.6.32.62-gnu1/net/sctp/output.c
--- linux-libre-2.6.32.61-gnu1/net/sctp/output.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sctp/output.c	2014-05-19 01:54:39.000000000 -0400
@@ -506,7 +506,8 @@ int sctp_packet_transmit(struct sctp_pac
 	 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
 	 */
 	if (!sctp_checksum_disable &&
-	    !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) {
+	    (!(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM)) ||
+	     (dst_xfrm(dst) != NULL) || packet->ipfragok)) {
 		__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
 
 		/* 3) Put the resultant value into the checksum field in the
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sctp/outqueue.c linux-libre-2.6.32.62-gnu1/net/sctp/outqueue.c
--- linux-libre-2.6.32.61-gnu1/net/sctp/outqueue.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sctp/outqueue.c	2014-05-19 01:54:39.000000000 -0400
@@ -203,6 +203,8 @@ static inline int sctp_cacc_skip(struct
  */
 void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
 {
+	memset(q, 0, sizeof(struct sctp_outq));
+
 	q->asoc = asoc;
 	INIT_LIST_HEAD(&q->out_chunk_list);
 	INIT_LIST_HEAD(&q->control_chunk_list);
@@ -210,13 +212,7 @@ void sctp_outq_init(struct sctp_associat
 	INIT_LIST_HEAD(&q->sacked);
 	INIT_LIST_HEAD(&q->abandoned);
 
-	q->fast_rtx = 0;
-	q->outstanding_bytes = 0;
 	q->empty = 1;
-	q->cork  = 0;
-
-	q->malloced = 0;
-	q->out_qlen = 0;
 }
 
 /* Free the outqueue structure and any related pending chunks.
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sctp/sm_make_chunk.c linux-libre-2.6.32.62-gnu1/net/sctp/sm_make_chunk.c
--- linux-libre-2.6.32.61-gnu1/net/sctp/sm_make_chunk.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sctp/sm_make_chunk.c	2014-05-19 01:54:39.000000000 -0400
@@ -1356,8 +1356,8 @@ static void sctp_chunk_destroy(struct sc
 	BUG_ON(!list_empty(&chunk->list));
 	list_del_init(&chunk->transmitted_list);
 
-	/* Free the chunk skb data and the SCTP_chunk stub itself. */
-	dev_kfree_skb(chunk->skb);
+	consume_skb(chunk->skb);
+	consume_skb(chunk->auth_chunk);
 
 	SCTP_DBG_OBJCNT_DEC(chunk);
 	kmem_cache_free(sctp_chunk_cachep, chunk);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sctp/sm_sideeffect.c linux-libre-2.6.32.62-gnu1/net/sctp/sm_sideeffect.c
--- linux-libre-2.6.32.61-gnu1/net/sctp/sm_sideeffect.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sctp/sm_sideeffect.c	2014-05-19 01:54:39.000000000 -0400
@@ -1676,6 +1676,11 @@ static int sctp_cmd_interpreter(sctp_eve
 		case SCTP_CMD_SEND_NEXT_ASCONF:
 			sctp_cmd_send_asconf(asoc);
 			break;
+
+		case SCTP_CMD_SET_ASOC:
+			asoc = cmd->obj.asoc;
+			break;
+
 		default:
 			printk(KERN_WARNING "Impossible command: %u, %p\n",
 			       cmd->verb, cmd->obj.ptr);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sctp/sm_statefuns.c linux-libre-2.6.32.62-gnu1/net/sctp/sm_statefuns.c
--- linux-libre-2.6.32.61-gnu1/net/sctp/sm_statefuns.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sctp/sm_statefuns.c	2014-05-19 01:54:39.000000000 -0400
@@ -745,6 +745,13 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(co
 		struct sctp_chunk auth;
 		sctp_ierror_t ret;
 
+		/* Make sure that we and the peer are AUTH capable */
+		if (!sctp_auth_enable || !new_asoc->peer.auth_capable) {
+			kfree_skb(chunk->auth_chunk);
+			sctp_association_free(new_asoc);
+			return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
+		}
+
 		/* set-up our fake chunk so that we can process it */
 		auth.skb = chunk->auth_chunk;
 		auth.asoc = chunk->asoc;
@@ -755,10 +762,6 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(co
 		auth.transport = chunk->transport;
 
 		ret = sctp_sf_authenticate(ep, new_asoc, type, &auth);
-
-		/* We can now safely free the auth_chunk clone */
-		kfree_skb(chunk->auth_chunk);
-
 		if (ret != SCTP_IERROR_NO_ERROR) {
 			sctp_association_free(new_asoc);
 			return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -2045,9 +2048,15 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupc
 	}
 
 	/* Delete the tempory new association. */
-	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));
+	sctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, SCTP_ASOC(new_asoc));
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 
+	/* Restore association pointer to provide SCTP command interpeter
+	 * with a valid context in case it needs to manipulate
+	 * the queues */
+	sctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC,
+			 SCTP_ASOC((struct sctp_association *)asoc));
+
 	return retval;
 
 nomem:
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/sctp/socket.c linux-libre-2.6.32.62-gnu1/net/sctp/socket.c
--- linux-libre-2.6.32.61-gnu1/net/sctp/socket.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/sctp/socket.c	2014-05-19 01:54:39.000000000 -0400
@@ -67,6 +67,7 @@
 #include <linux/poll.h>
 #include <linux/init.h>
 #include <linux/crypto.h>
+#include <linux/compat.h>
 
 #include <net/ip.h>
 #include <net/icmp.h>
@@ -1284,11 +1285,19 @@ SCTP_STATIC int sctp_setsockopt_connectx
 /*
  * New (hopefully final) interface for the API.
  * We use the sctp_getaddrs_old structure so that use-space library
- * can avoid any unnecessary allocations.   The only defferent part
+ * can avoid any unnecessary allocations. The only different part
  * is that we store the actual length of the address buffer into the
- * addrs_num structure member.  That way we can re-use the existing
+ * addrs_num structure member. That way we can re-use the existing
  * code.
  */
+#ifdef CONFIG_COMPAT
+struct compat_sctp_getaddrs_old {
+	sctp_assoc_t	assoc_id;
+	s32		addr_num;
+	compat_uptr_t	addrs;		/* struct sockaddr * */
+};
+#endif
+
 SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len,
 					char __user *optval,
 					int __user *optlen)
@@ -1297,16 +1306,30 @@ SCTP_STATIC int sctp_getsockopt_connectx
 	sctp_assoc_t assoc_id = 0;
 	int err = 0;
 
-	if (len < sizeof(param))
-		return -EINVAL;
+#ifdef CONFIG_COMPAT
+	if (is_compat_task()) {
+		struct compat_sctp_getaddrs_old param32;
 
-	if (copy_from_user(&param, optval, sizeof(param)))
-		return -EFAULT;
+		if (len < sizeof(param32))
+			return -EINVAL;
+		if (copy_from_user(&param32, optval, sizeof(param32)))
+			return -EFAULT;
 
-	err = __sctp_setsockopt_connectx(sk,
-			(struct sockaddr __user *)param.addrs,
-			param.addr_num, &assoc_id);
+		param.assoc_id = param32.assoc_id;
+		param.addr_num = param32.addr_num;
+		param.addrs = compat_ptr(param32.addrs);
+	} else
+#endif
+	{
+		if (len < sizeof(param))
+			return -EINVAL;
+		if (copy_from_user(&param, optval, sizeof(param)))
+			return -EFAULT;
+	}
 
+	err = __sctp_setsockopt_connectx(sk, (struct sockaddr __user *)
+					 param.addrs, param.addr_num,
+					 &assoc_id);
 	if (err == 0 || err == -EINPROGRESS) {
 		if (copy_to_user(optval, &assoc_id, sizeof(assoc_id)))
 			return -EFAULT;
@@ -3743,6 +3766,12 @@ SCTP_STATIC void sctp_destroy_sock(struc
 
 	/* Release our hold on the endpoint. */
 	ep = sctp_sk(sk)->ep;
+	/* This could happen during socket init, thus we bail out
+	 * early, since the rest of the below is not setup either.
+	 */
+	if (ep == NULL)
+		return;
+
 	sctp_endpoint_free(ep);
 	percpu_counter_dec(&sctp_sockets_allocated);
 	local_bh_disable();
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/socket.c linux-libre-2.6.32.62-gnu1/net/socket.c
--- linux-libre-2.6.32.61-gnu1/net/socket.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/socket.c	2014-05-19 01:54:39.000000000 -0400
@@ -216,12 +216,13 @@ int move_addr_to_user(struct sockaddr *k
 	int err;
 	int len;
 
+	BUG_ON(klen > sizeof(struct sockaddr_storage));
 	err = get_user(len, ulen);
 	if (err)
 		return err;
 	if (len > klen)
 		len = klen;
-	if (len < 0 || len > sizeof(struct sockaddr_storage))
+	if (len < 0)
 		return -EINVAL;
 	if (len) {
 		if (audit_sockaddr(klen, kaddr))
@@ -1744,8 +1745,10 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void
 	msg.msg_iov = &iov;
 	iov.iov_len = size;
 	iov.iov_base = ubuf;
-	msg.msg_name = (struct sockaddr *)&address;
-	msg.msg_namelen = sizeof(address);
+	/* Save some cycles and don't copy the address if not needed */
+	msg.msg_name = addr ? (struct sockaddr *)&address : NULL;
+	/* We assume all kernel code knows the size of sockaddr_storage */
+	msg.msg_namelen = 0;
 	if (sock->file->f_flags & O_NONBLOCK)
 		flags |= MSG_DONTWAIT;
 	err = sock_recvmsg(sock, &msg, size, flags);
@@ -1863,6 +1866,20 @@ SYSCALL_DEFINE2(shutdown, int, fd, int,
 #define COMPAT_NAMELEN(msg)	COMPAT_MSG(msg, msg_namelen)
 #define COMPAT_FLAGS(msg)	COMPAT_MSG(msg, msg_flags)
 
+static int copy_msghdr_from_user(struct msghdr *kmsg,
+                                 struct msghdr __user *umsg)
+{
+	if (copy_from_user(kmsg, umsg, sizeof(struct msghdr)))
+		return -EFAULT;
+
+	if (kmsg->msg_namelen < 0)
+		return -EINVAL;
+
+	if (kmsg->msg_namelen > sizeof(struct sockaddr_storage))
+		kmsg->msg_namelen = sizeof(struct sockaddr_storage);
+	return 0;
+}
+
 /*
  *	BSD sendmsg interface
  */
@@ -1887,8 +1904,11 @@ SYSCALL_DEFINE3(sendmsg, int, fd, struct
 		if (get_compat_msghdr(&msg_sys, msg_compat))
 			return -EFAULT;
 	}
-	else if (copy_from_user(&msg_sys, msg, sizeof(struct msghdr)))
-		return -EFAULT;
+	else {
+		err = copy_msghdr_from_user(&msg_sys, msg);
+		if (err)
+			return err;
+	}
 
 	sock = sockfd_lookup_light(fd, &err, &fput_needed);
 	if (!sock)
@@ -1997,8 +2017,11 @@ SYSCALL_DEFINE3(recvmsg, int, fd, struct
 		if (get_compat_msghdr(&msg_sys, msg_compat))
 			return -EFAULT;
 	}
-	else if (copy_from_user(&msg_sys, msg, sizeof(struct msghdr)))
-		return -EFAULT;
+	else {
+		err = copy_msghdr_from_user(&msg_sys, msg);
+		if (err)
+			return err;
+	}
 
 	sock = sockfd_lookup_light(fd, &err, &fput_needed);
 	if (!sock)
@@ -2017,18 +2040,16 @@ SYSCALL_DEFINE3(recvmsg, int, fd, struct
 			goto out_put;
 	}
 
-	/*
-	 *      Save the user-mode address (verify_iovec will change the
-	 *      kernel msghdr to use the kernel address space)
+	/* Save the user-mode address (verify_iovec will change the
+	 * kernel msghdr to use the kernel address space)
 	 */
-
 	uaddr = (__force void __user *)msg_sys.msg_name;
 	uaddr_len = COMPAT_NAMELEN(msg);
-	if (MSG_CMSG_COMPAT & flags) {
+	if (MSG_CMSG_COMPAT & flags)
 		err = verify_compat_iovec(&msg_sys, iov,
 					  (struct sockaddr *)&addr,
 					  VERIFY_WRITE);
-	} else
+	else
 		err = verify_iovec(&msg_sys, iov,
 				   (struct sockaddr *)&addr,
 				   VERIFY_WRITE);
@@ -2039,6 +2060,9 @@ SYSCALL_DEFINE3(recvmsg, int, fd, struct
 	cmsg_ptr = (unsigned long)msg_sys.msg_control;
 	msg_sys.msg_flags = flags & (MSG_CMSG_CLOEXEC|MSG_CMSG_COMPAT);
 
+	/* We assume all kernel code knows the size of sockaddr_storage */
+	msg_sys.msg_namelen = 0;
+
 	if (sock->file->f_flags & O_NONBLOCK)
 		flags |= MSG_DONTWAIT;
 	err = sock_recvmsg(sock, &msg_sys, total_len, flags);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/tipc/eth_media.c linux-libre-2.6.32.62-gnu1/net/tipc/eth_media.c
--- linux-libre-2.6.32.61-gnu1/net/tipc/eth_media.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/tipc/eth_media.c	2014-05-19 01:54:39.000000000 -0400
@@ -56,6 +56,7 @@ struct eth_bearer {
 	struct tipc_bearer *bearer;
 	struct net_device *dev;
 	struct packet_type tipc_packet_type;
+	struct work_struct setup;
 };
 
 static struct eth_bearer eth_bearers[MAX_ETH_BEARERS];
@@ -122,6 +123,17 @@ static int recv_msg(struct sk_buff *buf,
 }
 
 /**
+ * setup_bearer - setup association between Ethernet bearer and interface
+ */
+static void setup_bearer(struct work_struct *work)
+{
+	struct eth_bearer *eb_ptr =
+		container_of(work, struct eth_bearer, setup);
+
+	dev_add_pack(&eb_ptr->tipc_packet_type);
+}
+
+/**
  * enable_bearer - attach TIPC bearer to an Ethernet interface
  */
 
@@ -157,7 +169,8 @@ static int enable_bearer(struct tipc_bea
 		eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
 		INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list));
 		dev_hold(dev);
-		dev_add_pack(&eb_ptr->tipc_packet_type);
+		INIT_WORK(&eb_ptr->setup, setup_bearer);
+		schedule_work(&eb_ptr->setup);
 	}
 
 	/* Associate TIPC bearer with Ethernet bearer */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/tipc/socket.c linux-libre-2.6.32.62-gnu1/net/tipc/socket.c
--- linux-libre-2.6.32.61-gnu1/net/tipc/socket.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/tipc/socket.c	2014-05-19 01:54:39.000000000 -0400
@@ -917,9 +917,6 @@ static int recv_msg(struct kiocb *iocb,
 		goto exit;
 	}
 
-	/* will be updated in set_orig_addr() if needed */
-	m->msg_namelen = 0;
-
 restart:
 
 	/* Look for a message in receive queue; wait if necessary */
@@ -1053,9 +1050,6 @@ static int recv_stream(struct kiocb *ioc
 		goto exit;
 	}
 
-	/* will be updated in set_orig_addr() if needed */
-	m->msg_namelen = 0;
-
 restart:
 
 	/* Look for a message in receive queue; wait if necessary */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/unix/af_unix.c linux-libre-2.6.32.62-gnu1/net/unix/af_unix.c
--- linux-libre-2.6.32.61-gnu1/net/unix/af_unix.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/unix/af_unix.c	2014-05-19 01:54:39.000000000 -0400
@@ -674,7 +674,9 @@ static int unix_autobind(struct socket *
 	int err;
 	unsigned int retries = 0;
 
-	mutex_lock(&u->readlock);
+	err = mutex_lock_interruptible(&u->readlock);
+	if (err)
+		return err;
 
 	err = 0;
 	if (u->addr)
@@ -806,7 +808,9 @@ static int unix_bind(struct socket *sock
 		goto out;
 	addr_len = err;
 
-	mutex_lock(&u->readlock);
+	err = mutex_lock_interruptible(&u->readlock);
+	if (err)
+		goto out;
 
 	err = -EINVAL;
 	if (u->addr)
@@ -1682,7 +1686,6 @@ static void unix_copy_addr(struct msghdr
 {
 	struct unix_sock *u = unix_sk(sk);
 
-	msg->msg_namelen = 0;
 	if (u->addr) {
 		msg->msg_namelen = u->addr->len;
 		memcpy(msg->msg_name, u->addr->name, u->addr->len);
@@ -1705,8 +1708,6 @@ static int unix_dgram_recvmsg(struct kio
 	if (flags&MSG_OOB)
 		goto out;
 
-	msg->msg_namelen = 0;
-
 	mutex_lock(&u->readlock);
 
 	skb = skb_recv_datagram(sk, flags, noblock, &err);
@@ -1832,8 +1833,6 @@ static int unix_stream_recvmsg(struct ki
 	target = sock_rcvlowat(sk, flags&MSG_WAITALL, size);
 	timeo = sock_rcvtimeo(sk, flags&MSG_DONTWAIT);
 
-	msg->msg_namelen = 0;
-
 	/* Lock the socket to prevent queue disordering
 	 * while sleeps in memcpy_tomsg
 	 */
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/net/x25/af_x25.c linux-libre-2.6.32.62-gnu1/net/x25/af_x25.c
--- linux-libre-2.6.32.61-gnu1/net/x25/af_x25.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/net/x25/af_x25.c	2014-05-19 01:54:39.000000000 -0400
@@ -1294,10 +1294,9 @@ static int x25_recvmsg(struct kiocb *ioc
 	if (sx25) {
 		sx25->sx25_family = AF_X25;
 		sx25->sx25_addr   = x25->dest_addr;
+		msg->msg_namelen = sizeof(*sx25);
 	}
 
-	msg->msg_namelen = sizeof(struct sockaddr_x25);
-
 	lock_sock(sk);
 	x25_check_rbuf(sk);
 	release_sock(sk);
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/security/selinux/ss/services.c linux-libre-2.6.32.62-gnu1/security/selinux/ss/services.c
--- linux-libre-2.6.32.61-gnu1/security/selinux/ss/services.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/security/selinux/ss/services.c	2014-05-19 01:54:39.000000000 -0400
@@ -1074,6 +1074,10 @@ static int security_context_to_sid_core(
 	struct context context;
 	int rc = 0;
 
+	/* An empty security context is never valid. */
+	if (!scontext_len)
+		return -EINVAL;
+
 	if (!ss_initialized) {
 		int i;
 
diff -druNp --no-dereference linux-libre-2.6.32.61-gnu1/virt/kvm/kvm_main.c linux-libre-2.6.32.62-gnu1/virt/kvm/kvm_main.c
--- linux-libre-2.6.32.61-gnu1/virt/kvm/kvm_main.c	2013-06-10 05:43:48.000000000 -0400
+++ linux-libre-2.6.32.62-gnu1/virt/kvm/kvm_main.c	2014-05-19 01:54:39.000000000 -0400
@@ -1846,6 +1846,9 @@ static int kvm_vm_ioctl_create_vcpu(stru
 	int r;
 	struct kvm_vcpu *vcpu, *v;
 
+	if (id >= KVM_MAX_VCPUS)
+		return -EINVAL;
+
 	vcpu = kvm_arch_vcpu_create(kvm, id);
 	if (IS_ERR(vcpu))
 		return PTR_ERR(vcpu);
