diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/alpha/include/asm/termios.h linux-libre-3.18.126-gnu/arch/alpha/include/asm/termios.h
--- linux-libre-3.18.125-gnu/arch/alpha/include/asm/termios.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/alpha/include/asm/termios.h	2018-11-22 01:32:49.000000000 -0500
@@ -72,9 +72,15 @@
 })
 
 #define user_termios_to_kernel_termios(k, u) \
-	copy_from_user(k, u, sizeof(struct termios))
+	copy_from_user(k, u, sizeof(struct termios2))
 
 #define kernel_termios_to_user_termios(u, k) \
+	copy_to_user(u, k, sizeof(struct termios2))
+
+#define user_termios_to_kernel_termios_1(k, u) \
+	copy_from_user(k, u, sizeof(struct termios))
+
+#define kernel_termios_to_user_termios_1(u, k) \
 	copy_to_user(u, k, sizeof(struct termios))
 
 #endif	/* _ALPHA_TERMIOS_H */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/alpha/include/uapi/asm/ioctls.h linux-libre-3.18.126-gnu/arch/alpha/include/uapi/asm/ioctls.h
--- linux-libre-3.18.125-gnu/arch/alpha/include/uapi/asm/ioctls.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/alpha/include/uapi/asm/ioctls.h	2018-11-22 01:32:49.000000000 -0500
@@ -31,6 +31,11 @@
 #define TCXONC		_IO('t', 30)
 #define TCFLSH		_IO('t', 31)
 
+#define TCGETS2		_IOR('T', 42, struct termios2)
+#define TCSETS2		_IOW('T', 43, struct termios2)
+#define TCSETSW2	_IOW('T', 44, struct termios2)
+#define TCSETSF2	_IOW('T', 45, struct termios2)
+
 #define TIOCSWINSZ	_IOW('t', 103, struct winsize)
 #define TIOCGWINSZ	_IOR('t', 104, struct winsize)
 #define	TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/alpha/include/uapi/asm/termbits.h linux-libre-3.18.126-gnu/arch/alpha/include/uapi/asm/termbits.h
--- linux-libre-3.18.125-gnu/arch/alpha/include/uapi/asm/termbits.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/alpha/include/uapi/asm/termbits.h	2018-11-22 01:32:49.000000000 -0500
@@ -25,6 +25,19 @@ struct termios {
 	speed_t c_ospeed;		/* output speed */
 };
 
+/* Alpha has identical termios and termios2 */
+
+struct termios2 {
+	tcflag_t c_iflag;		/* input mode flags */
+	tcflag_t c_oflag;		/* output mode flags */
+	tcflag_t c_cflag;		/* control mode flags */
+	tcflag_t c_lflag;		/* local mode flags */
+	cc_t c_cc[NCCS];		/* control characters */
+	cc_t c_line;			/* line discipline (== c_cc[19]) */
+	speed_t c_ispeed;		/* input speed */
+	speed_t c_ospeed;		/* output speed */
+};
+
 /* Alpha has matching termios and ktermios */
 
 struct ktermios {
@@ -147,6 +160,7 @@ struct ktermios {
 #define B3000000  00034
 #define B3500000  00035
 #define B4000000  00036
+#define BOTHER    00037
 
 #define CSIZE	00001400
 #define   CS5	00000000
@@ -164,6 +178,9 @@ struct ktermios {
 #define CMSPAR	  010000000000		/* mark or space (stick) parity */
 #define CRTSCTS	  020000000000		/* flow control */
 
+#define CIBAUD	07600000
+#define IBSHIFT	16
+
 /* c_lflag bits */
 #define ISIG	0x00000080
 #define ICANON	0x00000100
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/mips/kernel/crash.c linux-libre-3.18.126-gnu/arch/mips/kernel/crash.c
--- linux-libre-3.18.125-gnu/arch/mips/kernel/crash.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/mips/kernel/crash.c	2018-11-22 01:32:49.000000000 -0500
@@ -34,6 +34,9 @@ static void crash_shutdown_secondary(voi
 	if (!cpu_online(cpu))
 		return;
 
+	/* We won't be sent IPIs any more. */
+	set_cpu_online(cpu, false);
+
 	local_irq_disable();
 	if (!cpu_isset(cpu, cpus_in_crash))
 		crash_save_cpu(regs, cpu);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/mips/kernel/machine_kexec.c linux-libre-3.18.126-gnu/arch/mips/kernel/machine_kexec.c
--- linux-libre-3.18.125-gnu/arch/mips/kernel/machine_kexec.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/mips/kernel/machine_kexec.c	2018-11-22 01:32:49.000000000 -0500
@@ -95,6 +95,9 @@ machine_kexec(struct kimage *image)
 			*ptr = (unsigned long) phys_to_virt(*ptr);
 	}
 
+	/* Mark offline BEFORE disabling local irq. */
+	set_cpu_online(smp_processor_id(), false);
+
 	/*
 	 * we do not want to be bothered.
 	 */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/powerpc/boot/crt0.S linux-libre-3.18.126-gnu/arch/powerpc/boot/crt0.S
--- linux-libre-3.18.125-gnu/arch/powerpc/boot/crt0.S	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/powerpc/boot/crt0.S	2018-11-22 01:32:49.000000000 -0500
@@ -47,8 +47,10 @@ p_end:		.long	_end
 p_pstack:	.long	_platform_stack_top
 #endif
 
-	.weak	_zimage_start
 	.globl	_zimage_start
+	/* Clang appears to require the .weak directive to be after the symbol
+	 * is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921  */
+	.weak	_zimage_start
 _zimage_start:
 	.globl	_zimage_start_lib
 _zimage_start_lib:
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/powerpc/mm/tlb_nohash.c linux-libre-3.18.126-gnu/arch/powerpc/mm/tlb_nohash.c
--- linux-libre-3.18.125-gnu/arch/powerpc/mm/tlb_nohash.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/powerpc/mm/tlb_nohash.c	2018-11-22 01:32:49.000000000 -0500
@@ -479,6 +479,9 @@ static void setup_page_sizes(void)
 		for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) {
 			struct mmu_psize_def *def = &mmu_psize_defs[psize];
 
+			if (!def->shift)
+				continue;
+
 			if (tlb1ps & (1U << (def->shift - 10))) {
 				def->flags |= MMU_PAGE_SIZE_DIRECT;
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/sparc/kernel/perf_event.c linux-libre-3.18.126-gnu/arch/sparc/kernel/perf_event.c
--- linux-libre-3.18.125-gnu/arch/sparc/kernel/perf_event.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/sparc/kernel/perf_event.c	2018-11-22 01:32:49.000000000 -0500
@@ -23,6 +23,7 @@
 #include <asm/cpudata.h>
 #include <asm/uaccess.h>
 #include <linux/atomic.h>
+#include <linux/sched_clock.h>
 #include <asm/nmi.h>
 #include <asm/pcr.h>
 #include <asm/cacheflush.h>
@@ -919,6 +920,8 @@ static void read_in_all_counters(struct
 			sparc_perf_event_update(cp, &cp->hw,
 						cpuc->current_idx[i]);
 			cpuc->current_idx[i] = PIC_NO_INDEX;
+			if (cp->hw.state & PERF_HES_STOPPED)
+				cp->hw.state |= PERF_HES_ARCH;
 		}
 	}
 }
@@ -951,10 +954,12 @@ static void calculate_single_pcr(struct
 
 		enc = perf_event_get_enc(cpuc->events[i]);
 		cpuc->pcr[0] &= ~mask_for_index(idx);
-		if (hwc->state & PERF_HES_STOPPED)
+		if (hwc->state & PERF_HES_ARCH) {
 			cpuc->pcr[0] |= nop_for_index(idx);
-		else
+		} else {
 			cpuc->pcr[0] |= event_encoding(enc, idx);
+			hwc->state = 0;
+		}
 	}
 out:
 	cpuc->pcr[0] |= cpuc->event[0]->hw.config_base;
@@ -980,6 +985,9 @@ static void calculate_multiple_pcrs(stru
 
 		cpuc->current_idx[i] = idx;
 
+		if (cp->hw.state & PERF_HES_ARCH)
+			continue;
+
 		sparc_pmu_start(cp, PERF_EF_RELOAD);
 	}
 out:
@@ -1071,6 +1079,8 @@ static void sparc_pmu_start(struct perf_
 	event->hw.state = 0;
 
 	sparc_pmu_enable_event(cpuc, &event->hw, idx);
+
+	perf_event_update_userpage(event);
 }
 
 static void sparc_pmu_stop(struct perf_event *event, int flags)
@@ -1363,9 +1373,9 @@ static int sparc_pmu_add(struct perf_eve
 	cpuc->events[n0] = event->hw.event_base;
 	cpuc->current_idx[n0] = PIC_NO_INDEX;
 
-	event->hw.state = PERF_HES_UPTODATE;
+	event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
 	if (!(ef_flags & PERF_EF_START))
-		event->hw.state |= PERF_HES_STOPPED;
+		event->hw.state |= PERF_HES_ARCH;
 
 	/*
 	 * If group events scheduling transaction was started,
@@ -1577,6 +1587,8 @@ static int __kprobes perf_event_nmi_hand
 	struct perf_sample_data data;
 	struct cpu_hw_events *cpuc;
 	struct pt_regs *regs;
+	u64 finish_clock;
+	u64 start_clock;
 	int i;
 
 	if (!atomic_read(&active_events))
@@ -1590,6 +1602,8 @@ static int __kprobes perf_event_nmi_hand
 		return NOTIFY_DONE;
 	}
 
+	start_clock = sched_clock();
+
 	regs = args->regs;
 
 	cpuc = this_cpu_ptr(&cpu_hw_events);
@@ -1628,6 +1642,10 @@ static int __kprobes perf_event_nmi_hand
 			sparc_pmu_stop(event, 0);
 	}
 
+	finish_clock = sched_clock();
+
+	perf_sample_event_took(finish_clock - start_clock);
+
 	return NOTIFY_STOP;
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/x86/boot/tools/build.c linux-libre-3.18.126-gnu/arch/x86/boot/tools/build.c
--- linux-libre-3.18.125-gnu/arch/x86/boot/tools/build.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/x86/boot/tools/build.c	2018-11-22 01:32:49.000000000 -0500
@@ -391,6 +391,13 @@ int main(int argc, char ** argv)
 		die("Unable to mmap '%s': %m", argv[2]);
 	/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
 	sys_size = (sz + 15 + 4) / 16;
+#ifdef CONFIG_EFI_STUB
+	/*
+	 * COFF requires minimum 32-byte alignment of sections, and
+	 * adding a signature is problematic without that alignment.
+	 */
+	sys_size = (sys_size + 1) & ~1;
+#endif
 
 	/* Patch the setup code with the appropriate size parameters */
 	buf[0x1f1] = setup_sectors-1;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/x86/kernel/check.c linux-libre-3.18.126-gnu/arch/x86/kernel/check.c
--- linux-libre-3.18.125-gnu/arch/x86/kernel/check.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/x86/kernel/check.c	2018-11-22 01:32:49.000000000 -0500
@@ -30,6 +30,11 @@ static __init int set_corruption_check(c
 	ssize_t ret;
 	unsigned long val;
 
+	if (!arg) {
+		pr_err("memory_corruption_check config string not provided\n");
+		return -EINVAL;
+	}
+
 	ret = kstrtoul(arg, 10, &val);
 	if (ret)
 		return ret;
@@ -44,6 +49,11 @@ static __init int set_corruption_check_p
 	ssize_t ret;
 	unsigned long val;
 
+	if (!arg) {
+		pr_err("memory_corruption_check_period config string not provided\n");
+		return -EINVAL;
+	}
+
 	ret = kstrtoul(arg, 10, &val);
 	if (ret)
 		return ret;
@@ -58,6 +68,11 @@ static __init int set_corruption_check_s
 	char *end;
 	unsigned size;
 
+	if (!arg) {
+		pr_err("memory_corruption_check_size config string not provided\n");
+		return -EINVAL;
+	}
+
 	size = memparse(arg, &end);
 
 	if (*end == '\0')
diff -druNp --no-dereference linux-libre-3.18.125-gnu/arch/xtensa/kernel/head.S linux-libre-3.18.126-gnu/arch/xtensa/kernel/head.S
--- linux-libre-3.18.125-gnu/arch/xtensa/kernel/head.S	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/arch/xtensa/kernel/head.S	2018-11-22 01:32:49.000000000 -0500
@@ -88,9 +88,12 @@ _SetupMMU:
 	initialize_mmu
 #if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
 	rsr	a2, excsave1
-	movi	a3, 0x08000000
+	movi	a3, XCHAL_KSEG_PADDR
+	bltu	a2, a3, 1f
+	sub	a2, a2, a3
+	movi	a3, XCHAL_KSEG_SIZE
 	bgeu	a2, a3, 1f
-	movi	a3, 0xd0000000
+	movi	a3, XCHAL_KSEG_CACHED_VADDR
 	add	a2, a2, a3
 	wsr	a2, excsave1
 1:
diff -druNp --no-dereference linux-libre-3.18.125-gnu/crypto/lrw.c linux-libre-3.18.126-gnu/crypto/lrw.c
--- linux-libre-3.18.125-gnu/crypto/lrw.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/crypto/lrw.c	2018-11-22 01:32:49.000000000 -0500
@@ -132,7 +132,12 @@ static inline int get_index128(be128 *bl
 		return x + ffz(val);
 	}
 
-	return x;
+	/*
+	 * If we get here, then x == 128 and we are incrementing the counter
+	 * from all ones to all zeros. This means we must return index 127, i.e.
+	 * the one corresponding to key2*{ 1,...,1 }.
+	 */
+	return 127;
 }
 
 static int crypt(struct blkcipher_desc *d,
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/block/ataflop.c linux-libre-3.18.126-gnu/drivers/block/ataflop.c
--- linux-libre-3.18.125-gnu/drivers/block/ataflop.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/block/ataflop.c	2018-11-22 01:32:49.000000000 -0500
@@ -1933,6 +1933,11 @@ static int __init atari_floppy_init (voi
 		unit[i].disk = alloc_disk(1);
 		if (!unit[i].disk)
 			goto Enomem;
+
+		unit[i].disk->queue = blk_init_queue(do_fd_request,
+						     &ataflop_lock);
+		if (!unit[i].disk->queue)
+			goto Enomem;
 	}
 
 	if (UseTrackbuffer < 0)
@@ -1964,10 +1969,6 @@ static int __init atari_floppy_init (voi
 		sprintf(unit[i].disk->disk_name, "fd%d", i);
 		unit[i].disk->fops = &floppy_fops;
 		unit[i].disk->private_data = &unit[i];
-		unit[i].disk->queue = blk_init_queue(do_fd_request,
-					&ataflop_lock);
-		if (!unit[i].disk->queue)
-			goto Enomem;
 		set_capacity(unit[i].disk, MAX_DISK_SIZE * 2);
 		add_disk(unit[i].disk);
 	}
@@ -1982,13 +1983,17 @@ static int __init atari_floppy_init (voi
 
 	return 0;
 Enomem:
-	while (i--) {
-		struct request_queue *q = unit[i].disk->queue;
+	do {
+		struct gendisk *disk = unit[i].disk;
 
-		put_disk(unit[i].disk);
-		if (q)
-			blk_cleanup_queue(q);
-	}
+		if (disk) {
+			if (disk->queue) {
+				blk_cleanup_queue(disk->queue);
+				disk->queue = NULL;
+			}
+			put_disk(unit[i].disk);
+		}
+	} while (i--);
 
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
 	return -ENOMEM;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/block/swim.c linux-libre-3.18.126-gnu/drivers/block/swim.c
--- linux-libre-3.18.125-gnu/drivers/block/swim.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/block/swim.c	2018-11-22 01:32:49.000000000 -0500
@@ -868,8 +868,17 @@ static int swim_floppy_init(struct swim_
 
 exit_put_disks:
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
-	while (drive--)
-		put_disk(swd->unit[drive].disk);
+	do {
+		struct gendisk *disk = swd->unit[drive].disk;
+
+		if (disk) {
+			if (disk->queue) {
+				blk_cleanup_queue(disk->queue);
+				disk->queue = NULL;
+			}
+			put_disk(disk);
+		}
+	} while (drive--);
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/cdrom/cdrom.c linux-libre-3.18.126-gnu/drivers/cdrom/cdrom.c
--- linux-libre-3.18.125-gnu/drivers/cdrom/cdrom.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/cdrom/cdrom.c	2018-11-22 01:32:49.000000000 -0500
@@ -2424,7 +2424,7 @@ static int cdrom_ioctl_select_disc(struc
 		return -ENOSYS;
 
 	if (arg != CDSL_CURRENT && arg != CDSL_NONE) {
-		if ((int)arg >= cdi->capacity)
+		if (arg >= cdi->capacity)
 			return -EINVAL;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c linux-libre-3.18.126-gnu/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
--- linux-libre-3.18.125-gnu/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c	2018-11-22 01:32:49.000000000 -0500
@@ -256,6 +256,17 @@ static int dmm_txn_commit(struct dmm_txn
 	}
 
 	txn->last_pat->next_pa = 0;
+	/* ensure that the written descriptors are visible to DMM */
+	wmb();
+
+	/*
+	 * NOTE: the wmb() above should be enough, but there seems to be a bug
+	 * in OMAP's memory barrier implementation, which in some rare cases may
+	 * cause the writes not to be observable after wmb().
+	 */
+
+	/* read back to ensure the data is in RAM */
+	readl(&txn->last_pat->next_pa);
 
 	/* write to PAT_DESCR to clear out any pending transaction */
 	writel(0x0, dmm->base + reg[PAT_DESCR][engine->id]);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/iio/adc/at91_adc.c linux-libre-3.18.126-gnu/drivers/iio/adc/at91_adc.c
--- linux-libre-3.18.125-gnu/drivers/iio/adc/at91_adc.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/iio/adc/at91_adc.c	2018-11-22 01:32:49.000000000 -0500
@@ -245,12 +245,14 @@ static irqreturn_t at91_adc_trigger_hand
 	struct iio_poll_func *pf = p;
 	struct iio_dev *idev = pf->indio_dev;
 	struct at91_adc_state *st = iio_priv(idev);
+	struct iio_chan_spec const *chan;
 	int i, j = 0;
 
 	for (i = 0; i < idev->masklength; i++) {
 		if (!test_bit(i, idev->active_scan_mask))
 			continue;
-		st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, i));
+		chan = idev->channels + i;
+		st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, chan->channel));
 		j++;
 	}
 
@@ -276,6 +278,8 @@ static void handle_adc_eoc_trigger(int i
 		iio_trigger_poll(idev->trig);
 	} else {
 		st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
+		/* Needed to ACK the DRDY interruption */
+		at91_adc_readl(st, AT91_ADC_LCDR);
 		st->done = true;
 		wake_up_interruptible(&st->wq_data_avail);
 	}
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/md/bcache/btree.c linux-libre-3.18.126-gnu/drivers/md/bcache/btree.c
--- linux-libre-3.18.125-gnu/drivers/md/bcache/btree.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/md/bcache/btree.c	2018-11-22 01:32:49.000000000 -0500
@@ -2372,7 +2372,7 @@ static int refill_keybuf_fn(struct btree
 	struct keybuf *buf = refill->buf;
 	int ret = MAP_CONTINUE;
 
-	if (bkey_cmp(k, refill->end) >= 0) {
+	if (bkey_cmp(k, refill->end) > 0) {
 		ret = MAP_DONE;
 		goto out;
 	}
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/md/dm.c linux-libre-3.18.126-gnu/drivers/md/dm.c
--- linux-libre-3.18.125-gnu/drivers/md/dm.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/md/dm.c	2018-11-22 01:32:49.000000000 -0500
@@ -2589,7 +2589,6 @@ static void __dm_destroy(struct mapped_d
 	might_sleep();
 
 	spin_lock(&_minor_lock);
-	map = dm_get_live_table(md, &srcu_idx);
 	idr_replace(&_minor_idr, MINOR_ALLOCED, MINOR(disk_devt(dm_disk(md))));
 	set_bit(DMF_FREEING, &md->flags);
 	spin_unlock(&_minor_lock);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/md/dm-ioctl.c linux-libre-3.18.126-gnu/drivers/md/dm-ioctl.c
--- linux-libre-3.18.125-gnu/drivers/md/dm-ioctl.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/md/dm-ioctl.c	2018-11-22 01:32:49.000000000 -0500
@@ -1681,8 +1681,7 @@ static void free_params(struct dm_ioctl
 }
 
 static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kernel,
-		       int ioctl_flags,
-		       struct dm_ioctl **param, int *param_flags)
+		       int ioctl_flags, struct dm_ioctl **param, int *param_flags)
 {
 	struct dm_ioctl *dmi;
 	int secure_data;
@@ -1730,18 +1729,13 @@ static int copy_params(struct dm_ioctl _
 		return -ENOMEM;
 	}
 
-	if (copy_from_user(dmi, user, param_kernel->data_size))
-		goto bad;
+	/* Copy from param_kernel (which was already copied from user) */
+	memcpy(dmi, param_kernel, minimum_data_size);
 
-data_copied:
-	/*
-	 * Abort if something changed the ioctl data while it was being copied.
-	 */
-	if (dmi->data_size != param_kernel->data_size) {
-		DMERR("rejecting ioctl: data size modified while processing parameters");
+	if (copy_from_user(&dmi->data, (char __user *)user + minimum_data_size,
+			   param_kernel->data_size - minimum_data_size))
 		goto bad;
-	}
-
+data_copied:
 	/* Wipe the user buffer so we do not return it to userspace */
 	if (secure_data && clear_user(user, param_kernel->data_size))
 		goto bad;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/media/i2c/tvp5150.c linux-libre-3.18.126-gnu/drivers/media/i2c/tvp5150.c
--- linux-libre-3.18.125-gnu/drivers/media/i2c/tvp5150.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/media/i2c/tvp5150.c	2018-11-22 01:32:49.000000000 -0500
@@ -864,9 +864,6 @@ static int tvp5150_s_crop(struct v4l2_su
 
 	/* tvp5150 has some special limits */
 	rect.left = clamp(rect.left, 0, TVP5150_MAX_CROP_LEFT);
-	rect.width = clamp_t(unsigned int, rect.width,
-			     TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect.left,
-			     TVP5150_H_MAX - rect.left);
 	rect.top = clamp(rect.top, 0, TVP5150_MAX_CROP_TOP);
 
 	/* Calculate height based on current standard */
@@ -880,9 +877,16 @@ static int tvp5150_s_crop(struct v4l2_su
 	else
 		hmax = TVP5150_V_MAX_OTHERS;
 
-	rect.height = clamp_t(unsigned int, rect.height,
+	/*
+	 * alignments:
+	 *  - width = 2 due to UYVY colorspace
+	 *  - height, image = no special alignment
+	 */
+	v4l_bound_align_image(&rect.width,
+			      TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect.left,
+			      TVP5150_H_MAX - rect.left, 1, &rect.height,
 			      hmax - TVP5150_MAX_CROP_TOP - rect.top,
-			      hmax - rect.top);
+			      hmax - rect.top, 0, 0);
 
 	tvp5150_write(sd, TVP5150_VERT_BLANKING_START, rect.top);
 	tvp5150_write(sd, TVP5150_VERT_BLANKING_STOP,
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/media/pci/cx23885/altera-ci.c linux-libre-3.18.126-gnu/drivers/media/pci/cx23885/altera-ci.c
--- linux-libre-3.18.125-gnu/drivers/media/pci/cx23885/altera-ci.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/media/pci/cx23885/altera-ci.c	2018-11-22 01:32:49.000000000 -0500
@@ -662,6 +662,10 @@ static int altera_hw_filt_init(struct al
 		}
 
 		temp_int = append_internal(inter);
+		if (!temp_int) {
+			ret = -ENOMEM;
+			goto err;
+		}
 		inter->filts_used = 1;
 		inter->dev = config->dev;
 		inter->fpga_rw = config->fpga_rw;
@@ -696,6 +700,7 @@ err:
 		     __func__, ret);
 
 	kfree(pid_filt);
+	kfree(inter);
 
 	return ret;
 }
@@ -731,6 +736,10 @@ int altera_ci_init(struct altera_ci_conf
 		}
 
 		temp_int = append_internal(inter);
+		if (!temp_int) {
+			ret = -ENOMEM;
+			goto err;
+		}
 		inter->cis_used = 1;
 		inter->dev = config->dev;
 		inter->fpga_rw = config->fpga_rw;
@@ -799,6 +808,7 @@ err:
 	ci_dbg_print("%s: Cannot initialize CI: Error %d.\n", __func__, ret);
 
 	kfree(state);
+	kfree(inter);
 
 	return ret;
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/media/usb/em28xx/em28xx-cards.c linux-libre-3.18.126-gnu/drivers/media/usb/em28xx/em28xx-cards.c
--- linux-libre-3.18.125-gnu/drivers/media/usb/em28xx/em28xx-cards.c	2018-11-10 15:38:43.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/media/usb/em28xx/em28xx-cards.c	2018-11-22 09:30:49.000000000 -0500
@@ -2001,13 +2001,13 @@ struct em28xx_board em28xx_boards[] = {
 		.input           = { {
 			.type     = EM28XX_VMUX_COMPOSITE1,
 			.vmux     = TVP5150_COMPOSITE1,
-			.amux     = EM28XX_AUDIO_SRC_LINE,
+			.amux     = EM28XX_AMUX_LINE_IN,
 			.gpio     = terratec_av350_unmute_gpio,
 
 		}, {
 			.type     = EM28XX_VMUX_SVIDEO,
 			.vmux     = TVP5150_SVIDEO,
-			.amux     = EM28XX_AUDIO_SRC_LINE,
+			.amux     = EM28XX_AMUX_LINE_IN,
 			.gpio     = terratec_av350_unmute_gpio,
 		} },
 	},
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/media/usb/em28xx/em28xx-video.c linux-libre-3.18.126-gnu/drivers/media/usb/em28xx/em28xx-video.c
--- linux-libre-3.18.125-gnu/drivers/media/usb/em28xx/em28xx-video.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/media/usb/em28xx/em28xx-video.c	2018-11-22 01:32:49.000000000 -0500
@@ -1141,6 +1141,8 @@ static void em28xx_ctrl_notify(struct v4
 {
 	struct em28xx *dev = priv;
 
+	dev->v4l2->field_count = 0;
+
 	/*
 	 * In the case of non-AC97 volume controls, we still need
 	 * to do some setups at em28xx, in order to mute/unmute
@@ -1280,9 +1282,9 @@ static int vidioc_try_fmt_vid_cap(struct
 
 	fmt = format_by_fourcc(f->fmt.pix.pixelformat);
 	if (!fmt) {
-		em28xx_videodbg("Fourcc format (%08x) invalid.\n",
-				f->fmt.pix.pixelformat);
-		return -EINVAL;
+		fmt = &format[0];
+		em28xx_videodbg("Fourcc format (%08x) invalid. Using default (%08x).\n",
+				f->fmt.pix.pixelformat, fmt->fourcc);
 	}
 
 	if (dev->board.is_em2800) {
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/misc/genwqe/card_base.h linux-libre-3.18.126-gnu/drivers/misc/genwqe/card_base.h
--- linux-libre-3.18.125-gnu/drivers/misc/genwqe/card_base.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/misc/genwqe/card_base.h	2018-11-22 01:32:49.000000000 -0500
@@ -405,7 +405,7 @@ struct genwqe_file {
 	struct file *filp;
 
 	struct fasync_struct *async_queue;
-	struct task_struct *owner;
+	struct pid *opener;
 	struct list_head list;		/* entry in list of open files */
 
 	spinlock_t map_lock;		/* lock for dma_mappings */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/misc/genwqe/card_dev.c linux-libre-3.18.126-gnu/drivers/misc/genwqe/card_dev.c
--- linux-libre-3.18.125-gnu/drivers/misc/genwqe/card_dev.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/misc/genwqe/card_dev.c	2018-11-22 01:32:49.000000000 -0500
@@ -52,7 +52,7 @@ static void genwqe_add_file(struct genwq
 {
 	unsigned long flags;
 
-	cfile->owner = current;
+	cfile->opener = get_pid(task_tgid(current));
 	spin_lock_irqsave(&cd->file_lock, flags);
 	list_add(&cfile->list, &cd->file_list);
 	spin_unlock_irqrestore(&cd->file_lock, flags);
@@ -65,6 +65,7 @@ static int genwqe_del_file(struct genwqe
 	spin_lock_irqsave(&cd->file_lock, flags);
 	list_del(&cfile->list);
 	spin_unlock_irqrestore(&cd->file_lock, flags);
+	put_pid(cfile->opener);
 
 	return 0;
 }
@@ -275,7 +276,7 @@ static int genwqe_kill_fasync(struct gen
 	return files;
 }
 
-static int genwqe_force_sig(struct genwqe_dev *cd, int sig)
+static int genwqe_terminate(struct genwqe_dev *cd)
 {
 	unsigned int files = 0;
 	unsigned long flags;
@@ -283,7 +284,7 @@ static int genwqe_force_sig(struct genwq
 
 	spin_lock_irqsave(&cd->file_lock, flags);
 	list_for_each_entry(cfile, &cd->file_list, list) {
-		force_sig(sig, cfile->owner);
+		kill_pid(cfile->opener, SIGKILL, 1);
 		files++;
 	}
 	spin_unlock_irqrestore(&cd->file_lock, flags);
@@ -1356,7 +1357,7 @@ static int genwqe_inform_and_stop_proces
 		dev_warn(&pci_dev->dev,
 			 "[%s] send SIGKILL and wait ...\n", __func__);
 
-		rc = genwqe_force_sig(cd, SIGKILL); /* force terminate */
+		rc = genwqe_terminate(cd);
 		if (rc) {
 			/* Give kill_timout more seconds to end processes */
 			for (i = 0; (i < genwqe_kill_timeout) &&
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/mmc/host/sdhci-pci-o2micro.c linux-libre-3.18.126-gnu/drivers/mmc/host/sdhci-pci-o2micro.c
--- linux-libre-3.18.125-gnu/drivers/mmc/host/sdhci-pci-o2micro.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/mmc/host/sdhci-pci-o2micro.c	2018-11-22 01:32:49.000000000 -0500
@@ -336,6 +336,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_
 		pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
 		break;
 	case PCI_DEVICE_ID_O2_SEABIRD0:
+		if (chip->pdev->revision == 0x01)
+			chip->quirks |= SDHCI_QUIRK_DELAY_AFTER_POWER;
+		/* fall through */
 	case PCI_DEVICE_ID_O2_SEABIRD1:
 		/* UnLock WP */
 		ret = pci_read_config_byte(chip->pdev,
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/mtd/devices/Kconfig linux-libre-3.18.126-gnu/drivers/mtd/devices/Kconfig
--- linux-libre-3.18.125-gnu/drivers/mtd/devices/Kconfig	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/mtd/devices/Kconfig	2018-11-22 01:32:49.000000000 -0500
@@ -200,7 +200,7 @@ comment "Disk-On-Chip Device Drivers"
 config MTD_DOCG3
 	tristate "M-Systems Disk-On-Chip G3"
 	select BCH
-	select BCH_CONST_PARAMS
+	select BCH_CONST_PARAMS if !MTD_NAND_BCH
 	select BITREVERSE
 	---help---
 	  This provides an MTD device driver for the M-Systems DiskOnChip
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qla3xxx.c linux-libre-3.18.126-gnu/drivers/net/ethernet/qlogic/qla3xxx.c
--- linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qla3xxx.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/net/ethernet/qlogic/qla3xxx.c	2018-11-22 01:32:49.000000000 -0500
@@ -382,8 +382,6 @@ static void fm93c56a_select(struct ql3_a
 
 	qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1;
 	ql_write_nvram_reg(qdev, spir, ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
-	ql_write_nvram_reg(qdev, spir,
-			   ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
 }
 
 /*
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/net/tun.c linux-libre-3.18.126-gnu/drivers/net/tun.c
--- linux-libre-3.18.125-gnu/drivers/net/tun.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/net/tun.c	2018-11-22 01:32:49.000000000 -0500
@@ -1423,6 +1423,8 @@ static void tun_setup(struct net_device
  */
 static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
 {
+	if (!data)
+		return 0;
 	return -EINVAL;
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/net/wireless/ath/ath10k/wmi.c linux-libre-3.18.126-gnu/drivers/net/wireless/ath/ath10k/wmi.c
--- linux-libre-3.18.125-gnu/drivers/net/wireless/ath/ath10k/wmi.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/net/wireless/ath/ath10k/wmi.c	2018-11-22 01:32:49.000000000 -0500
@@ -751,6 +751,12 @@ int ath10k_wmi_cmd_send(struct ath10k *a
 	if (ret)
 		dev_kfree_skb_any(skb);
 
+	if (ret == -EAGAIN) {
+		ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n",
+			    cmd_id);
+		queue_work(ar->workqueue, &ar->restart_work);
+	}
+
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/pcmcia/ricoh.h linux-libre-3.18.126-gnu/drivers/pcmcia/ricoh.h
--- linux-libre-3.18.125-gnu/drivers/pcmcia/ricoh.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/pcmcia/ricoh.h	2018-11-22 01:32:49.000000000 -0500
@@ -119,6 +119,10 @@
 #define  RL5C4XX_MISC_CONTROL           0x2F /* 8 bit */
 #define  RL5C4XX_ZV_ENABLE              0x08
 
+/* Misc Control 3 Register */
+#define RL5C4XX_MISC3			0x00A2 /* 16 bit */
+#define  RL5C47X_MISC3_CB_CLKRUN_DIS	BIT(1)
+
 #ifdef __YENTA_H
 
 #define rl_misc(socket)		((socket)->private[0])
@@ -156,6 +160,35 @@ static void ricoh_set_zv(struct yenta_so
         }
 }
 
+static void ricoh_set_clkrun(struct yenta_socket *socket, bool quiet)
+{
+	u16 misc3;
+
+	/*
+	 * RL5C475II likely has this setting, too, however no datasheet
+	 * is publicly available for this chip
+	 */
+	if (socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C476 &&
+	    socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C478)
+		return;
+
+	if (socket->dev->revision < 0x80)
+		return;
+
+	misc3 = config_readw(socket, RL5C4XX_MISC3);
+	if (misc3 & RL5C47X_MISC3_CB_CLKRUN_DIS) {
+		if (!quiet)
+			dev_dbg(&socket->dev->dev,
+				"CLKRUN feature already disabled\n");
+	} else if (disable_clkrun) {
+		if (!quiet)
+			dev_info(&socket->dev->dev,
+				 "Disabling CLKRUN feature\n");
+		misc3 |= RL5C47X_MISC3_CB_CLKRUN_DIS;
+		config_writew(socket, RL5C4XX_MISC3, misc3);
+	}
+}
+
 static void ricoh_save_state(struct yenta_socket *socket)
 {
 	rl_misc(socket) = config_readw(socket, RL5C4XX_MISC);
@@ -172,6 +205,7 @@ static void ricoh_restore_state(struct y
 	config_writew(socket, RL5C4XX_16BIT_IO_0, rl_io(socket));
 	config_writew(socket, RL5C4XX_16BIT_MEM_0, rl_mem(socket));
 	config_writew(socket, RL5C4XX_CONFIG, rl_config(socket));
+	ricoh_set_clkrun(socket, true);
 }
 
 
@@ -197,6 +231,7 @@ static int ricoh_override(struct yenta_s
 	config_writew(socket, RL5C4XX_CONFIG, config);
 
 	ricoh_set_zv(socket);
+	ricoh_set_clkrun(socket, false);
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/pcmcia/yenta_socket.c linux-libre-3.18.126-gnu/drivers/pcmcia/yenta_socket.c
--- linux-libre-3.18.125-gnu/drivers/pcmcia/yenta_socket.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/pcmcia/yenta_socket.c	2018-11-22 01:32:49.000000000 -0500
@@ -26,7 +26,8 @@
 
 static bool disable_clkrun;
 module_param(disable_clkrun, bool, 0444);
-MODULE_PARM_DESC(disable_clkrun, "If PC card doesn't function properly, please try this option");
+MODULE_PARM_DESC(disable_clkrun,
+		 "If PC card doesn't function properly, please try this option (TI and Ricoh bridges only)");
 
 static bool isa_probe = 1;
 module_param(isa_probe, bool, 0444);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/scsi/esp_scsi.c linux-libre-3.18.126-gnu/drivers/scsi/esp_scsi.c
--- linux-libre-3.18.125-gnu/drivers/scsi/esp_scsi.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/scsi/esp_scsi.c	2018-11-22 01:32:49.000000000 -0500
@@ -1316,6 +1316,7 @@ static int esp_data_bytes_sent(struct es
 
 	bytes_sent = esp->data_dma_len;
 	bytes_sent -= ecount;
+	bytes_sent -= esp->send_cmd_residual;
 
 	if (!(ent->flags & ESP_CMD_FLAG_WRITE))
 		bytes_sent -= fifo_cnt;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/scsi/esp_scsi.h linux-libre-3.18.126-gnu/drivers/scsi/esp_scsi.h
--- linux-libre-3.18.125-gnu/drivers/scsi/esp_scsi.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/scsi/esp_scsi.h	2018-11-22 01:32:49.000000000 -0500
@@ -524,6 +524,8 @@ struct esp {
 
 	void			*dma;
 	int			dmarev;
+
+	u32			send_cmd_residual;
 };
 
 /* A front-end driver for the ESP chip should do the following in
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/scsi/lpfc/lpfc_sli.c linux-libre-3.18.126-gnu/drivers/scsi/lpfc/lpfc_sli.c
--- linux-libre-3.18.125-gnu/drivers/scsi/lpfc/lpfc_sli.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/scsi/lpfc/lpfc_sli.c	2018-11-22 01:32:49.000000000 -0500
@@ -3441,6 +3441,7 @@ lpfc_sli_handle_slow_ring_event_s4(struc
 	struct hbq_dmabuf *dmabuf;
 	struct lpfc_cq_event *cq_event;
 	unsigned long iflag;
+	int count = 0;
 
 	spin_lock_irqsave(&phba->hbalock, iflag);
 	phba->hba_flag &= ~HBA_SP_QUEUE_EVT;
@@ -3462,16 +3463,22 @@ lpfc_sli_handle_slow_ring_event_s4(struc
 			if (irspiocbq)
 				lpfc_sli_sp_handle_rspiocb(phba, pring,
 							   irspiocbq);
+			count++;
 			break;
 		case CQE_CODE_RECEIVE:
 		case CQE_CODE_RECEIVE_V1:
 			dmabuf = container_of(cq_event, struct hbq_dmabuf,
 					      cq_event);
 			lpfc_sli4_handle_received_buffer(phba, dmabuf);
+			count++;
 			break;
 		default:
 			break;
 		}
+
+		/* Limit the number of events to 64 to avoid soft lockups */
+		if (count == 64)
+			break;
 	}
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/scsi/mac_esp.c linux-libre-3.18.126-gnu/drivers/scsi/mac_esp.c
--- linux-libre-3.18.125-gnu/drivers/scsi/mac_esp.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/scsi/mac_esp.c	2018-11-22 01:32:49.000000000 -0500
@@ -426,6 +426,8 @@ static void mac_esp_send_pio_cmd(struct
 			scsi_esp_cmd(esp, ESP_CMD_TI);
 		}
 	}
+
+	esp->send_cmd_residual = esp_count;
 }
 
 static int mac_esp_irq_pending(struct esp *esp)
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/tc/tc.c linux-libre-3.18.126-gnu/drivers/tc/tc.c
--- linux-libre-3.18.125-gnu/drivers/tc/tc.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/tc/tc.c	2018-11-22 01:32:49.000000000 -0500
@@ -2,7 +2,7 @@
  *	TURBOchannel bus services.
  *
  *	Copyright (c) Harald Koerfgen, 1998
- *	Copyright (c) 2001, 2003, 2005, 2006  Maciej W. Rozycki
+ *	Copyright (c) 2001, 2003, 2005, 2006, 2018  Maciej W. Rozycki
  *	Copyright (c) 2005  James Simmons
  *
  *	This file is subject to the terms and conditions of the GNU
@@ -10,6 +10,7 @@
  *	directory of this archive for more details.
  */
 #include <linux/compiler.h>
+#include <linux/dma-mapping.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -93,6 +94,11 @@ static void __init tc_bus_add_devices(st
 		tdev->dev.bus = &tc_bus_type;
 		tdev->slot = slot;
 
+		/* TURBOchannel has 34-bit DMA addressing (16GiB space). */
+		tdev->dma_mask = DMA_BIT_MASK(34);
+		tdev->dev.dma_mask = &tdev->dma_mask;
+		tdev->dev.coherent_dma_mask = DMA_BIT_MASK(34);
+
 		for (i = 0; i < 8; i++) {
 			tdev->firmware[i] =
 				readb(module + offset + TC_FIRM_VER + 4 * i);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/tty/serial/kgdboc.c linux-libre-3.18.126-gnu/drivers/tty/serial/kgdboc.c
--- linux-libre-3.18.125-gnu/drivers/tty/serial/kgdboc.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/tty/serial/kgdboc.c	2018-11-22 01:32:49.000000000 -0500
@@ -133,6 +133,11 @@ static void kgdboc_unregister_kbd(void)
 
 static int kgdboc_option_setup(char *opt)
 {
+	if (!opt) {
+		pr_err("kgdboc: config string not provided\n");
+		return -EINVAL;
+	}
+
 	if (strlen(opt) >= MAX_CONFIG_LEN) {
 		printk(KERN_ERR "kgdboc: config string too long\n");
 		return -ENOSPC;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/tty/tty_io.c linux-libre-3.18.126-gnu/drivers/tty/tty_io.c
--- linux-libre-3.18.125-gnu/drivers/tty/tty_io.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/tty/tty_io.c	2018-11-22 01:32:49.000000000 -0500
@@ -357,7 +357,7 @@ struct tty_driver *tty_find_polling_driv
 	mutex_lock(&tty_mutex);
 	/* Search through the tty devices to look for a match */
 	list_for_each_entry(p, &tty_drivers, tty_drivers) {
-		if (strncmp(name, p->name, len) != 0)
+		if (!len || strncmp(name, p->name, len) != 0)
 			continue;
 		stp = str;
 		if (*stp == ',')
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/tty/tty_ioctl.c linux-libre-3.18.126-gnu/drivers/tty/tty_ioctl.c
--- linux-libre-3.18.125-gnu/drivers/tty/tty_ioctl.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/tty/tty_ioctl.c	2018-11-22 01:32:49.000000000 -0500
@@ -327,7 +327,7 @@ speed_t tty_termios_baud_rate(struct kte
 		else
 			cbaud += 15;
 	}
-	return baud_table[cbaud];
+	return cbaud >= n_baud_table ? 0 : baud_table[cbaud];
 }
 EXPORT_SYMBOL(tty_termios_baud_rate);
 
@@ -363,7 +363,7 @@ speed_t tty_termios_input_baud_rate(stru
 		else
 			cbaud += 15;
 	}
-	return baud_table[cbaud];
+	return cbaud >= n_baud_table ? 0 : baud_table[cbaud];
 #else
 	return tty_termios_baud_rate(termios);
 #endif
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/uio/uio.c linux-libre-3.18.126-gnu/drivers/uio/uio.c
--- linux-libre-3.18.125-gnu/drivers/uio/uio.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/uio/uio.c	2018-11-22 01:32:49.000000000 -0500
@@ -249,6 +249,8 @@ static struct class uio_class = {
 	.dev_groups = uio_groups,
 };
 
+bool uio_class_registered;
+
 /*
  * device functions
  */
@@ -771,6 +773,9 @@ static int init_uio_class(void)
 		printk(KERN_ERR "class_register failed for uio\n");
 		goto err_class_register;
 	}
+
+	uio_class_registered = true;
+
 	return 0;
 
 err_class_register:
@@ -781,6 +786,7 @@ exit:
 
 static void release_uio_class(void)
 {
+	uio_class_registered = false;
 	class_unregister(&uio_class);
 	uio_major_cleanup();
 }
@@ -800,6 +806,9 @@ int __uio_register_device(struct module
 	struct uio_device *idev;
 	int ret = 0;
 
+	if (!uio_class_registered)
+		return -EPROBE_DEFER;
+
 	if (!parent || !info || !info->name || !info->version)
 		return -EINVAL;
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/usb/chipidea/otg.h linux-libre-3.18.126-gnu/drivers/usb/chipidea/otg.h
--- linux-libre-3.18.125-gnu/drivers/usb/chipidea/otg.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/usb/chipidea/otg.h	2018-11-22 01:32:49.000000000 -0500
@@ -20,7 +20,8 @@ void ci_handle_vbus_change(struct ci_hdr
 static inline void ci_otg_queue_work(struct ci_hdrc *ci)
 {
 	disable_irq_nosync(ci->irq);
-	queue_work(ci->wq, &ci->work);
+	if (queue_work(ci->wq, &ci->work) == false)
+		enable_irq(ci->irq);
 }
 
 #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/mach64_accel.c linux-libre-3.18.126-gnu/drivers/video/fbdev/aty/mach64_accel.c
--- linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/mach64_accel.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/video/fbdev/aty/mach64_accel.c	2018-11-22 01:32:49.000000000 -0500
@@ -126,7 +126,7 @@ void aty_init_engine(struct atyfb_par *p
 
 	/* set host attributes */
 	wait_for_fifo(13, par);
-	aty_st_le32(HOST_CNTL, 0, par);
+	aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par);
 
 	/* set pattern attributes */
 	aty_st_le32(PAT_REG0, 0, par);
@@ -232,7 +232,8 @@ void atyfb_copyarea(struct fb_info *info
 		rotation = rotation24bpp(dx, direction);
 	}
 
-	wait_for_fifo(4, par);
+	wait_for_fifo(5, par);
+	aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, par);
 	aty_st_le32(DP_SRC, FRGD_SRC_BLIT, par);
 	aty_st_le32(SRC_Y_X, (sx << 16) | sy, par);
 	aty_st_le32(SRC_HEIGHT1_WIDTH1, (width << 16) | area->height, par);
@@ -268,7 +269,8 @@ void atyfb_fillrect(struct fb_info *info
 		rotation = rotation24bpp(dx, DST_X_LEFT_TO_RIGHT);
 	}
 
-	wait_for_fifo(3, par);
+	wait_for_fifo(4, par);
+	aty_st_le32(DP_PIX_WIDTH, par->crtc.dp_pix_width, par);
 	aty_st_le32(DP_FRGD_CLR, color, par);
 	aty_st_le32(DP_SRC,
 		    BKGD_SRC_BKGD_CLR | FRGD_SRC_FRGD_CLR | MONO_SRC_ONE,
@@ -283,7 +285,7 @@ void atyfb_imageblit(struct fb_info *inf
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
 	u32 src_bytes, dx = image->dx, dy = image->dy, width = image->width;
-	u32 pix_width_save, pix_width, host_cntl, rotation = 0, src, mix;
+	u32 pix_width, rotation = 0, src, mix;
 
 	if (par->asleep)
 		return;
@@ -295,8 +297,7 @@ void atyfb_imageblit(struct fb_info *inf
 		return;
 	}
 
-	pix_width = pix_width_save = aty_ld_le32(DP_PIX_WIDTH, par);
-	host_cntl = aty_ld_le32(HOST_CNTL, par) | HOST_BYTE_ALIGN;
+	pix_width = par->crtc.dp_pix_width;
 
 	switch (image->depth) {
 	case 1:
@@ -344,7 +345,7 @@ void atyfb_imageblit(struct fb_info *inf
 		 * since Rage 3D IIc we have DP_HOST_TRIPLE_EN bit
 		 * this hwaccelerated triple has an issue with not aligned data
 		 */
-		if (M64_HAS(HW_TRIPLE) && image->width % 8 == 0)
+		if (image->depth == 1 && M64_HAS(HW_TRIPLE) && image->width % 8 == 0)
 			pix_width |= DP_HOST_TRIPLE_EN;
 	}
 
@@ -369,19 +370,18 @@ void atyfb_imageblit(struct fb_info *inf
 		mix = FRGD_MIX_D_XOR_S | BKGD_MIX_D;
 	}
 
-	wait_for_fifo(6, par);
-	aty_st_le32(DP_WRITE_MASK, 0xFFFFFFFF, par);
+	wait_for_fifo(5, par);
 	aty_st_le32(DP_PIX_WIDTH, pix_width, par);
 	aty_st_le32(DP_MIX, mix, par);
 	aty_st_le32(DP_SRC, src, par);
-	aty_st_le32(HOST_CNTL, host_cntl, par);
+	aty_st_le32(HOST_CNTL, HOST_BYTE_ALIGN, par);
 	aty_st_le32(DST_CNTL, DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT | rotation, par);
 
 	draw_rect(dx, dy, width, image->height, par);
 	src_bytes = (((image->width * image->depth) + 7) / 8) * image->height;
 
 	/* manual triple each pixel */
-	if (info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) {
+	if (image->depth == 1 && info->var.bits_per_pixel == 24 && !(pix_width & DP_HOST_TRIPLE_EN)) {
 		int inbit, outbit, mult24, byte_id_in_dword, width;
 		u8 *pbitmapin = (u8*)image->data, *pbitmapout;
 		u32 hostdword;
@@ -414,7 +414,7 @@ void atyfb_imageblit(struct fb_info *inf
 				}
 			}
 			wait_for_fifo(1, par);
-			aty_st_le32(HOST_DATA0, hostdword, par);
+			aty_st_le32(HOST_DATA0, le32_to_cpu(hostdword), par);
 		}
 	} else {
 		u32 *pbitmap, dwords = (src_bytes + 3) / 4;
@@ -423,8 +423,4 @@ void atyfb_imageblit(struct fb_info *inf
 			aty_st_le32(HOST_DATA0, get_unaligned_le32(pbitmap), par);
 		}
 	}
-
-	/* restore pix_width */
-	wait_for_fifo(1, par);
-	aty_st_le32(DP_PIX_WIDTH, pix_width_save, par);
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/drivers/w1/masters/omap_hdq.c linux-libre-3.18.126-gnu/drivers/w1/masters/omap_hdq.c
--- linux-libre-3.18.125-gnu/drivers/w1/masters/omap_hdq.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/drivers/w1/masters/omap_hdq.c	2018-11-22 01:32:49.000000000 -0500
@@ -622,6 +622,8 @@ static int omap_hdq_remove(struct platfo
 	/* remove module dependency */
 	pm_runtime_disable(&pdev->dev);
 
+	w1_remove_master_device(&omap_w1_master);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/cifs/cifs_debug.c linux-libre-3.18.126-gnu/fs/cifs/cifs_debug.c
--- linux-libre-3.18.125-gnu/fs/cifs/cifs_debug.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/cifs/cifs_debug.c	2018-11-22 01:32:49.000000000 -0500
@@ -271,6 +271,9 @@ static ssize_t cifs_stats_proc_write(str
 		atomic_set(&totBufAllocCount, 0);
 		atomic_set(&totSmBufAllocCount, 0);
 #endif /* CONFIG_CIFS_STATS2 */
+		atomic_set(&tcpSesReconnectCount, 0);
+		atomic_set(&tconInfoReconnectCount, 0);
+
 		spin_lock(&GlobalMid_Lock);
 		GlobalMaxActiveXid = 0;
 		GlobalCurrentXid = 0;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/cifs/cifs_spnego.c linux-libre-3.18.126-gnu/fs/cifs/cifs_spnego.c
--- linux-libre-3.18.125-gnu/fs/cifs/cifs_spnego.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/cifs/cifs_spnego.c	2018-11-22 01:32:49.000000000 -0500
@@ -147,8 +147,10 @@ cifs_get_spnego_key(struct cifs_ses *ses
 		sprintf(dp, ";sec=krb5");
 	else if (server->sec_mskerberos)
 		sprintf(dp, ";sec=mskrb5");
-	else
-		goto out;
+	else {
+		cifs_dbg(VFS, "unknown or missing server auth type, use krb5\n");
+		sprintf(dp, ";sec=krb5");
+	}
 
 	dp = description + strlen(description);
 	sprintf(dp, ";uid=0x%x",
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/cifs/inode.c linux-libre-3.18.126-gnu/fs/cifs/inode.c
--- linux-libre-3.18.125-gnu/fs/cifs/inode.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/cifs/inode.c	2018-11-22 01:32:49.000000000 -0500
@@ -741,7 +741,15 @@ cifs_get_inode_info(struct inode **inode
 	} else if (rc == -EREMOTE) {
 		cifs_create_dfs_fattr(&fattr, sb);
 		rc = 0;
-	} else if (rc == -EACCES && backup_cred(cifs_sb)) {
+	} else if ((rc == -EACCES) && backup_cred(cifs_sb) &&
+		   (strcmp(server->vals->version_string, SMB1_VERSION_STRING)
+		      == 0)) {
+			/*
+			 * For SMB2 and later the backup intent flag is already
+			 * sent if needed on open and there is no path based
+			 * FindFirst operation to use to retry with
+			 */
+
 			srchinf = kzalloc(sizeof(struct cifs_search_info),
 						GFP_KERNEL);
 			if (srchinf == NULL) {
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/configfs/symlink.c linux-libre-3.18.126-gnu/fs/configfs/symlink.c
--- linux-libre-3.18.125-gnu/fs/configfs/symlink.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/configfs/symlink.c	2018-11-22 01:32:49.000000000 -0500
@@ -64,7 +64,7 @@ static void fill_item_path(struct config
 
 		/* back up enough to print this bus id with '/' */
 		length -= cur;
-		strncpy(buffer + length,config_item_name(p),cur);
+		memcpy(buffer + length, config_item_name(p), cur);
 		*(buffer + --length) = '/';
 	}
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/cramfs/inode.c linux-libre-3.18.126-gnu/fs/cramfs/inode.c
--- linux-libre-3.18.125-gnu/fs/cramfs/inode.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/cramfs/inode.c	2018-11-22 01:32:49.000000000 -0500
@@ -185,7 +185,8 @@ static void *cramfs_read(struct super_bl
 			continue;
 		blk_offset = (blocknr - buffer_blocknr[i]) << PAGE_CACHE_SHIFT;
 		blk_offset += offset;
-		if (blk_offset + len > BUFFER_SIZE)
+		if (blk_offset > BUFFER_SIZE ||
+		    blk_offset + len > BUFFER_SIZE)
 			continue;
 		return read_buffers[i] + blk_offset;
 	}
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ext4/inline.c linux-libre-3.18.126-gnu/fs/ext4/inline.c
--- linux-libre-3.18.125-gnu/fs/ext4/inline.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ext4/inline.c	2018-11-22 01:32:49.000000000 -0500
@@ -850,7 +850,7 @@ int ext4_da_write_inline_data_begin(stru
 	handle_t *handle;
 	struct page *page;
 	struct ext4_iloc iloc;
-	int retries;
+	int retries = 0;
 
 	ret = ext4_get_inode_loc(inode, &iloc);
 	if (ret)
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ext4/move_extent.c linux-libre-3.18.126-gnu/fs/ext4/move_extent.c
--- linux-libre-3.18.125-gnu/fs/ext4/move_extent.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ext4/move_extent.c	2018-11-22 01:32:49.000000000 -0500
@@ -533,9 +533,13 @@ mext_check_arguments(struct inode *orig_
 			orig_inode->i_ino, donor_inode->i_ino);
 		return -EINVAL;
 	}
-	if (orig_eof < orig_start + *len - 1)
+	if (orig_eof <= orig_start)
+		*len = 0;
+	else if (orig_eof < orig_start + *len - 1)
 		*len = orig_eof - orig_start;
-	if (donor_eof < donor_start + *len - 1)
+	if (donor_eof <= donor_start)
+		*len = 0;
+	else if (donor_eof < donor_start + *len - 1)
 		*len = donor_eof - donor_start;
 	if (!*len) {
 		ext4_debug("ext4 move extent: len should not be 0 "
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ext4/namei.c linux-libre-3.18.126-gnu/fs/ext4/namei.c
--- linux-libre-3.18.125-gnu/fs/ext4/namei.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ext4/namei.c	2018-11-22 01:32:49.000000000 -0500
@@ -122,6 +122,7 @@ static struct buffer_head *__ext4_read_d
 	if (!is_dx_block && type == INDEX) {
 		ext4_error_inode(inode, __func__, line, block,
 		       "directory leaf block found instead of index block");
+		brelse(bh);
 		return ERR_PTR(-EIO);
 	}
 	if (!ext4_has_metadata_csum(inode->i_sb) ||
@@ -2604,7 +2605,9 @@ int ext4_orphan_add(handle_t *handle, st
 			list_del_init(&EXT4_I(inode)->i_orphan);
 			mutex_unlock(&sbi->s_orphan_lock);
 		}
-	}
+	} else
+		brelse(iloc.bh);
+
 	jbd_debug(4, "superblock will point to %lu\n", inode->i_ino);
 	jbd_debug(4, "orphan inode %lu will point to %d\n",
 			inode->i_ino, NEXT_ORPHAN(inode));
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ext4/resize.c linux-libre-3.18.126-gnu/fs/ext4/resize.c
--- linux-libre-3.18.125-gnu/fs/ext4/resize.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ext4/resize.c	2018-11-22 01:32:49.000000000 -0500
@@ -429,16 +429,18 @@ static int set_flexbg_block_bitmap(struc
 
 		BUFFER_TRACE(bh, "get_write_access");
 		err = ext4_journal_get_write_access(handle, bh);
-		if (err)
+		if (err) {
+			brelse(bh);
 			return err;
+		}
 		ext4_debug("mark block bitmap %#04llx (+%llu/%u)\n", block,
 			   block - start, count2);
 		ext4_set_bits(bh->b_data, block - start, count2);
 
 		err = ext4_handle_dirty_metadata(handle, NULL, bh);
+		brelse(bh);
 		if (unlikely(err))
 			return err;
-		brelse(bh);
 	}
 
 	return 0;
@@ -575,7 +577,6 @@ handle_bb:
 		bh = bclean(handle, sb, block);
 		if (IS_ERR(bh)) {
 			err = PTR_ERR(bh);
-			bh = NULL;
 			goto out;
 		}
 		overhead = ext4_group_overhead_blocks(sb, group);
@@ -587,9 +588,9 @@ handle_bb:
 		ext4_mark_bitmap_end(group_data[i].blocks_count,
 				     sb->s_blocksize * 8, bh->b_data);
 		err = ext4_handle_dirty_metadata(handle, NULL, bh);
+		brelse(bh);
 		if (err)
 			goto out;
-		brelse(bh);
 
 handle_ib:
 		if (bg_flags[i] & EXT4_BG_INODE_UNINIT)
@@ -604,18 +605,16 @@ handle_ib:
 		bh = bclean(handle, sb, block);
 		if (IS_ERR(bh)) {
 			err = PTR_ERR(bh);
-			bh = NULL;
 			goto out;
 		}
 
 		ext4_mark_bitmap_end(EXT4_INODES_PER_GROUP(sb),
 				     sb->s_blocksize * 8, bh->b_data);
 		err = ext4_handle_dirty_metadata(handle, NULL, bh);
+		brelse(bh);
 		if (err)
 			goto out;
-		brelse(bh);
 	}
-	bh = NULL;
 
 	/* Mark group tables in block bitmap */
 	for (j = 0; j < GROUP_TABLE_COUNT; j++) {
@@ -646,7 +645,6 @@ handle_ib:
 	}
 
 out:
-	brelse(bh);
 	err2 = ext4_journal_stop(handle);
 	if (err2 && !err)
 		err = err2;
@@ -846,6 +844,7 @@ static int add_new_gdb(handle_t *handle,
 	err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh);
 	if (unlikely(err)) {
 		ext4_std_error(sb, err);
+		iloc.bh = NULL;
 		goto exit_inode;
 	}
 	brelse(dind);
@@ -897,6 +896,7 @@ static int add_new_gdb_meta_bg(struct su
 				     sizeof(struct buffer_head *),
 				     GFP_NOFS);
 	if (!n_group_desc) {
+		brelse(gdb_bh);
 		err = -ENOMEM;
 		ext4_warning(sb, "not enough memory for %lu groups",
 			     gdb_num + 1);
@@ -912,8 +912,6 @@ static int add_new_gdb_meta_bg(struct su
 	ext4_kvfree(o_group_desc);
 	BUFFER_TRACE(gdb_bh, "get_write_access");
 	err = ext4_journal_get_write_access(handle, gdb_bh);
-	if (unlikely(err))
-		brelse(gdb_bh);
 	return err;
 }
 
@@ -1095,8 +1093,10 @@ static void update_backups(struct super_
 			   backup_block, backup_block -
 			   ext4_group_first_block_no(sb, group));
 		BUFFER_TRACE(bh, "get_write_access");
-		if ((err = ext4_journal_get_write_access(handle, bh)))
+		if ((err = ext4_journal_get_write_access(handle, bh))) {
+			brelse(bh);
 			break;
+		}
 		lock_buffer(bh);
 		memcpy(bh->b_data, data, size);
 		if (rest)
@@ -1993,7 +1993,7 @@ retry:
 
 	err = ext4_alloc_flex_bg_array(sb, n_group + 1);
 	if (err)
-		return err;
+		goto out;
 
 	err = ext4_mb_alloc_groupinfo(sb, n_group + 1);
 	if (err)
@@ -2029,6 +2029,10 @@ retry:
 		n_blocks_count_retry = 0;
 		free_flex_gd(flex_gd);
 		flex_gd = NULL;
+		if (resize_inode) {
+			iput(resize_inode);
+			resize_inode = NULL;
+		}
 		goto retry;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ext4/super.c linux-libre-3.18.126-gnu/fs/ext4/super.c
--- linux-libre-3.18.125-gnu/fs/ext4/super.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ext4/super.c	2018-11-22 01:32:49.000000000 -0500
@@ -3976,6 +3976,14 @@ static int ext4_fill_super(struct super_
 	sbi->s_groups_count = blocks_count;
 	sbi->s_blockfile_groups = min_t(ext4_group_t, sbi->s_groups_count,
 			(EXT4_MAX_BLOCK_FILE_PHYS / EXT4_BLOCKS_PER_GROUP(sb)));
+	if (((u64)sbi->s_groups_count * sbi->s_inodes_per_group) !=
+	    le32_to_cpu(es->s_inodes_count)) {
+		ext4_msg(sb, KERN_ERR, "inodes count not valid: %u vs %llu",
+			 le32_to_cpu(es->s_inodes_count),
+			 ((u64)sbi->s_groups_count * sbi->s_inodes_per_group));
+		ret = -EINVAL;
+		goto failed_mount;
+	}
 	db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
 		   EXT4_DESC_PER_BLOCK(sb);
 	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_META_BG)) {
@@ -3995,14 +4003,6 @@ static int ext4_fill_super(struct super_
 		ret = -ENOMEM;
 		goto failed_mount;
 	}
-	if (((u64)sbi->s_groups_count * sbi->s_inodes_per_group) !=
-	    le32_to_cpu(es->s_inodes_count)) {
-		ext4_msg(sb, KERN_ERR, "inodes count not valid: %u vs %llu",
-			 le32_to_cpu(es->s_inodes_count),
-			 ((u64)sbi->s_groups_count * sbi->s_inodes_per_group));
-		ret = -EINVAL;
-		goto failed_mount;
-	}
 
 	if (ext4_proc_root)
 		sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ext4/xattr.c linux-libre-3.18.126-gnu/fs/ext4/xattr.c
--- linux-libre-3.18.125-gnu/fs/ext4/xattr.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ext4/xattr.c	2018-11-22 01:32:49.000000000 -0500
@@ -1162,6 +1162,8 @@ ext4_xattr_set_handle(handle_t *handle,
 			error = ext4_xattr_block_set(handle, inode, &i, &bs);
 		} else if (error == -ENOSPC) {
 			if (EXT4_I(inode)->i_file_acl && !bs.s.base) {
+				brelse(bs.bh);
+				bs.bh = NULL;
 				error = ext4_xattr_block_find(inode, &i, &bs);
 				if (error)
 					goto cleanup;
@@ -1487,6 +1489,8 @@ cleanup:
 	kfree(buffer);
 	if (is)
 		brelse(is->iloc.bh);
+	if (bs)
+		brelse(bs->bh);
 	kfree(is);
 	kfree(bs);
 	brelse(bh);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/fuse/dev.c linux-libre-3.18.126-gnu/fs/fuse/dev.c
--- linux-libre-3.18.125-gnu/fs/fuse/dev.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/fuse/dev.c	2018-11-22 01:32:49.000000000 -0500
@@ -1675,8 +1675,10 @@ static int fuse_retrieve(struct fuse_con
 	req->in.args[1].size = total_len;
 
 	err = fuse_request_send_notify_reply(fc, req, outarg->notify_unique);
-	if (err)
+	if (err) {
 		fuse_retrieve_end(fc, req);
+		fuse_put_request(fc, req);
+	}
 
 	return err;
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/gfs2/ops_fstype.c linux-libre-3.18.126-gnu/fs/gfs2/ops_fstype.c
--- linux-libre-3.18.125-gnu/fs/gfs2/ops_fstype.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/gfs2/ops_fstype.c	2018-11-22 01:32:49.000000000 -0500
@@ -1358,6 +1358,9 @@ static struct dentry *gfs2_mount_meta(st
 	struct path path;
 	int error;
 
+	if (!dev_name || !*dev_name)
+		return ERR_PTR(-EINVAL);
+
 	error = kern_path(dev_name, LOOKUP_FOLLOW, &path);
 	if (error) {
 		pr_warn("path_lookup on %s returned error %d\n",
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/jbd2/checkpoint.c linux-libre-3.18.126-gnu/fs/jbd2/checkpoint.c
--- linux-libre-3.18.125-gnu/fs/jbd2/checkpoint.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/jbd2/checkpoint.c	2018-11-22 01:32:49.000000000 -0500
@@ -254,8 +254,8 @@ restart:
 		bh = jh2bh(jh);
 
 		if (buffer_locked(bh)) {
-			spin_unlock(&journal->j_list_lock);
 			get_bh(bh);
+			spin_unlock(&journal->j_list_lock);
 			wait_on_buffer(bh);
 			/* the journal_head may have gone by now */
 			BUFFER_TRACE(bh, "brelse");
@@ -336,8 +336,8 @@ restart2:
 		jh = transaction->t_checkpoint_io_list;
 		bh = jh2bh(jh);
 		if (buffer_locked(bh)) {
-			spin_unlock(&journal->j_list_lock);
 			get_bh(bh);
+			spin_unlock(&journal->j_list_lock);
 			wait_on_buffer(bh);
 			/* the journal_head may have gone by now */
 			BUFFER_TRACE(bh, "brelse");
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/jffs2/super.c linux-libre-3.18.126-gnu/fs/jffs2/super.c
--- linux-libre-3.18.125-gnu/fs/jffs2/super.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/jffs2/super.c	2018-11-22 01:32:49.000000000 -0500
@@ -285,10 +285,8 @@ static int jffs2_fill_super(struct super
 	sb->s_fs_info = c;
 
 	ret = jffs2_parse_options(c, data);
-	if (ret) {
-		kfree(c);
+	if (ret)
 		return -EINVAL;
-	}
 
 	/* Initialize JFFS2 superblock locks, the further initialization will
 	 * be done later */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/lockd/host.c linux-libre-3.18.126-gnu/fs/lockd/host.c
--- linux-libre-3.18.125-gnu/fs/lockd/host.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/lockd/host.c	2018-11-22 01:32:49.000000000 -0500
@@ -339,7 +339,7 @@ struct nlm_host *nlmsvc_lookup_host(cons
 	};
 	struct lockd_net *ln = net_generic(net, lockd_net_id);
 
-	dprintk("lockd: %s(host='%*s', vers=%u, proto=%s)\n", __func__,
+	dprintk("lockd: %s(host='%.*s', vers=%u, proto=%s)\n", __func__,
 			(int)hostname_len, hostname, rqstp->rq_vers,
 			(rqstp->rq_prot == IPPROTO_UDP ? "udp" : "tcp"));
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/namespace.c linux-libre-3.18.126-gnu/fs/namespace.c
--- linux-libre-3.18.125-gnu/fs/namespace.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/namespace.c	2018-11-22 01:32:49.000000000 -0500
@@ -1478,8 +1478,13 @@ static int do_umount(struct mount *mnt,
 
 	namespace_lock();
 	lock_mount_hash();
-	event++;
 
+	/* Recheck MNT_LOCKED with the locks held */
+	retval = -EINVAL;
+	if (mnt->mnt.mnt_flags & MNT_LOCKED)
+		goto out;
+
+	event++;
 	if (flags & MNT_DETACH) {
 		if (!list_empty(&mnt->mnt_list))
 			umount_tree(mnt, UMOUNT_PROPAGATE);
@@ -1493,6 +1498,7 @@ static int do_umount(struct mount *mnt,
 			retval = 0;
 		}
 	}
+out:
 	unlock_mount_hash();
 	namespace_unlock();
 	return retval;
@@ -1571,7 +1577,7 @@ SYSCALL_DEFINE2(umount, char __user *, n
 		goto dput_and_out;
 	if (!check_mnt(mnt))
 		goto dput_and_out;
-	if (mnt->mnt.mnt_flags & MNT_LOCKED)
+	if (mnt->mnt.mnt_flags & MNT_LOCKED) /* Check optimistically */
 		goto dput_and_out;
 	retval = -EPERM;
 	if (flags & MNT_FORCE && !capable(CAP_SYS_ADMIN))
@@ -1655,8 +1661,14 @@ struct mount *copy_tree(struct mount *mn
 			struct mount *t = NULL;
 			if (!(flag & CL_COPY_UNBINDABLE) &&
 			    IS_MNT_UNBINDABLE(s)) {
-				s = skip_mnt_tree(s);
-				continue;
+				if (s->mnt.mnt_flags & MNT_LOCKED) {
+					/* Both unbindable and locked. */
+					q = ERR_PTR(-EPERM);
+					goto out;
+				} else {
+					s = skip_mnt_tree(s);
+					continue;
+				}
 			}
 			if (!(flag & CL_COPY_MNT_NS_FILE) &&
 			    is_mnt_ns_file(s->mnt.mnt_root)) {
@@ -1716,7 +1728,7 @@ void drop_collected_mounts(struct vfsmou
 {
 	namespace_lock();
 	lock_mount_hash();
-	umount_tree(real_mount(mnt), UMOUNT_SYNC);
+	umount_tree(real_mount(mnt), 0);
 	unlock_mount_hash();
 	namespace_unlock();
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/nfs/nfs4client.c linux-libre-3.18.126-gnu/fs/nfs/nfs4client.c
--- linux-libre-3.18.125-gnu/fs/nfs/nfs4client.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/nfs/nfs4client.c	2018-11-22 01:32:49.000000000 -0500
@@ -891,10 +891,10 @@ EXPORT_SYMBOL_GPL(nfs4_set_ds_client);
 
 /*
  * Session has been established, and the client marked ready.
- * Set the mount rsize and wsize with negotiated fore channel
- * attributes which will be bound checked in nfs_server_set_fsinfo.
+ * Limit the mount rsize, wsize and dtsize using negotiated fore
+ * channel attributes.
  */
-static void nfs4_session_set_rwsize(struct nfs_server *server)
+static void nfs4_session_limit_rwsize(struct nfs_server *server)
 {
 #ifdef CONFIG_NFS_V4_1
 	struct nfs4_session *sess;
@@ -907,9 +907,11 @@ static void nfs4_session_set_rwsize(stru
 	server_resp_sz = sess->fc_attrs.max_resp_sz - nfs41_maxread_overhead;
 	server_rqst_sz = sess->fc_attrs.max_rqst_sz - nfs41_maxwrite_overhead;
 
-	if (!server->rsize || server->rsize > server_resp_sz)
+	if (server->dtsize > server_resp_sz)
+		server->dtsize = server_resp_sz;
+	if (server->rsize > server_resp_sz)
 		server->rsize = server_resp_sz;
-	if (!server->wsize || server->wsize > server_rqst_sz)
+	if (server->wsize > server_rqst_sz)
 		server->wsize = server_rqst_sz;
 #endif /* CONFIG_NFS_V4_1 */
 }
@@ -956,12 +958,12 @@ static int nfs4_server_common_setup(stru
 			(unsigned long long) server->fsid.minor);
 	nfs_display_fhandle(mntfh, "Pseudo-fs root FH");
 
-	nfs4_session_set_rwsize(server);
-
 	error = nfs_probe_fsinfo(server, mntfh, fattr);
 	if (error < 0)
 		goto out;
 
+	nfs4_session_limit_rwsize(server);
+
 	if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN)
 		server->namelen = NFS4_MAXNAMLEN;
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/fs/ocfs2/dir.c linux-libre-3.18.126-gnu/fs/ocfs2/dir.c
--- linux-libre-3.18.125-gnu/fs/ocfs2/dir.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/fs/ocfs2/dir.c	2018-11-22 01:32:49.000000000 -0500
@@ -1906,8 +1906,7 @@ static int ocfs2_dir_foreach_blk_el(stru
 				/* On error, skip the f_pos to the
 				   next block. */
 				ctx->pos = (ctx->pos | (sb->s_blocksize - 1)) + 1;
-				brelse(bh);
-				continue;
+				break;
 			}
 			if (le64_to_cpu(de->inode)) {
 				unsigned char d_type = DT_UNKNOWN;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/include/linux/ceph/libceph.h linux-libre-3.18.126-gnu/include/linux/ceph/libceph.h
--- linux-libre-3.18.125-gnu/include/linux/ceph/libceph.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/include/linux/ceph/libceph.h	2018-11-22 01:32:49.000000000 -0500
@@ -67,7 +67,13 @@ struct ceph_options {
 
 #define CEPH_MSG_MAX_FRONT_LEN	(16*1024*1024)
 #define CEPH_MSG_MAX_MIDDLE_LEN	(16*1024*1024)
-#define CEPH_MSG_MAX_DATA_LEN	(16*1024*1024)
+
+/*
+ * Handle the largest possible rbd object in one message.
+ * There is no limit on the size of cephfs objects, but it has to obey
+ * rsize and wsize mount options anyway.
+ */
+#define CEPH_MSG_MAX_DATA_LEN	(32*1024*1024)
 
 #define CEPH_AUTH_NAME_DEFAULT   "guest"
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/include/linux/tc.h linux-libre-3.18.126-gnu/include/linux/tc.h
--- linux-libre-3.18.125-gnu/include/linux/tc.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/include/linux/tc.h	2018-11-22 01:32:49.000000000 -0500
@@ -84,6 +84,7 @@ struct tc_dev {
 					   device. */
 	struct device	dev;		/* Generic device interface. */
 	struct resource	resource;	/* Address space of this device. */
+	u64		dma_mask;	/* DMA addressable range. */
 	char		vendor[9];
 	char		name[9];
 	char		firmware[9];
diff -druNp --no-dereference linux-libre-3.18.125-gnu/kernel/bounds.c linux-libre-3.18.126-gnu/kernel/bounds.c
--- linux-libre-3.18.125-gnu/kernel/bounds.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/kernel/bounds.c	2018-11-22 01:32:49.000000000 -0500
@@ -12,7 +12,7 @@
 #include <linux/log2.h>
 #include <linux/spinlock_types.h>
 
-void foo(void)
+int main(void)
 {
 	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
@@ -22,4 +22,6 @@ void foo(void)
 #endif
 	DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
 	/* End of constants */
+
+	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/kernel/kprobes.c linux-libre-3.18.126-gnu/kernel/kprobes.c
--- linux-libre-3.18.125-gnu/kernel/kprobes.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/kernel/kprobes.c	2018-11-22 01:32:49.000000000 -0500
@@ -665,9 +665,10 @@ static void unoptimize_kprobe(struct kpr
 }
 
 /* Cancel unoptimizing for reusing */
-static void reuse_unused_kprobe(struct kprobe *ap)
+static int reuse_unused_kprobe(struct kprobe *ap)
 {
 	struct optimized_kprobe *op;
+	int ret;
 
 	BUG_ON(!kprobe_unused(ap));
 	/*
@@ -681,8 +682,12 @@ static void reuse_unused_kprobe(struct k
 	/* Enable the probe again */
 	ap->flags &= ~KPROBE_FLAG_DISABLED;
 	/* Optimize it again (remove from op->list) */
-	BUG_ON(!kprobe_optready(ap));
+	ret = kprobe_optready(ap);
+	if (ret)
+		return ret;
+
 	optimize_kprobe(ap);
+	return 0;
 }
 
 /* Remove optimized instructions */
@@ -893,11 +898,16 @@ static void __disarm_kprobe(struct kprob
 #define kprobe_disarmed(p)			kprobe_disabled(p)
 #define wait_for_kprobe_optimizer()		do {} while (0)
 
-/* There should be no unused kprobes can be reused without optimization */
-static void reuse_unused_kprobe(struct kprobe *ap)
+static int reuse_unused_kprobe(struct kprobe *ap)
 {
+	/*
+	 * If the optimized kprobe is NOT supported, the aggr kprobe is
+	 * released at the same time that the last aggregated kprobe is
+	 * unregistered.
+	 * Thus there should be no chance to reuse unused kprobe.
+	 */
 	printk(KERN_ERR "Error: There should be no unused kprobe here.\n");
-	BUG_ON(kprobe_unused(ap));
+	return -EINVAL;
 }
 
 static void free_aggr_kprobe(struct kprobe *p)
@@ -1275,9 +1285,12 @@ static int register_aggr_kprobe(struct k
 			goto out;
 		}
 		init_aggr_kprobe(ap, orig_p);
-	} else if (kprobe_unused(ap))
+	} else if (kprobe_unused(ap)) {
 		/* This probe is going to die. Rescue it */
-		reuse_unused_kprobe(ap);
+		ret = reuse_unused_kprobe(ap);
+		if (ret)
+			goto out;
+	}
 
 	if (kprobe_gone(ap)) {
 		/*
diff -druNp --no-dereference linux-libre-3.18.125-gnu/kernel/locking/lockdep.c linux-libre-3.18.126-gnu/kernel/locking/lockdep.c
--- linux-libre-3.18.125-gnu/kernel/locking/lockdep.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/kernel/locking/lockdep.c	2018-11-22 01:32:49.000000000 -0500
@@ -3808,7 +3808,7 @@ void lock_contended(struct lockdep_map *
 {
 	unsigned long flags;
 
-	if (unlikely(!lock_stat))
+	if (unlikely(!lock_stat || !debug_locks))
 		return;
 
 	if (unlikely(current->lockdep_recursion))
@@ -3828,7 +3828,7 @@ void lock_acquired(struct lockdep_map *l
 {
 	unsigned long flags;
 
-	if (unlikely(!lock_stat))
+	if (unlikely(!lock_stat || !debug_locks))
 		return;
 
 	if (unlikely(current->lockdep_recursion))
diff -druNp --no-dereference linux-libre-3.18.125-gnu/kernel/printk/printk.c linux-libre-3.18.126-gnu/kernel/printk/printk.c
--- linux-libre-3.18.125-gnu/kernel/printk/printk.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/kernel/printk/printk.c	2018-11-22 01:32:49.000000000 -0500
@@ -844,7 +844,12 @@ static void __init log_buf_len_update(un
 /* save requested log_buf_len since it's too early to process it */
 static int __init log_buf_len_setup(char *str)
 {
-	unsigned size = memparse(str, &str);
+	unsigned int size;
+
+	if (!str)
+		return -EINVAL;
+
+	size = memparse(str, &str);
 
 	log_buf_len_update(size);
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/kernel/signal.c linux-libre-3.18.126-gnu/kernel/signal.c
--- linux-libre-3.18.125-gnu/kernel/signal.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/kernel/signal.c	2018-11-22 01:32:49.000000000 -0500
@@ -1042,7 +1042,7 @@ static int __send_signal(int sig, struct
 
 	result = TRACE_SIGNAL_IGNORED;
 	if (!prepare_signal(sig, t,
-			from_ancestor_ns || (info == SEND_SIG_FORCED)))
+			from_ancestor_ns || (info == SEND_SIG_PRIV) || (info == SEND_SIG_FORCED)))
 		goto ret;
 
 	pending = group ? &t->signal->shared_pending : &t->pending;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/lib/debug_locks.c linux-libre-3.18.126-gnu/lib/debug_locks.c
--- linux-libre-3.18.125-gnu/lib/debug_locks.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/lib/debug_locks.c	2018-11-22 01:32:49.000000000 -0500
@@ -37,7 +37,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent);
  */
 int debug_locks_off(void)
 {
-	if (__debug_locks_off()) {
+	if (debug_locks && __debug_locks_off()) {
 		if (!debug_locks_silent) {
 			console_verbose();
 			return 1;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/Makefile linux-libre-3.18.126-gnu/Makefile
--- linux-libre-3.18.125-gnu/Makefile	2018-11-10 15:35:24.000000000 -0500
+++ linux-libre-3.18.126-gnu/Makefile	2018-11-22 09:28:26.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 125
+SUBLEVEL = 126
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/mm/hugetlb.c linux-libre-3.18.126-gnu/mm/hugetlb.c
--- linux-libre-3.18.125-gnu/mm/hugetlb.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/mm/hugetlb.c	2018-11-22 01:32:49.000000000 -0500
@@ -2576,7 +2576,7 @@ static int is_hugetlb_entry_hwpoisoned(p
 int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 			    struct vm_area_struct *vma)
 {
-	pte_t *src_pte, *dst_pte, entry;
+	pte_t *src_pte, *dst_pte, entry, dst_entry;
 	struct page *ptepage;
 	unsigned long addr;
 	int cow;
@@ -2604,15 +2604,30 @@ int copy_hugetlb_page_range(struct mm_st
 			break;
 		}
 
-		/* If the pagetables are shared don't copy or take references */
-		if (dst_pte == src_pte)
+		/*
+		 * If the pagetables are shared don't copy or take references.
+		 * dst_pte == src_pte is the common case of src/dest sharing.
+		 *
+		 * However, src could have 'unshared' and dst shares with
+		 * another vma.  If dst_pte !none, this implies sharing.
+		 * Check here before taking page table lock, and once again
+		 * after taking the lock below.
+		 */
+		dst_entry = huge_ptep_get(dst_pte);
+		if ((dst_pte == src_pte) || !huge_pte_none(dst_entry))
 			continue;
 
 		dst_ptl = huge_pte_lock(h, dst, dst_pte);
 		src_ptl = huge_pte_lockptr(h, src, src_pte);
 		spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
 		entry = huge_ptep_get(src_pte);
-		if (huge_pte_none(entry)) { /* skip none entry */
+		dst_entry = huge_ptep_get(dst_pte);
+		if (huge_pte_none(entry) || !huge_pte_none(dst_entry)) {
+			/*
+			 * Skip if src entry none.  Also, skip in the
+			 * unlikely case dst entry !none as this implies
+			 * sharing with another vma.
+			 */
 			;
 		} else if (unlikely(is_hugetlb_entry_migration(entry) ||
 				    is_hugetlb_entry_hwpoisoned(entry))) {
diff -druNp --no-dereference linux-libre-3.18.125-gnu/net/9p/protocol.c linux-libre-3.18.126-gnu/net/9p/protocol.c
--- linux-libre-3.18.125-gnu/net/9p/protocol.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/net/9p/protocol.c	2018-11-22 01:32:49.000000000 -0500
@@ -45,10 +45,15 @@ p9pdu_writef(struct p9_fcall *pdu, int p
 void p9stat_free(struct p9_wstat *stbuf)
 {
 	kfree(stbuf->name);
+	stbuf->name = NULL;
 	kfree(stbuf->uid);
+	stbuf->uid = NULL;
 	kfree(stbuf->gid);
+	stbuf->gid = NULL;
 	kfree(stbuf->muid);
+	stbuf->muid = NULL;
 	kfree(stbuf->extension);
+	stbuf->extension = NULL;
 }
 EXPORT_SYMBOL(p9stat_free);
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/net/ipv4/cipso_ipv4.c linux-libre-3.18.126-gnu/net/ipv4/cipso_ipv4.c
--- linux-libre-3.18.125-gnu/net/ipv4/cipso_ipv4.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/net/ipv4/cipso_ipv4.c	2018-11-22 01:32:49.000000000 -0500
@@ -1580,7 +1580,7 @@ static int cipso_v4_parsetag_loc(const s
  *
  * Description:
  * Parse the packet's IP header looking for a CIPSO option.  Returns a pointer
- * to the start of the CIPSO option on success, NULL if one if not found.
+ * to the start of the CIPSO option on success, NULL if one is not found.
  *
  */
 unsigned char *cipso_v4_optptr(const struct sk_buff *skb)
@@ -1590,10 +1590,8 @@ unsigned char *cipso_v4_optptr(const str
 	int optlen;
 	int taglen;
 
-	for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 0; ) {
+	for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 1; ) {
 		switch (optptr[0]) {
-		case IPOPT_CIPSO:
-			return optptr;
 		case IPOPT_END:
 			return NULL;
 		case IPOPT_NOOP:
@@ -1602,6 +1600,11 @@ unsigned char *cipso_v4_optptr(const str
 		default:
 			taglen = optptr[1];
 		}
+		if (!taglen || taglen > optlen)
+			return NULL;
+		if (optptr[0] == IPOPT_CIPSO)
+			return optptr;
+
 		optlen -= taglen;
 		optptr += taglen;
 	}
diff -druNp --no-dereference linux-libre-3.18.125-gnu/net/sunrpc/svc_xprt.c linux-libre-3.18.126-gnu/net/sunrpc/svc_xprt.c
--- linux-libre-3.18.125-gnu/net/sunrpc/svc_xprt.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/net/sunrpc/svc_xprt.c	2018-11-22 01:32:49.000000000 -0500
@@ -902,7 +902,7 @@ static void call_xpt_users(struct svc_xp
 	spin_lock(&xprt->xpt_lock);
 	while (!list_empty(&xprt->xpt_users)) {
 		u = list_first_entry(&xprt->xpt_users, struct svc_xpt_user, list);
-		list_del(&u->list);
+		list_del_init(&u->list);
 		u->callback(u);
 	}
 	spin_unlock(&xprt->xpt_lock);
diff -druNp --no-dereference linux-libre-3.18.125-gnu/net/sunrpc/xdr.c linux-libre-3.18.126-gnu/net/sunrpc/xdr.c
--- linux-libre-3.18.125-gnu/net/sunrpc/xdr.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/net/sunrpc/xdr.c	2018-11-22 01:32:49.000000000 -0500
@@ -638,11 +638,10 @@ void xdr_truncate_encode(struct xdr_stre
 		/* xdr->iov should already be NULL */
 		return;
 	}
-	if (fraglen) {
+	if (fraglen)
 		xdr->end = head->iov_base + head->iov_len;
-		xdr->page_ptr--;
-	}
 	/* (otherwise assume xdr->end is already set) */
+	xdr->page_ptr--;
 	head->iov_len = len;
 	buf->len = len;
 	xdr->p = head->iov_base + head->iov_len;
diff -druNp --no-dereference linux-libre-3.18.125-gnu/security/integrity/ima/ima_fs.c linux-libre-3.18.126-gnu/security/integrity/ima/ima_fs.c
--- linux-libre-3.18.125-gnu/security/integrity/ima/ima_fs.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/security/integrity/ima/ima_fs.c	2018-11-22 01:32:49.000000000 -0500
@@ -26,14 +26,14 @@
 #include "ima.h"
 
 static int valid_policy = 1;
-#define TMPBUFLEN 12
+
 static ssize_t ima_show_htable_value(char __user *buf, size_t count,
 				     loff_t *ppos, atomic_long_t *val)
 {
-	char tmpbuf[TMPBUFLEN];
+	char tmpbuf[32];	/* greater than largest 'long' string value */
 	ssize_t len;
 
-	len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read(val));
+	len = scnprintf(tmpbuf, sizeof(tmpbuf), "%li\n", atomic_long_read(val));
 	return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
 }
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/sound/pci/ca0106/ca0106.h linux-libre-3.18.126-gnu/sound/pci/ca0106/ca0106.h
--- linux-libre-3.18.125-gnu/sound/pci/ca0106/ca0106.h	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/sound/pci/ca0106/ca0106.h	2018-11-22 01:32:49.000000000 -0500
@@ -582,7 +582,7 @@
 #define SPI_PL_BIT_R_R		(2<<7)	/* right channel = right */
 #define SPI_PL_BIT_R_C		(3<<7)	/* right channel = (L+R)/2 */
 #define SPI_IZD_REG		2
-#define SPI_IZD_BIT		(1<<4)	/* infinite zero detect */
+#define SPI_IZD_BIT		(0<<4)	/* infinite zero detect */
 
 #define SPI_FMT_REG		3
 #define SPI_FMT_BIT_RJ		(0<<0)	/* right justified mode */
diff -druNp --no-dereference linux-libre-3.18.125-gnu/tools/perf/util/trace-event-info.c linux-libre-3.18.126-gnu/tools/perf/util/trace-event-info.c
--- linux-libre-3.18.125-gnu/tools/perf/util/trace-event-info.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/tools/perf/util/trace-event-info.c	2018-11-22 01:32:49.000000000 -0500
@@ -513,12 +513,14 @@ struct tracing_data *tracing_data_get(st
 			 "/tmp/perf-XXXXXX");
 		if (!mkstemp(tdata->temp_file)) {
 			pr_debug("Can't make temp file");
+			free(tdata);
 			return NULL;
 		}
 
 		temp_fd = open(tdata->temp_file, O_RDWR);
 		if (temp_fd < 0) {
 			pr_debug("Can't read '%s'", tdata->temp_file);
+			free(tdata);
 			return NULL;
 		}
 
diff -druNp --no-dereference linux-libre-3.18.125-gnu/tools/perf/util/trace-event-read.c linux-libre-3.18.126-gnu/tools/perf/util/trace-event-read.c
--- linux-libre-3.18.125-gnu/tools/perf/util/trace-event-read.c	2018-11-10 10:39:23.000000000 -0500
+++ linux-libre-3.18.126-gnu/tools/perf/util/trace-event-read.c	2018-11-22 01:32:49.000000000 -0500
@@ -336,9 +336,12 @@ static int read_event_files(struct peven
 		for (x=0; x < count; x++) {
 			size = read8(pevent);
 			ret = read_event_file(pevent, sys, size);
-			if (ret)
+			if (ret) {
+				free(sys);
 				return ret;
+			}
 		}
+		free(sys);
 	}
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.125-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc linux-libre-3.18.126-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc
--- linux-libre-3.18.125-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc	1969-12-31 19:00:00.000000000 -0500
+++ linux-libre-3.18.126-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc	2018-11-22 01:32:49.000000000 -0500
@@ -0,0 +1,80 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: event trigger - test synthetic_events syntax parser
+
+do_reset() {
+    reset_trigger
+    echo > set_event
+    clear_trace
+}
+
+fail() { #msg
+    do_reset
+    echo $1
+    exit_fail
+}
+
+if [ ! -f set_event ]; then
+    echo "event tracing is not supported"
+    exit_unsupported
+fi
+
+if [ ! -f synthetic_events ]; then
+    echo "synthetic event is not supported"
+    exit_unsupported
+fi
+
+reset_tracer
+do_reset
+
+echo "Test synthetic_events syntax parser"
+
+echo > synthetic_events
+
+# synthetic event must have a field
+! echo "myevent" >> synthetic_events
+echo "myevent u64 var1" >> synthetic_events
+
+# synthetic event must be found in synthetic_events
+grep "myevent[[:space:]]u64 var1" synthetic_events
+
+# it is not possible to add same name event
+! echo "myevent u64 var2" >> synthetic_events
+
+# Non-append open will cleanup all events and add new one
+echo "myevent u64 var2" > synthetic_events
+
+# multiple fields with different spaces
+echo "myevent u64 var1; u64 var2;" > synthetic_events
+grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
+echo "myevent u64 var1 ; u64 var2 ;" > synthetic_events
+grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
+echo "myevent u64 var1 ;u64 var2" > synthetic_events
+grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
+
+# test field types
+echo "myevent u32 var" > synthetic_events
+echo "myevent u16 var" > synthetic_events
+echo "myevent u8 var" > synthetic_events
+echo "myevent s64 var" > synthetic_events
+echo "myevent s32 var" > synthetic_events
+echo "myevent s16 var" > synthetic_events
+echo "myevent s8 var" > synthetic_events
+
+echo "myevent char var" > synthetic_events
+echo "myevent int var" > synthetic_events
+echo "myevent long var" > synthetic_events
+echo "myevent pid_t var" > synthetic_events
+
+echo "myevent unsigned char var" > synthetic_events
+echo "myevent unsigned int var" > synthetic_events
+echo "myevent unsigned long var" > synthetic_events
+grep "myevent[[:space:]]unsigned long var" synthetic_events
+
+# test string type
+echo "myevent char var[10]" > synthetic_events
+grep "myevent[[:space:]]char\[10\] var" synthetic_events
+
+do_reset
+
+exit 0
