diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/arm64/crypto/sha1-ce-core.S linux-libre-4.4.165-gnu/arch/arm64/crypto/sha1-ce-core.S
--- linux-libre-4.4.164-gnu/arch/arm64/crypto/sha1-ce-core.S	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/arm64/crypto/sha1-ce-core.S	2018-11-27 10:08:03.000000000 -0500
@@ -82,7 +82,8 @@ ENTRY(sha1_ce_transform)
 	ldr		dgb, [x0, #16]
 
 	/* load sha1_ce_state::finalize */
-	ldr		w4, [x0, #:lo12:sha1_ce_offsetof_finalize]
+	ldr_l		w4, sha1_ce_offsetof_finalize, x4
+	ldr		w4, [x0, x4]
 
 	/* load input */
 0:	ld1		{v8.4s-v11.4s}, [x1], #64
@@ -132,7 +133,8 @@ CPU_LE(	rev32		v11.16b, v11.16b	)
 	 * the padding is handled by the C code in that case.
 	 */
 	cbz		x4, 3f
-	ldr		x4, [x0, #:lo12:sha1_ce_offsetof_count]
+	ldr_l		w4, sha1_ce_offsetof_count, x4
+	ldr		x4, [x0, x4]
 	movi		v9.2d, #0
 	mov		x8, #0x80000000
 	movi		v10.2d, #0
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/arm64/crypto/sha1-ce-glue.c linux-libre-4.4.165-gnu/arch/arm64/crypto/sha1-ce-glue.c
--- linux-libre-4.4.164-gnu/arch/arm64/crypto/sha1-ce-glue.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/arm64/crypto/sha1-ce-glue.c	2018-11-27 10:08:03.000000000 -0500
@@ -17,9 +17,6 @@
 #include <linux/crypto.h>
 #include <linux/module.h>
 
-#define ASM_EXPORT(sym, val) \
-	asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
-
 MODULE_DESCRIPTION("SHA1 secure hash using ARMv8 Crypto Extensions");
 MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
 MODULE_LICENSE("GPL v2");
@@ -32,6 +29,9 @@ struct sha1_ce_state {
 asmlinkage void sha1_ce_transform(struct sha1_ce_state *sst, u8 const *src,
 				  int blocks);
 
+const u32 sha1_ce_offsetof_count = offsetof(struct sha1_ce_state, sst.count);
+const u32 sha1_ce_offsetof_finalize = offsetof(struct sha1_ce_state, finalize);
+
 static int sha1_ce_update(struct shash_desc *desc, const u8 *data,
 			  unsigned int len)
 {
@@ -52,11 +52,6 @@ static int sha1_ce_finup(struct shash_de
 	struct sha1_ce_state *sctx = shash_desc_ctx(desc);
 	bool finalize = !sctx->sst.count && !(len % SHA1_BLOCK_SIZE);
 
-	ASM_EXPORT(sha1_ce_offsetof_count,
-		   offsetof(struct sha1_ce_state, sst.count));
-	ASM_EXPORT(sha1_ce_offsetof_finalize,
-		   offsetof(struct sha1_ce_state, finalize));
-
 	/*
 	 * Allow the asm code to perform the finalization if there is no
 	 * partial data and the input is a round multiple of the block size.
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/arm64/crypto/sha2-ce-core.S linux-libre-4.4.165-gnu/arch/arm64/crypto/sha2-ce-core.S
--- linux-libre-4.4.164-gnu/arch/arm64/crypto/sha2-ce-core.S	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/arm64/crypto/sha2-ce-core.S	2018-11-27 10:08:03.000000000 -0500
@@ -88,7 +88,8 @@ ENTRY(sha2_ce_transform)
 	ld1		{dgav.4s, dgbv.4s}, [x0]
 
 	/* load sha256_ce_state::finalize */
-	ldr		w4, [x0, #:lo12:sha256_ce_offsetof_finalize]
+	ldr_l		w4, sha256_ce_offsetof_finalize, x4
+	ldr		w4, [x0, x4]
 
 	/* load input */
 0:	ld1		{v16.4s-v19.4s}, [x1], #64
@@ -136,7 +137,8 @@ CPU_LE(	rev32		v19.16b, v19.16b	)
 	 * the padding is handled by the C code in that case.
 	 */
 	cbz		x4, 3f
-	ldr		x4, [x0, #:lo12:sha256_ce_offsetof_count]
+	ldr_l		w4, sha256_ce_offsetof_count, x4
+	ldr		x4, [x0, x4]
 	movi		v17.2d, #0
 	mov		x8, #0x80000000
 	movi		v18.2d, #0
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/arm64/crypto/sha2-ce-glue.c linux-libre-4.4.165-gnu/arch/arm64/crypto/sha2-ce-glue.c
--- linux-libre-4.4.164-gnu/arch/arm64/crypto/sha2-ce-glue.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/arm64/crypto/sha2-ce-glue.c	2018-11-27 10:08:03.000000000 -0500
@@ -17,9 +17,6 @@
 #include <linux/crypto.h>
 #include <linux/module.h>
 
-#define ASM_EXPORT(sym, val) \
-	asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
-
 MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions");
 MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
 MODULE_LICENSE("GPL v2");
@@ -32,6 +29,11 @@ struct sha256_ce_state {
 asmlinkage void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src,
 				  int blocks);
 
+const u32 sha256_ce_offsetof_count = offsetof(struct sha256_ce_state,
+					      sst.count);
+const u32 sha256_ce_offsetof_finalize = offsetof(struct sha256_ce_state,
+						 finalize);
+
 static int sha256_ce_update(struct shash_desc *desc, const u8 *data,
 			    unsigned int len)
 {
@@ -52,11 +54,6 @@ static int sha256_ce_finup(struct shash_
 	struct sha256_ce_state *sctx = shash_desc_ctx(desc);
 	bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE);
 
-	ASM_EXPORT(sha256_ce_offsetof_count,
-		   offsetof(struct sha256_ce_state, sst.count));
-	ASM_EXPORT(sha256_ce_offsetof_finalize,
-		   offsetof(struct sha256_ce_state, finalize));
-
 	/*
 	 * Allow the asm code to perform the finalization if there is no
 	 * partial data and the input is a round multiple of the block size.
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/arm64/include/asm/percpu.h linux-libre-4.4.165-gnu/arch/arm64/include/asm/percpu.h
--- linux-libre-4.4.164-gnu/arch/arm64/include/asm/percpu.h	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/arm64/include/asm/percpu.h	2018-11-27 10:08:03.000000000 -0500
@@ -84,6 +84,7 @@ static inline unsigned long __percpu_##o
 		: [val] "Ir" (val));					\
 		break;							\
 	default:							\
+		ret = 0;						\
 		BUILD_BUG();						\
 	}								\
 									\
@@ -113,6 +114,7 @@ static inline unsigned long __percpu_rea
 		ret = ACCESS_ONCE(*(u64 *)ptr);
 		break;
 	default:
+		ret = 0;
 		BUILD_BUG();
 	}
 
@@ -182,6 +184,7 @@ static inline unsigned long __percpu_xch
 		: [val] "r" (val));
 		break;
 	default:
+		ret = 0;
 		BUILD_BUG();
 	}
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/arm64/Makefile linux-libre-4.4.165-gnu/arch/arm64/Makefile
--- linux-libre-4.4.164-gnu/arch/arm64/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/arm64/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -56,6 +56,10 @@ else
 TEXT_OFFSET := 0x00080000
 endif
 
+ifeq ($(cc-name),clang)
+KBUILD_CFLAGS += $(call cc-disable-warning, asm-operand-widths)
+endif
+
 # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
 # in 32-bit arithmetic
 KASAN_SHADOW_OFFSET := $(shell printf "0x%08x00000000\n" $$(( \
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/ia64/kernel/Makefile linux-libre-4.4.165-gnu/arch/ia64/kernel/Makefile
--- linux-libre-4.4.164-gnu/arch/ia64/kernel/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/ia64/kernel/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -50,32 +50,10 @@ CFLAGS_traps.o  += -mfixed-range=f2-f5,f
 # The gate DSO image is built using a special linker script.
 include $(src)/Makefile.gate
 
-# Calculate NR_IRQ = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...) based on config
-define sed-y
-	"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
-endef
-quiet_cmd_nr_irqs = GEN     $@
-define cmd_nr_irqs
-	(set -e; \
-	 echo "#ifndef __ASM_NR_IRQS_H__"; \
-	 echo "#define __ASM_NR_IRQS_H__"; \
-	 echo "/*"; \
-	 echo " * DO NOT MODIFY."; \
-	 echo " *"; \
-	 echo " * This file was generated by Kbuild"; \
-	 echo " *"; \
-	 echo " */"; \
-	 echo ""; \
-	 sed -ne $(sed-y) $<; \
-	 echo ""; \
-	 echo "#endif" ) > $@
-endef
-
 # We use internal kbuild rules to avoid the "is up to date" message from make
 arch/$(SRCARCH)/kernel/nr-irqs.s: arch/$(SRCARCH)/kernel/nr-irqs.c
 	$(Q)mkdir -p $(dir $@)
 	$(call if_changed_dep,cc_s_c)
 
-include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s
-	$(Q)mkdir -p $(dir $@)
-	$(call cmd,nr_irqs)
+include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s FORCE
+	$(call filechk,offsets,__ASM_NR_IRQS_H__)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/s390/kernel/vdso32/Makefile linux-libre-4.4.165-gnu/arch/s390/kernel/vdso32/Makefile
--- linux-libre-4.4.164-gnu/arch/s390/kernel/vdso32/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/s390/kernel/vdso32/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -29,7 +29,7 @@ GCOV_PROFILE := n
 $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
 
 # link rule for the .so file, .lds has to be first
-$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32)
+$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE
 	$(call if_changed,vdso32ld)
 
 # strip rule for the .so file
@@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 	$(call if_changed,objcopy)
 
 # assembly rules for the .S files
-$(obj-vdso32): %.o: %.S
+$(obj-vdso32): %.o: %.S FORCE
 	$(call if_changed_dep,vdso32as)
 
 # actual build commands
 quiet_cmd_vdso32ld = VDSO32L $@
-      cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
+      cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@
 quiet_cmd_vdso32as = VDSO32A $@
       cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $<
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/s390/kernel/vdso64/Makefile linux-libre-4.4.165-gnu/arch/s390/kernel/vdso64/Makefile
--- linux-libre-4.4.164-gnu/arch/s390/kernel/vdso64/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/s390/kernel/vdso64/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -29,7 +29,7 @@ GCOV_PROFILE := n
 $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
 
 # link rule for the .so file, .lds has to be first
-$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64)
+$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) FORCE
 	$(call if_changed,vdso64ld)
 
 # strip rule for the .so file
@@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 	$(call if_changed,objcopy)
 
 # assembly rules for the .S files
-$(obj-vdso64): %.o: %.S
+$(obj-vdso64): %.o: %.S FORCE
 	$(call if_changed_dep,vdso64as)
 
 # actual build commands
 quiet_cmd_vdso64ld = VDSO64L $@
-      cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
+      cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@
 quiet_cmd_vdso64as = VDSO64A $@
       cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/s390/numa/numa.c linux-libre-4.4.165-gnu/arch/s390/numa/numa.c
--- linux-libre-4.4.164-gnu/arch/s390/numa/numa.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/s390/numa/numa.c	2018-11-27 10:08:03.000000000 -0500
@@ -47,6 +47,7 @@ int __node_distance(int a, int b)
 {
 	return mode->distance ? mode->distance(a, b) : 0;
 }
+EXPORT_SYMBOL(__node_distance);
 
 int numa_debug_enabled;
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/um/os-Linux/skas/process.c linux-libre-4.4.165-gnu/arch/um/os-Linux/skas/process.c
--- linux-libre-4.4.164-gnu/arch/um/os-Linux/skas/process.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/um/os-Linux/skas/process.c	2018-11-27 10:08:03.000000000 -0500
@@ -585,6 +585,11 @@ int start_idle_thread(void *stack, jmp_b
 		fatal_sigsegv();
 	}
 	longjmp(*switch_buf, 1);
+
+	/* unreachable */
+	printk(UM_KERN_ERR "impossible long jump!");
+	fatal_sigsegv();
+	return 0;
 }
 
 void initial_thread_cb_skas(void (*proc)(void *), void *arg)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/x86/boot/compressed/aslr.c linux-libre-4.4.165-gnu/arch/x86/boot/compressed/aslr.c
--- linux-libre-4.4.164-gnu/arch/x86/boot/compressed/aslr.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/x86/boot/compressed/aslr.c	2018-11-27 10:08:03.000000000 -0500
@@ -1,5 +1,6 @@
 #include "misc.h"
 
+#include <asm/asm.h>
 #include <asm/msr.h>
 #include <asm/archrandom.h>
 #include <asm/e820.h>
@@ -94,7 +95,7 @@ static unsigned long get_random_long(voi
 	}
 
 	/* Circular multiply for better bit diffusion */
-	asm("mul %3"
+	asm(_ASM_MUL "%3"
 	    : "=a" (random), "=d" (raw)
 	    : "a" (random), "rm" (mix_const));
 	random += raw;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/x86/boot/string.c linux-libre-4.4.165-gnu/arch/x86/boot/string.c
--- linux-libre-4.4.164-gnu/arch/x86/boot/string.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/x86/boot/string.c	2018-11-27 10:08:03.000000000 -0500
@@ -16,6 +16,15 @@
 #include "ctype.h"
 #include "string.h"
 
+/*
+ * Undef these macros so that the functions that we provide
+ * here will have the correct names regardless of how string.h
+ * may have chosen to #define them.
+ */
+#undef memcpy
+#undef memset
+#undef memcmp
+
 int memcmp(const void *s1, const void *s2, size_t len)
 {
 	u8 diff;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/x86/crypto/aes_ctrby8_avx-x86_64.S linux-libre-4.4.165-gnu/arch/x86/crypto/aes_ctrby8_avx-x86_64.S
--- linux-libre-4.4.164-gnu/arch/x86/crypto/aes_ctrby8_avx-x86_64.S	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/x86/crypto/aes_ctrby8_avx-x86_64.S	2018-11-27 10:08:03.000000000 -0500
@@ -65,7 +65,6 @@
 #include <linux/linkage.h>
 #include <asm/inst.h>
 
-#define CONCAT(a,b)	a##b
 #define VMOVDQ		vmovdqu
 
 #define xdata0		%xmm0
@@ -92,8 +91,6 @@
 #define num_bytes	%r8
 
 #define tmp		%r10
-#define	DDQ(i)		CONCAT(ddq_add_,i)
-#define	XMM(i)		CONCAT(%xmm, i)
 #define	DDQ_DATA	0
 #define	XDATA		1
 #define KEY_128		1
@@ -131,12 +128,12 @@ ddq_add_8:
 /* generate a unique variable for ddq_add_x */
 
 .macro setddq n
-	var_ddq_add = DDQ(\n)
+	var_ddq_add = ddq_add_\n
 .endm
 
 /* generate a unique variable for xmm register */
 .macro setxdata n
-	var_xdata = XMM(\n)
+	var_xdata = %xmm\n
 .endm
 
 /* club the numeric 'id' to the symbol 'name' */
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/x86/include/asm/asm.h linux-libre-4.4.165-gnu/arch/x86/include/asm/asm.h
--- linux-libre-4.4.164-gnu/arch/x86/include/asm/asm.h	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/x86/include/asm/asm.h	2018-11-27 10:08:03.000000000 -0500
@@ -34,6 +34,7 @@
 #define _ASM_ADD	__ASM_SIZE(add)
 #define _ASM_SUB	__ASM_SIZE(sub)
 #define _ASM_XADD	__ASM_SIZE(xadd)
+#define _ASM_MUL	__ASM_SIZE(mul)
 
 #define _ASM_AX		__ASM_REG(ax)
 #define _ASM_BX		__ASM_REG(bx)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/arch/x86/Makefile linux-libre-4.4.165-gnu/arch/x86/Makefile
--- linux-libre-4.4.164-gnu/arch/x86/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/arch/x86/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -11,6 +11,16 @@ else
         KBUILD_DEFCONFIG := $(ARCH)_defconfig
 endif
 
+# For gcc stack alignment is specified with -mpreferred-stack-boundary,
+# clang has the option -mstack-alignment for that purpose.
+ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
+      cc_stack_align4 := -mpreferred-stack-boundary=2
+      cc_stack_align8 := -mpreferred-stack-boundary=3
+else ifneq ($(call cc-option, -mstack-alignment=16),)
+      cc_stack_align4 := -mstack-alignment=4
+      cc_stack_align8 := -mstack-alignment=8
+endif
+
 # How to compile the 16-bit code.  Note we always compile for -march=i386;
 # that way we can complain to the user if the CPU is insufficient.
 #
@@ -24,10 +34,11 @@ REALMODE_CFLAGS	:= $(M16_CFLAGS) -g -Os
 		   -DDISABLE_BRANCH_PROFILING \
 		   -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \
 		   -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
-		   -mno-mmx -mno-sse \
-		   $(call cc-option, -ffreestanding) \
-		   $(call cc-option, -fno-stack-protector) \
-		   $(call cc-option, -mpreferred-stack-boundary=2)
+		   -mno-mmx -mno-sse
+
+REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
+REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)
+REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4))
 export REALMODE_CFLAGS
 
 # BITS is used as extension for files which are available in a 32 bit
@@ -64,8 +75,10 @@ ifeq ($(CONFIG_X86_32),y)
         # with nonstandard options
         KBUILD_CFLAGS += -fno-pic
 
-        # prevent gcc from keeping the stack 16 byte aligned
-        KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
+        # Align the stack to the register width instead of using the default
+        # alignment of 16 bytes. This reduces stack usage and the number of
+        # alignment instructions.
+        KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align4))
 
         # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
         # a lot more stack due to the lack of sharing of stacklots:
@@ -88,17 +101,23 @@ else
         KBUILD_CFLAGS += -m64
 
         # Align jump targets to 1 byte, not the default 16 bytes:
-        KBUILD_CFLAGS += -falign-jumps=1
+        KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1)
 
         # Pack loops tightly as well:
-        KBUILD_CFLAGS += -falign-loops=1
+        KBUILD_CFLAGS += $(call cc-option,-falign-loops=1)
 
         # Don't autogenerate traditional x87 instructions
         KBUILD_CFLAGS += $(call cc-option,-mno-80387)
         KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)
 
-	# Use -mpreferred-stack-boundary=3 if supported.
-	KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+        # By default gcc and clang use a stack alignment of 16 bytes for x86.
+        # However the standard kernel entry on x86-64 leaves the stack on an
+        # 8-byte boundary. If the compiler isn't informed about the actual
+        # alignment it will generate extra alignment instructions for the
+        # default alignment which keep the stack *mis*aligned.
+        # Furthermore an alignment to the register width reduces stack usage
+        # and the number of alignment instructions.
+        KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align8))
 
 	# Use -mskip-rax-setup if supported.
 	KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/acpi/acpi_platform.c linux-libre-4.4.165-gnu/drivers/acpi/acpi_platform.c
--- linux-libre-4.4.164-gnu/drivers/acpi/acpi_platform.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/acpi/acpi_platform.c	2018-11-27 10:08:03.000000000 -0500
@@ -29,6 +29,7 @@ static const struct acpi_device_id forbi
 	{"PNP0200",  0},	/* AT DMA Controller */
 	{"ACPI0009", 0},	/* IOxAPIC */
 	{"ACPI000A", 0},	/* IOAPIC */
+	{"SMB0001",  0},	/* ACPI SMBUS virtual device */
 	{"", 0},
 };
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/block/zram/zram_drv.c linux-libre-4.4.165-gnu/drivers/block/zram/zram_drv.c
--- linux-libre-4.4.164-gnu/drivers/block/zram/zram_drv.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/block/zram/zram_drv.c	2018-11-27 10:08:03.000000000 -0500
@@ -1184,6 +1184,11 @@ static struct attribute_group zram_disk_
 	.attrs = zram_disk_attrs,
 };
 
+static const struct attribute_group *zram_disk_attr_groups[] = {
+	&zram_disk_attr_group,
+	NULL,
+};
+
 /*
  * Allocate and initialize new zram device. the function returns
  * '>= 0' device_id upon success, and negative value otherwise.
@@ -1264,15 +1269,9 @@ static int zram_add(void)
 		zram->disk->queue->limits.discard_zeroes_data = 0;
 	queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue);
 
+	disk_to_dev(zram->disk)->groups = zram_disk_attr_groups;
 	add_disk(zram->disk);
 
-	ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj,
-				&zram_disk_attr_group);
-	if (ret < 0) {
-		pr_err("Error creating sysfs group for device %d\n",
-				device_id);
-		goto out_free_disk;
-	}
 	strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor));
 	zram->meta = NULL;
 	zram->max_comp_streams = 1;
@@ -1280,9 +1279,6 @@ static int zram_add(void)
 	pr_info("Added device: %s\n", zram->disk->disk_name);
 	return device_id;
 
-out_free_disk:
-	del_gendisk(zram->disk);
-	put_disk(zram->disk);
 out_free_queue:
 	blk_cleanup_queue(queue);
 out_free_idr:
@@ -1310,16 +1306,6 @@ static int zram_remove(struct zram *zram
 	zram->claim = true;
 	mutex_unlock(&bdev->bd_mutex);
 
-	/*
-	 * Remove sysfs first, so no one will perform a disksize
-	 * store while we destroy the devices. This also helps during
-	 * hot_remove -- zram_reset_device() is the last holder of
-	 * ->init_lock, no later/concurrent disksize_store() or any
-	 * other sysfs handlers are possible.
-	 */
-	sysfs_remove_group(&disk_to_dev(zram->disk)->kobj,
-			&zram_disk_attr_group);
-
 	/* Make sure all the pending I/O are finished */
 	fsync_bdev(bdev);
 	zram_reset_device(zram);
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/bluetooth/Kconfig linux-libre-4.4.165-gnu/drivers/bluetooth/Kconfig
--- linux-libre-4.4.164-gnu/drivers/bluetooth/Kconfig	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/bluetooth/Kconfig	2018-11-27 10:08:03.000000000 -0500
@@ -125,7 +125,6 @@ config BT_HCIUART_LL
 config BT_HCIUART_3WIRE
 	bool "Three-wire UART (H5) protocol support"
 	depends on BT_HCIUART
-	depends on BT_HCIUART_SERDEV
 	help
 	  The HCI Three-wire UART Transport Layer makes it possible to
 	  user the Bluetooth HCI over a serial port interface. The HCI
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/clk/samsung/clk-exynos5420.c linux-libre-4.4.165-gnu/drivers/clk/samsung/clk-exynos5420.c
--- linux-libre-4.4.164-gnu/drivers/clk/samsung/clk-exynos5420.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/clk/samsung/clk-exynos5420.c	2018-11-27 10:08:03.000000000 -0500
@@ -273,6 +273,7 @@ static const struct samsung_clk_reg_dump
 	{ .offset = GATE_BUS_TOP,		.value = 0xffffffff, },
 	{ .offset = GATE_BUS_DISP1,		.value = 0xffffffff, },
 	{ .offset = GATE_IP_PERIC,		.value = 0xffffffff, },
+	{ .offset = GATE_IP_PERIS,		.value = 0xffffffff, },
 };
 
 static int exynos5420_clk_suspend(void)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/firmware/efi/libstub/arm64-stub.c linux-libre-4.4.165-gnu/drivers/firmware/efi/libstub/arm64-stub.c
--- linux-libre-4.4.164-gnu/drivers/firmware/efi/libstub/arm64-stub.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/firmware/efi/libstub/arm64-stub.c	2018-11-27 10:08:03.000000000 -0500
@@ -9,9 +9,17 @@
  * published by the Free Software Foundation.
  *
  */
+
+/*
+ * To prevent the compiler from emitting GOT-indirected (and thus absolute)
+ * references to the section markers, override their visibility as 'hidden'
+ */
+#pragma GCC visibility push(hidden)
+#include <asm/sections.h>
+#pragma GCC visibility pop
+
 #include <linux/efi.h>
 #include <asm/efi.h>
-#include <asm/sections.h>
 
 efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table_arg,
 					unsigned long *image_addr,
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/firmware/efi/libstub/Makefile linux-libre-4.4.165-gnu/drivers/firmware/efi/libstub/Makefile
--- linux-libre-4.4.164-gnu/drivers/firmware/efi/libstub/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/firmware/efi/libstub/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -10,7 +10,7 @@ cflags-$(CONFIG_X86)		+= -m$(BITS) -D__K
 				   -fPIC -fno-strict-aliasing -mno-red-zone \
 				   -mno-mmx -mno-sse -DDISABLE_BRANCH_PROFILING
 
-cflags-$(CONFIG_ARM64)		:= $(subst -pg,,$(KBUILD_CFLAGS))
+cflags-$(CONFIG_ARM64)		:= $(subst -pg,,$(KBUILD_CFLAGS)) -fpie
 cflags-$(CONFIG_ARM)		:= $(subst -pg,,$(KBUILD_CFLAGS)) \
 				   -fno-builtin -fpic -mno-single-pic-base
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/hid/uhid.c linux-libre-4.4.165-gnu/drivers/hid/uhid.c
--- linux-libre-4.4.164-gnu/drivers/hid/uhid.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/hid/uhid.c	2018-11-27 10:08:03.000000000 -0500
@@ -12,6 +12,7 @@
 
 #include <linux/atomic.h>
 #include <linux/compat.h>
+#include <linux/cred.h>
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/hid.h>
@@ -24,6 +25,7 @@
 #include <linux/spinlock.h>
 #include <linux/uhid.h>
 #include <linux/wait.h>
+#include <linux/uaccess.h>
 
 #define UHID_NAME	"uhid"
 #define UHID_BUFSIZE	32
@@ -721,6 +723,17 @@ static ssize_t uhid_char_write(struct fi
 
 	switch (uhid->input_buf.type) {
 	case UHID_CREATE:
+		/*
+		 * 'struct uhid_create_req' contains a __user pointer which is
+		 * copied from, so it's unsafe to allow this with elevated
+		 * privileges (e.g. from a setuid binary) or via kernel_write().
+		 */
+		if (file->f_cred != current_cred() || uaccess_kernel()) {
+			pr_err_once("UHID_CREATE from different security context by process %d (%s), this is not allowed.\n",
+				    task_tgid_vnr(current), current->comm);
+			ret = -EACCES;
+			goto unlock;
+		}
 		ret = uhid_dev_create(uhid, &uhid->input_buf);
 		break;
 	case UHID_CREATE2:
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/hwmon/ibmpowernv.c linux-libre-4.4.165-gnu/drivers/hwmon/ibmpowernv.c
--- linux-libre-4.4.164-gnu/drivers/hwmon/ibmpowernv.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/hwmon/ibmpowernv.c	2018-11-27 10:08:03.000000000 -0500
@@ -114,7 +114,7 @@ static ssize_t show_label(struct device
 	return sprintf(buf, "%s\n", sdata->label);
 }
 
-static int __init get_logical_cpu(int hwcpu)
+static int get_logical_cpu(int hwcpu)
 {
 	int cpu;
 
@@ -125,9 +125,8 @@ static int __init get_logical_cpu(int hw
 	return -ENOENT;
 }
 
-static void __init make_sensor_label(struct device_node *np,
-				     struct sensor_data *sdata,
-				     const char *label)
+static void make_sensor_label(struct device_node *np,
+			      struct sensor_data *sdata, const char *label)
 {
 	u32 id;
 	size_t n;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/media/v4l2-core/v4l2-event.c linux-libre-4.4.165-gnu/drivers/media/v4l2-core/v4l2-event.c
--- linux-libre-4.4.164-gnu/drivers/media/v4l2-core/v4l2-event.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/media/v4l2-core/v4l2-event.c	2018-11-27 10:08:03.000000000 -0500
@@ -197,6 +197,22 @@ int v4l2_event_pending(struct v4l2_fh *f
 }
 EXPORT_SYMBOL_GPL(v4l2_event_pending);
 
+static void __v4l2_event_unsubscribe(struct v4l2_subscribed_event *sev)
+{
+	struct v4l2_fh *fh = sev->fh;
+	unsigned int i;
+
+	lockdep_assert_held(&fh->subscribe_lock);
+	assert_spin_locked(&fh->vdev->fh_lock);
+
+	/* Remove any pending events for this subscription */
+	for (i = 0; i < sev->in_use; i++) {
+		list_del(&sev->events[sev_pos(sev, i)].list);
+		fh->navailable--;
+	}
+	list_del(&sev->list);
+}
+
 int v4l2_event_subscribe(struct v4l2_fh *fh,
 			 const struct v4l2_event_subscription *sub, unsigned elems,
 			 const struct v4l2_subscribed_event_ops *ops)
@@ -228,27 +244,23 @@ int v4l2_event_subscribe(struct v4l2_fh
 
 	spin_lock_irqsave(&fh->vdev->fh_lock, flags);
 	found_ev = v4l2_event_subscribed(fh, sub->type, sub->id);
+	if (!found_ev)
+		list_add(&sev->list, &fh->subscribed);
 	spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
 
 	if (found_ev) {
 		/* Already listening */
 		kfree(sev);
-		goto out_unlock;
-	}
-
-	if (sev->ops && sev->ops->add) {
+	} else if (sev->ops && sev->ops->add) {
 		ret = sev->ops->add(sev, elems);
 		if (ret) {
+			spin_lock_irqsave(&fh->vdev->fh_lock, flags);
+			__v4l2_event_unsubscribe(sev);
+			spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
 			kfree(sev);
-			goto out_unlock;
 		}
 	}
 
-	spin_lock_irqsave(&fh->vdev->fh_lock, flags);
-	list_add(&sev->list, &fh->subscribed);
-	spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
-
-out_unlock:
 	mutex_unlock(&fh->subscribe_lock);
 
 	return ret;
@@ -283,7 +295,6 @@ int v4l2_event_unsubscribe(struct v4l2_f
 {
 	struct v4l2_subscribed_event *sev;
 	unsigned long flags;
-	int i;
 
 	if (sub->type == V4L2_EVENT_ALL) {
 		v4l2_event_unsubscribe_all(fh);
@@ -295,14 +306,8 @@ int v4l2_event_unsubscribe(struct v4l2_f
 	spin_lock_irqsave(&fh->vdev->fh_lock, flags);
 
 	sev = v4l2_event_subscribed(fh, sub->type, sub->id);
-	if (sev != NULL) {
-		/* Remove any pending events for this subscription */
-		for (i = 0; i < sev->in_use; i++) {
-			list_del(&sev->events[sev_pos(sev, i)].list);
-			fh->navailable--;
-		}
-		list_del(&sev->list);
-	}
+	if (sev != NULL)
+		__v4l2_event_unsubscribe(sev);
 
 	spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/media/v4l2-core/videobuf2-core.c linux-libre-4.4.165-gnu/drivers/media/v4l2-core/videobuf2-core.c
--- linux-libre-4.4.164-gnu/drivers/media/v4l2-core/videobuf2-core.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/media/v4l2-core/videobuf2-core.c	2018-11-27 10:08:03.000000000 -0500
@@ -870,12 +870,9 @@ void vb2_buffer_done(struct vb2_buffer *
 	dprintk(4, "done processing on buffer %d, state: %d\n",
 			vb->index, state);
 
-	if (state != VB2_BUF_STATE_QUEUED &&
-	    state != VB2_BUF_STATE_REQUEUEING) {
-		/* sync buffers */
-		for (plane = 0; plane < vb->num_planes; ++plane)
-			call_void_memop(vb, finish, vb->planes[plane].mem_priv);
-	}
+	/* sync buffers */
+	for (plane = 0; plane < vb->num_planes; ++plane)
+		call_void_memop(vb, finish, vb->planes[plane].mem_priv);
 
 	spin_lock_irqsave(&q->done_lock, flags);
 	if (state == VB2_BUF_STATE_QUEUED ||
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/misc/atmel-ssc.c linux-libre-4.4.165-gnu/drivers/misc/atmel-ssc.c
--- linux-libre-4.4.164-gnu/drivers/misc/atmel-ssc.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/misc/atmel-ssc.c	2018-11-27 10:08:03.000000000 -0500
@@ -129,7 +129,7 @@ static const struct of_device_id atmel_s
 MODULE_DEVICE_TABLE(of, atmel_ssc_dt_ids);
 #endif
 
-static inline const struct atmel_ssc_platform_data * __init
+static inline const struct atmel_ssc_platform_data *
 	atmel_ssc_get_driver_data(struct platform_device *pdev)
 {
 	if (pdev->dev.of_node) {
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/misc/sgi-gru/grukdump.c linux-libre-4.4.165-gnu/drivers/misc/sgi-gru/grukdump.c
--- linux-libre-4.4.164-gnu/drivers/misc/sgi-gru/grukdump.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/misc/sgi-gru/grukdump.c	2018-11-27 10:08:03.000000000 -0500
@@ -27,6 +27,9 @@
 #include <linux/delay.h>
 #include <linux/bitops.h>
 #include <asm/uv/uv_hub.h>
+
+#include <linux/nospec.h>
+
 #include "gru.h"
 #include "grutables.h"
 #include "gruhandles.h"
@@ -196,6 +199,7 @@ int gru_dump_chiplet_request(unsigned lo
 	/* Currently, only dump by gid is implemented */
 	if (req.gid >= gru_max_gids)
 		return -EINVAL;
+	req.gid = array_index_nospec(req.gid, gru_max_gids);
 
 	gru = GID_TO_GRU(req.gid);
 	ubuf = req.buf;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/net/ethernet/broadcom/tg3.c linux-libre-4.4.165-gnu/drivers/net/ethernet/broadcom/tg3.c
--- linux-libre-4.4.164-gnu/drivers/net/ethernet/broadcom/tg3.c	2018-11-21 13:14:01.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/net/ethernet/broadcom/tg3.c	2018-11-27 14:35:21.000000000 -0500
@@ -12370,6 +12370,7 @@ static int tg3_set_ringparam(struct net_
 {
 	struct tg3 *tp = netdev_priv(dev);
 	int i, irq_sync = 0, err = 0;
+	bool reset_phy = false;
 
 	if ((ering->rx_pending > tp->rx_std_ring_mask) ||
 	    (ering->rx_jumbo_pending > tp->rx_jmb_ring_mask) ||
@@ -12401,7 +12402,13 @@ static int tg3_set_ringparam(struct net_
 
 	if (netif_running(dev)) {
 		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-		err = tg3_restart_hw(tp, false);
+		/* Reset PHY to avoid PHY lock up */
+		if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
+		    tg3_asic_rev(tp) == ASIC_REV_5719 ||
+		    tg3_asic_rev(tp) == ASIC_REV_5720)
+			reset_phy = true;
+
+		err = tg3_restart_hw(tp, reset_phy);
 		if (!err)
 			tg3_netif_start(tp);
 	}
@@ -12435,6 +12442,7 @@ static int tg3_set_pauseparam(struct net
 {
 	struct tg3 *tp = netdev_priv(dev);
 	int err = 0;
+	bool reset_phy = false;
 
 	if (tp->link_config.autoneg == AUTONEG_ENABLE)
 		tg3_warn_mgmt_link_flap(tp);
@@ -12525,7 +12533,13 @@ static int tg3_set_pauseparam(struct net
 
 		if (netif_running(dev)) {
 			tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-			err = tg3_restart_hw(tp, false);
+			/* Reset PHY to avoid PHY lock up */
+			if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
+			    tg3_asic_rev(tp) == ASIC_REV_5719 ||
+			    tg3_asic_rev(tp) == ASIC_REV_5720)
+				reset_phy = true;
+
+			err = tg3_restart_hw(tp, reset_phy);
 			if (!err)
 				tg3_netif_start(tp);
 		}
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/platform/x86/acerhdf.c linux-libre-4.4.165-gnu/drivers/platform/x86/acerhdf.c
--- linux-libre-4.4.164-gnu/drivers/platform/x86/acerhdf.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/platform/x86/acerhdf.c	2018-11-27 10:08:03.000000000 -0500
@@ -233,6 +233,7 @@ static const struct bios_settings bios_t
 	{"Gateway", "LT31",   "v1.3201",  0x55, 0x58, {0x9e, 0x00}, 0},
 	{"Gateway", "LT31",   "v1.3302",  0x55, 0x58, {0x9e, 0x00}, 0},
 	{"Gateway", "LT31",   "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0},
+	{"Gateway", "LT31",   "v1.3307",  0x55, 0x58, {0x9e, 0x00}, 0},
 	/* Packard Bell */
 	{"Packard Bell", "DOA150",  "v0.3104",  0x55, 0x58, {0x21, 0x00}, 0},
 	{"Packard Bell", "DOA150",  "v0.3105",  0x55, 0x58, {0x20, 0x00}, 0},
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/uio/uio.c linux-libre-4.4.165-gnu/drivers/uio/uio.c
--- linux-libre-4.4.164-gnu/drivers/uio/uio.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/uio/uio.c	2018-11-27 10:08:03.000000000 -0500
@@ -842,6 +842,8 @@ int __uio_register_device(struct module
 	if (ret)
 		goto err_uio_dev_add_attributes;
 
+	info->uio_dev = idev;
+
 	if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) {
 		/*
 		 * Note that we deliberately don't use devm_request_irq
@@ -853,11 +855,12 @@ int __uio_register_device(struct module
 		 */
 		ret = request_irq(info->irq, uio_interrupt,
 				  info->irq_flags, info->name, idev);
-		if (ret)
+		if (ret) {
+			info->uio_dev = NULL;
 			goto err_request_irq;
+		}
 	}
 
-	info->uio_dev = idev;
 	return 0;
 
 err_request_irq:
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/usb/class/cdc-acm.c linux-libre-4.4.165-gnu/drivers/usb/class/cdc-acm.c
--- linux-libre-4.4.164-gnu/drivers/usb/class/cdc-acm.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/usb/class/cdc-acm.c	2018-11-27 10:08:03.000000000 -0500
@@ -1716,6 +1716,9 @@ static const struct usb_device_id acm_id
 	{ USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */
 	.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
 	},
+	{ USB_DEVICE(0x0572, 0x1349), /* Hiro (Conexant) USB MODEM H50228 */
+	.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
+	},
 	{ USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */
 	.driver_info = QUIRK_CONTROL_LINE_STATE, },
 	{ USB_DEVICE(0x2184, 0x001c) },	/* GW Instek AFG-2225 */
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/usb/core/quirks.c linux-libre-4.4.165-gnu/drivers/usb/core/quirks.c
--- linux-libre-4.4.164-gnu/drivers/usb/core/quirks.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/usb/core/quirks.c	2018-11-27 10:08:03.000000000 -0500
@@ -243,6 +243,9 @@ static const struct usb_device_id usb_qu
 	{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
 	  USB_QUIRK_DELAY_CTRL_MSG },
 
+	/* Corsair K70 LUX RGB */
+	{ USB_DEVICE(0x1b1c, 0x1b33), .driver_info = USB_QUIRK_DELAY_INIT },
+
 	/* Corsair K70 LUX */
 	{ USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
 
@@ -263,6 +266,11 @@ static const struct usb_device_id usb_qu
 	{ USB_DEVICE(0x2040, 0x7200), .driver_info =
 			USB_QUIRK_CONFIG_INTF_STRINGS },
 
+	/* Raydium Touchscreen */
+	{ USB_DEVICE(0x2386, 0x3114), .driver_info = USB_QUIRK_NO_LPM },
+
+	{ USB_DEVICE(0x2386, 0x3119), .driver_info = USB_QUIRK_NO_LPM },
+
 	/* DJI CineSSD */
 	{ USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/usb/host/xhci-hub.c linux-libre-4.4.165-gnu/drivers/usb/host/xhci-hub.c
--- linux-libre-4.4.164-gnu/drivers/usb/host/xhci-hub.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/usb/host/xhci-hub.c	2018-11-27 10:08:03.000000000 -0500
@@ -348,7 +348,7 @@ int xhci_find_slot_id_by_port(struct usb
 
 	slot_id = 0;
 	for (i = 0; i < MAX_HC_SLOTS; i++) {
-		if (!xhci->devs[i])
+		if (!xhci->devs[i] || !xhci->devs[i]->udev)
 			continue;
 		speed = xhci->devs[i]->udev->speed;
 		if (((speed >= USB_SPEED_SUPER) == (hcd->speed >= HCD_USB3))
diff -druNp --no-dereference linux-libre-4.4.164-gnu/drivers/usb/misc/appledisplay.c linux-libre-4.4.165-gnu/drivers/usb/misc/appledisplay.c
--- linux-libre-4.4.164-gnu/drivers/usb/misc/appledisplay.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/drivers/usb/misc/appledisplay.c	2018-11-27 10:08:03.000000000 -0500
@@ -63,6 +63,7 @@ static const struct usb_device_id appled
 	{ APPLEDISPLAY_DEVICE(0x9219) },
 	{ APPLEDISPLAY_DEVICE(0x921c) },
 	{ APPLEDISPLAY_DEVICE(0x921d) },
+	{ APPLEDISPLAY_DEVICE(0x9222) },
 	{ APPLEDISPLAY_DEVICE(0x9236) },
 
 	/* Terminating entry */
diff -druNp --no-dereference linux-libre-4.4.164-gnu/fs/btrfs/disk-io.c linux-libre-4.4.165-gnu/fs/btrfs/disk-io.c
--- linux-libre-4.4.164-gnu/fs/btrfs/disk-io.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/fs/btrfs/disk-io.c	2018-11-27 10:08:03.000000000 -0500
@@ -4333,6 +4333,7 @@ static int btrfs_destroy_marked_extents(
 static int btrfs_destroy_pinned_extent(struct btrfs_root *root,
 				       struct extent_io_tree *pinned_extents)
 {
+	struct btrfs_fs_info *fs_info = root->fs_info;
 	struct extent_io_tree *unpin;
 	u64 start;
 	u64 end;
@@ -4342,21 +4343,31 @@ static int btrfs_destroy_pinned_extent(s
 	unpin = pinned_extents;
 again:
 	while (1) {
+		/*
+		 * The btrfs_finish_extent_commit() may get the same range as
+		 * ours between find_first_extent_bit and clear_extent_dirty.
+		 * Hence, hold the unused_bg_unpin_mutex to avoid double unpin
+		 * the same extent range.
+		 */
+		mutex_lock(&fs_info->unused_bg_unpin_mutex);
 		ret = find_first_extent_bit(unpin, 0, &start, &end,
 					    EXTENT_DIRTY, NULL);
-		if (ret)
+		if (ret) {
+			mutex_unlock(&fs_info->unused_bg_unpin_mutex);
 			break;
+		}
 
 		clear_extent_dirty(unpin, start, end, GFP_NOFS);
 		btrfs_error_unpin_extent_range(root, start, end);
+		mutex_unlock(&fs_info->unused_bg_unpin_mutex);
 		cond_resched();
 	}
 
 	if (loop) {
-		if (unpin == &root->fs_info->freed_extents[0])
-			unpin = &root->fs_info->freed_extents[1];
+		if (unpin == &fs_info->freed_extents[0])
+			unpin = &fs_info->freed_extents[1];
 		else
-			unpin = &root->fs_info->freed_extents[0];
+			unpin = &fs_info->freed_extents[0];
 		loop = false;
 		goto again;
 	}
diff -druNp --no-dereference linux-libre-4.4.164-gnu/fs/exofs/super.c linux-libre-4.4.165-gnu/fs/exofs/super.c
--- linux-libre-4.4.164-gnu/fs/exofs/super.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/fs/exofs/super.c	2018-11-27 10:08:03.000000000 -0500
@@ -100,6 +100,7 @@ static int parse_options(char *options,
 		token = match_token(p, tokens, args);
 		switch (token) {
 		case Opt_name:
+			kfree(opts->dev_name);
 			opts->dev_name = match_strdup(&args[0]);
 			if (unlikely(!opts->dev_name)) {
 				EXOFS_ERR("Error allocating dev_name");
@@ -868,8 +869,10 @@ static struct dentry *exofs_mount(struct
 	int ret;
 
 	ret = parse_options(data, &opts);
-	if (ret)
+	if (ret) {
+		kfree(opts.dev_name);
 		return ERR_PTR(ret);
+	}
 
 	if (!opts.dev_name)
 		opts.dev_name = dev_name;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/fs/gfs2/rgrp.c linux-libre-4.4.165-gnu/fs/gfs2/rgrp.c
--- linux-libre-4.4.164-gnu/fs/gfs2/rgrp.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/fs/gfs2/rgrp.c	2018-11-27 10:08:03.000000000 -0500
@@ -732,6 +732,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *s
 			spin_lock(&gl->gl_lockref.lock);
 			gl->gl_object = NULL;
 			spin_unlock(&gl->gl_lockref.lock);
+			gfs2_rgrp_brelse(rgd);
 			gfs2_glock_add_to_lru(gl);
 			gfs2_glock_put(gl);
 		}
@@ -1139,7 +1140,7 @@ static u32 count_unlinked(struct gfs2_rg
  * @rgd: the struct gfs2_rgrpd describing the RG to read in
  *
  * Read in all of a Resource Group's header and bitmap blocks.
- * Caller must eventually call gfs2_rgrp_relse() to free the bitmaps.
+ * Caller must eventually call gfs2_rgrp_brelse() to free the bitmaps.
  *
  * Returns: errno
  */
diff -druNp --no-dereference linux-libre-4.4.164-gnu/fs/hfs/brec.c linux-libre-4.4.165-gnu/fs/hfs/brec.c
--- linux-libre-4.4.164-gnu/fs/hfs/brec.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/fs/hfs/brec.c	2018-11-27 10:08:03.000000000 -0500
@@ -424,6 +424,10 @@ skip:
 	if (new_node) {
 		__be32 cnid;
 
+		if (!new_node->parent) {
+			hfs_btree_inc_height(tree);
+			new_node->parent = tree->root;
+		}
 		fd->bnode = hfs_bnode_find(tree, new_node->parent);
 		/* create index key and entry */
 		hfs_bnode_read_key(new_node, fd->search_key, 14);
diff -druNp --no-dereference linux-libre-4.4.164-gnu/fs/hfsplus/brec.c linux-libre-4.4.165-gnu/fs/hfsplus/brec.c
--- linux-libre-4.4.164-gnu/fs/hfsplus/brec.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/fs/hfsplus/brec.c	2018-11-27 10:08:03.000000000 -0500
@@ -427,6 +427,10 @@ skip:
 	if (new_node) {
 		__be32 cnid;
 
+		if (!new_node->parent) {
+			hfs_btree_inc_height(tree);
+			new_node->parent = tree->root;
+		}
 		fd->bnode = hfs_bnode_find(tree, new_node->parent);
 		/* create index key and entry */
 		hfs_bnode_read_key(new_node, fd->search_key, 14);
diff -druNp --no-dereference linux-libre-4.4.164-gnu/fs/reiserfs/xattr.c linux-libre-4.4.165-gnu/fs/reiserfs/xattr.c
--- linux-libre-4.4.164-gnu/fs/reiserfs/xattr.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/fs/reiserfs/xattr.c	2018-11-27 10:08:03.000000000 -0500
@@ -184,6 +184,7 @@ struct reiserfs_dentry_buf {
 	struct dir_context ctx;
 	struct dentry *xadir;
 	int count;
+	int err;
 	struct dentry *dentries[8];
 };
 
@@ -206,6 +207,7 @@ fill_with_dentries(struct dir_context *c
 
 	dentry = lookup_one_len(name, dbuf->xadir, namelen);
 	if (IS_ERR(dentry)) {
+		dbuf->err = PTR_ERR(dentry);
 		return PTR_ERR(dentry);
 	} else if (d_really_is_negative(dentry)) {
 		/* A directory entry exists, but no file? */
@@ -214,6 +216,7 @@ fill_with_dentries(struct dir_context *c
 			       "not found for file %pd.\n",
 			       dentry, dbuf->xadir);
 		dput(dentry);
+		dbuf->err = -EIO;
 		return -EIO;
 	}
 
@@ -261,6 +264,10 @@ static int reiserfs_for_each_xattr(struc
 		err = reiserfs_readdir_inode(d_inode(dir), &buf.ctx);
 		if (err)
 			break;
+		if (buf.err) {
+			err = buf.err;
+			break;
+		}
 		if (!buf.count)
 			break;
 		for (i = 0; !err && i < buf.count && buf.dentries[i]; i++) {
diff -druNp --no-dereference linux-libre-4.4.164-gnu/.gitignore linux-libre-4.4.165-gnu/.gitignore
--- linux-libre-4.4.164-gnu/.gitignore	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/.gitignore	2018-11-27 10:08:03.000000000 -0500
@@ -33,6 +33,7 @@
 *.lzo
 *.patch
 *.gcno
+*.ll
 modules.builtin
 Module.symvers
 *.dwo
diff -druNp --no-dereference linux-libre-4.4.164-gnu/include/linux/kbuild.h linux-libre-4.4.165-gnu/include/linux/kbuild.h
--- linux-libre-4.4.164-gnu/include/linux/kbuild.h	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/include/linux/kbuild.h	2018-11-27 10:08:03.000000000 -0500
@@ -2,14 +2,14 @@
 #define __LINUX_KBUILD_H
 
 #define DEFINE(sym, val) \
-        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+	asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
 
-#define BLANK() asm volatile("\n->" : : )
+#define BLANK() asm volatile("\n.ascii \"->\"" : : )
 
 #define OFFSET(sym, str, mem) \
 	DEFINE(sym, offsetof(struct str, mem))
 
 #define COMMENT(x) \
-	asm volatile("\n->#" x)
+	asm volatile("\n.ascii \"->#" x "\"")
 
 #endif
diff -druNp --no-dereference linux-libre-4.4.164-gnu/include/linux/module.h linux-libre-4.4.165-gnu/include/linux/module.h
--- linux-libre-4.4.164-gnu/include/linux/module.h	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/include/linux/module.h	2018-11-27 10:08:03.000000000 -0500
@@ -125,13 +125,13 @@ extern void cleanup_module(void);
 
 /* Each module must use one module_init(). */
 #define module_init(initfn)					\
-	static inline initcall_t __inittest(void)		\
+	static inline initcall_t __maybe_unused __inittest(void)		\
 	{ return initfn; }					\
 	int init_module(void) __attribute__((alias(#initfn)));
 
 /* This is only required if you want to be unloadable. */
 #define module_exit(exitfn)					\
-	static inline exitcall_t __exittest(void)		\
+	static inline exitcall_t __maybe_unused __exittest(void)		\
 	{ return exitfn; }					\
 	void cleanup_module(void) __attribute__((alias(#exitfn)));
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/include/linux/netfilter/ipset/ip_set_comment.h linux-libre-4.4.165-gnu/include/linux/netfilter/ipset/ip_set_comment.h
--- linux-libre-4.4.164-gnu/include/linux/netfilter/ipset/ip_set_comment.h	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/include/linux/netfilter/ipset/ip_set_comment.h	2018-11-27 10:08:03.000000000 -0500
@@ -41,11 +41,11 @@ ip_set_init_comment(struct ip_set_commen
 	rcu_assign_pointer(comment->c, c);
 }
 
-/* Used only when dumping a set, protected by rcu_read_lock_bh() */
+/* Used only when dumping a set, protected by rcu_read_lock() */
 static inline int
 ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment)
 {
-	struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c);
+	struct ip_set_comment_rcu *c = rcu_dereference(comment->c);
 
 	if (!c)
 		return 0;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/include/linux/uaccess.h linux-libre-4.4.165-gnu/include/linux/uaccess.h
--- linux-libre-4.4.164-gnu/include/linux/uaccess.h	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/include/linux/uaccess.h	2018-11-27 10:08:03.000000000 -0500
@@ -2,6 +2,9 @@
 #define __LINUX_UACCESS_H__
 
 #include <linux/sched.h>
+
+#define uaccess_kernel() segment_eq(get_fs(), KERNEL_DS)
+
 #include <asm/uaccess.h>
 
 static __always_inline void pagefault_disabled_inc(void)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/Kbuild linux-libre-4.4.165-gnu/Kbuild
--- linux-libre-4.4.164-gnu/Kbuild	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/Kbuild	2018-11-27 10:08:03.000000000 -0500
@@ -6,31 +6,6 @@
 # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
 # 4) Check for missing system calls
 
-# Default sed regexp - multiline due to syntax constraints
-define sed-y
-	"/^->/{s:->#\(.*\):/* \1 */:; \
-	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
-	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-	s:->::; p;}"
-endef
-
-# Use filechk to avoid rebuilds when a header changes, but the resulting file
-# does not
-define filechk_offsets
-	(set -e; \
-	 echo "#ifndef $2"; \
-	 echo "#define $2"; \
-	 echo "/*"; \
-	 echo " * DO NOT MODIFY."; \
-	 echo " *"; \
-	 echo " * This file was generated by Kbuild"; \
-	 echo " */"; \
-	 echo ""; \
-	 sed -ne $(sed-y); \
-	 echo ""; \
-	 echo "#endif" )
-endef
-
 #####
 # 1) Generate bounds.h
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/lib/raid6/test/Makefile linux-libre-4.4.165-gnu/lib/raid6/test/Makefile
--- linux-libre-4.4.164-gnu/lib/raid6/test/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/lib/raid6/test/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -26,7 +26,7 @@ ifeq ($(ARCH),arm)
         CFLAGS += -I../../../arch/arm/include -mfpu=neon
         HAS_NEON = yes
 endif
-ifeq ($(ARCH),arm64)
+ifeq ($(ARCH),aarch64)
         CFLAGS += -I../../../arch/arm64/include
         HAS_NEON = yes
 endif
@@ -37,7 +37,7 @@ ifeq ($(IS_X86),yes)
                     gcc -c -x assembler - >&/dev/null &&	\
                     rm ./-.o && echo -DCONFIG_AS_AVX2=1)
 else ifeq ($(HAS_NEON),yes)
-        OBJS   += neon.o neon1.o neon2.o neon4.o neon8.o
+        OBJS   += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
         CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1
 else
         HAS_ALTIVEC := $(shell printf '\#include <altivec.h>\nvector int a;\n' |\
diff -druNp --no-dereference linux-libre-4.4.164-gnu/Makefile linux-libre-4.4.165-gnu/Makefile
--- linux-libre-4.4.164-gnu/Makefile	2018-11-21 13:00:26.000000000 -0500
+++ linux-libre-4.4.165-gnu/Makefile	2018-11-27 14:19:15.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 4
-SUBLEVEL = 164
+SUBLEVEL = 165
 EXTRAVERSION = -gnu
 NAME = Blurry Fish Butt
 
@@ -303,14 +303,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH"
 
 HOSTCC       = gcc
 HOSTCXX      = g++
-HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
+HOSTCFLAGS   := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
 HOSTCXXFLAGS = -O2
 
-ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
-HOSTCFLAGS  += -Wno-unused-value -Wno-unused-parameter \
-		-Wno-missing-field-initializers -fno-delete-null-pointer-checks
-endif
-
 # Decide whether to build built-in, modular, or both.
 # Normally, just do built-in.
 
@@ -612,6 +607,22 @@ endif # $(dot-config)
 # Defaults to vmlinux, but the arch makefile usually adds further targets
 all: vmlinux
 
+ifeq ($(cc-name),clang)
+ifneq ($(CROSS_COMPILE),)
+CLANG_TARGET	:= --target=$(notdir $(CROSS_COMPILE:%-=%))
+GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+CLANG_PREFIX	:= --prefix=$(GCC_TOOLCHAIN_DIR)
+GCC_TOOLCHAIN	:= $(realpath $(GCC_TOOLCHAIN_DIR)/..)
+endif
+ifneq ($(GCC_TOOLCHAIN),)
+CLANG_GCC_TC	:= --gcc-toolchain=$(GCC_TOOLCHAIN)
+endif
+KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
+endif
+
 # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
 # values of the respective KBUILD_* variables
 ARCH_CPPFLAGS :=
@@ -628,7 +639,7 @@ KBUILD_CFLAGS	+= $(call cc-disable-warni
 KBUILD_CFLAGS	+= $(call cc-disable-warning, attribute-alias)
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS	+= -Os
+KBUILD_CFLAGS	+= $(call cc-option,-Oz,-Os)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS	+= -O2
@@ -699,10 +710,9 @@ KBUILD_CFLAGS += $(stackp-flag)
 
 ifeq ($(cc-name),clang)
 KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
-KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
-KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
 KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
+KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
 # Quiet clang warning: comparison of unsigned expression < 0 is always false
 KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
 # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
@@ -713,11 +723,11 @@ KBUILD_CFLAGS += $(call cc-option, -fcat
 else
 
 # These warnings generated too much noise in a regular build.
-# Use make W=1 to enable them (see scripts/Makefile.build)
+# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
 KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
-KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
 endif
 
+KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
 else
@@ -1297,6 +1307,8 @@ help:
 	@echo  '                    (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
 	@echo  '  dir/            - Build all files in dir and below'
 	@echo  '  dir/file.[ois]  - Build specified target only'
+	@echo  '  dir/file.ll     - Build the LLVM assembly file'
+	@echo  '                    (requires compiler support for LLVM assembly generation)'
 	@echo  '  dir/file.lst    - Build specified mixed source/assembly target only'
 	@echo  '                    (requires a recent binutils and recent build (System.map))'
 	@echo  '  dir/file.ko     - Build module including final link'
@@ -1472,6 +1484,7 @@ clean: $(clean-dirs)
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
 		-o -name '*.symtypes' -o -name 'modules.order' \
 		-o -name modules.builtin -o -name '.tmp_*.o.*' \
+		-o -name '*.ll' \
 		-o -name '*.gcno' \) -type f -print | xargs rm -f
 
 # Generate tags for editors
@@ -1575,6 +1588,8 @@ endif
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 %.symtypes: %.c prepare scripts FORCE
 	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.ll: %.c prepare scripts FORCE
+	$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
 # Modules
 /: prepare scripts FORCE
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/core/dev.c linux-libre-4.4.165-gnu/net/core/dev.c
--- linux-libre-4.4.164-gnu/net/core/dev.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/core/dev.c	2018-11-27 10:08:03.000000000 -0500
@@ -4481,6 +4481,10 @@ static void napi_reuse_skb(struct napi_s
 	skb->vlan_tci = 0;
 	skb->dev = napi->dev;
 	skb->skb_iif = 0;
+
+	/* eth_type_trans() assumes pkt_type is PACKET_HOST */
+	skb->pkt_type = PACKET_HOST;
+
 	skb->encapsulation = 0;
 	skb_shinfo(skb)->gso_type = 0;
 	skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/core/flow_dissector.c linux-libre-4.4.165-gnu/net/core/flow_dissector.c
--- linux-libre-4.4.164-gnu/net/core/flow_dissector.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/core/flow_dissector.c	2018-11-27 10:08:03.000000000 -0500
@@ -480,8 +480,8 @@ ip_proto_again:
 		break;
 	}
 
-	if (dissector_uses_key(flow_dissector,
-			       FLOW_DISSECTOR_KEY_PORTS)) {
+	if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_PORTS) &&
+	    !(key_control->flags & FLOW_DIS_IS_FRAGMENT)) {
 		key_ports = skb_flow_dissector_target(flow_dissector,
 						      FLOW_DISSECTOR_KEY_PORTS,
 						      target_container);
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/ipv4/ip_tunnel_core.c linux-libre-4.4.165-gnu/net/ipv4/ip_tunnel_core.c
--- linux-libre-4.4.164-gnu/net/ipv4/ip_tunnel_core.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/ipv4/ip_tunnel_core.c	2018-11-27 10:08:03.000000000 -0500
@@ -71,7 +71,7 @@ int iptunnel_xmit(struct sock *sk, struc
 
 	iph->version	=	4;
 	iph->ihl	=	sizeof(struct iphdr) >> 2;
-	iph->frag_off	=	df;
+	iph->frag_off	=	ip_mtu_locked(&rt->dst) ? 0 : df;
 	iph->protocol	=	proto;
 	iph->tos	=	tos;
 	iph->daddr	=	dst;
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/ipv6/route.c linux-libre-4.4.165-gnu/net/ipv6/route.c
--- linux-libre-4.4.164-gnu/net/ipv6/route.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/ipv6/route.c	2018-11-27 10:08:03.000000000 -0500
@@ -1420,8 +1420,12 @@ EXPORT_SYMBOL_GPL(ip6_update_pmtu);
 
 void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu)
 {
-	ip6_update_pmtu(skb, sock_net(sk), mtu,
-			sk->sk_bound_dev_if, sk->sk_mark);
+	int oif = sk->sk_bound_dev_if;
+
+	if (!oif && skb->dev)
+		oif = l3mdev_master_ifindex(skb->dev);
+
+	ip6_update_pmtu(skb, sock_net(sk), mtu, oif, sk->sk_mark);
 }
 EXPORT_SYMBOL_GPL(ip6_sk_update_pmtu);
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/netfilter/ipset/ip_set_hash_netportnet.c linux-libre-4.4.165-gnu/net/netfilter/ipset/ip_set_hash_netportnet.c
--- linux-libre-4.4.164-gnu/net/netfilter/ipset/ip_set_hash_netportnet.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/netfilter/ipset/ip_set_hash_netportnet.c	2018-11-27 10:08:03.000000000 -0500
@@ -213,13 +213,13 @@ hash_netportnet4_uadt(struct ip_set *set
 
 	if (tb[IPSET_ATTR_CIDR]) {
 		e.cidr[0] = nla_get_u8(tb[IPSET_ATTR_CIDR]);
-		if (!e.cidr[0] || e.cidr[0] > HOST_MASK)
+		if (e.cidr[0] > HOST_MASK)
 			return -IPSET_ERR_INVALID_CIDR;
 	}
 
 	if (tb[IPSET_ATTR_CIDR2]) {
 		e.cidr[1] = nla_get_u8(tb[IPSET_ATTR_CIDR2]);
-		if (!e.cidr[1] || e.cidr[1] > HOST_MASK)
+		if (e.cidr[1] > HOST_MASK)
 			return -IPSET_ERR_INVALID_CIDR;
 	}
 
@@ -492,13 +492,13 @@ hash_netportnet6_uadt(struct ip_set *set
 
 	if (tb[IPSET_ATTR_CIDR]) {
 		e.cidr[0] = nla_get_u8(tb[IPSET_ATTR_CIDR]);
-		if (!e.cidr[0] || e.cidr[0] > HOST_MASK)
+		if (e.cidr[0] > HOST_MASK)
 			return -IPSET_ERR_INVALID_CIDR;
 	}
 
 	if (tb[IPSET_ATTR_CIDR2]) {
 		e.cidr[1] = nla_get_u8(tb[IPSET_ATTR_CIDR2]);
-		if (!e.cidr[1] || e.cidr[1] > HOST_MASK)
+		if (e.cidr[1] > HOST_MASK)
 			return -IPSET_ERR_INVALID_CIDR;
 	}
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/netfilter/xt_IDLETIMER.c linux-libre-4.4.165-gnu/net/netfilter/xt_IDLETIMER.c
--- linux-libre-4.4.164-gnu/net/netfilter/xt_IDLETIMER.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/netfilter/xt_IDLETIMER.c	2018-11-27 10:08:03.000000000 -0500
@@ -116,6 +116,22 @@ static void idletimer_tg_expired(unsigne
 	schedule_work(&timer->work);
 }
 
+static int idletimer_check_sysfs_name(const char *name, unsigned int size)
+{
+	int ret;
+
+	ret = xt_check_proc_name(name, size);
+	if (ret < 0)
+		return ret;
+
+	if (!strcmp(name, "power") ||
+	    !strcmp(name, "subsystem") ||
+	    !strcmp(name, "uevent"))
+		return -EINVAL;
+
+	return 0;
+}
+
 static int idletimer_tg_create(struct idletimer_tg_info *info)
 {
 	int ret;
@@ -126,6 +142,10 @@ static int idletimer_tg_create(struct id
 		goto out;
 	}
 
+	ret = idletimer_check_sysfs_name(info->label, sizeof(info->label));
+	if (ret < 0)
+		goto out_free_timer;
+
 	sysfs_attr_init(&info->timer->attr.attr);
 	info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL);
 	if (!info->timer->attr.attr.name) {
diff -druNp --no-dereference linux-libre-4.4.164-gnu/net/sunrpc/xdr.c linux-libre-4.4.165-gnu/net/sunrpc/xdr.c
--- linux-libre-4.4.164-gnu/net/sunrpc/xdr.c	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/net/sunrpc/xdr.c	2018-11-27 10:08:03.000000000 -0500
@@ -512,7 +512,7 @@ EXPORT_SYMBOL_GPL(xdr_commit_encode);
 static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
 		size_t nbytes)
 {
-	static __be32 *p;
+	__be32 *p;
 	int space_left;
 	int frag1bytes, frag2bytes;
 
diff -druNp --no-dereference linux-libre-4.4.164-gnu/scripts/Kbuild.include linux-libre-4.4.165-gnu/scripts/Kbuild.include
--- linux-libre-4.4.164-gnu/scripts/Kbuild.include	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/scripts/Kbuild.include	2018-11-27 10:08:03.000000000 -0500
@@ -108,16 +108,21 @@ as-option = $(call try-run,\
 as-instr = $(call try-run,\
 	printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
 
+# __cc-option
+# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586)
+__cc-option = $(call try-run,\
+	$(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4))
+
 # cc-option
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
 
-cc-option = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+cc-option = $(call __cc-option, $(CC),\
+	$(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2))
 
 # cc-option-yn
 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
 cc-option-yn = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
 
 # cc-option-align
 # Prefix align with either -falign or -malign
@@ -127,7 +132,7 @@ cc-option-align = $(subst -functions=0,,
 # cc-disable-warning
 # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
 cc-disable-warning = $(call try-run,\
-	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
+	$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
 
 # cc-name
 # Expands to either gcc or clang
@@ -147,12 +152,13 @@ cc-ifversion = $(shell [ $(cc-version) $
 # cc-ldoption
 # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
 cc-ldoption = $(call try-run,\
-	$(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
+	$(CC) $(1) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
 
 # ld-option
 # Usage: LDFLAGS += $(call ld-option, -X)
 ld-option = $(call try-run,\
-	$(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
+	$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -x c /dev/null -c -o "$$TMPO"; \
+	$(LD) $(LDFLAGS) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
 
 # ar-option
 # Usage: KBUILD_ARFLAGS := $(call ar-option,D)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/scripts/Makefile.build linux-libre-4.4.165-gnu/scripts/Makefile.build
--- linux-libre-4.4.164-gnu/scripts/Makefile.build	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/scripts/Makefile.build	2018-11-27 10:08:03.000000000 -0500
@@ -175,6 +175,14 @@ cmd_cc_symtypes_c =
 $(obj)/%.symtypes : $(src)/%.c FORCE
 	$(call cmd,cc_symtypes_c)
 
+# LLVM assembly
+# Generate .ll files from .c
+quiet_cmd_cc_ll_c = CC $(quiet_modtag)  $@
+      cmd_cc_ll_c = $(CC) $(c_flags) -emit-llvm -S -o $@ $<
+
+$(obj)/%.ll: $(src)/%.c FORCE
+	$(call if_changed_dep,cc_ll_c)
+
 # C (.c) files
 # The C file is compiled and updated dependency information is generated.
 # (See cmd_cc_o_c + relevant part of rule_cc_o_c)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/scripts/Makefile.extrawarn linux-libre-4.4.165-gnu/scripts/Makefile.extrawarn
--- linux-libre-4.4.164-gnu/scripts/Makefile.extrawarn	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/scripts/Makefile.extrawarn	2018-11-27 10:08:03.000000000 -0500
@@ -61,7 +61,6 @@ ifeq ($(cc-name),clang)
 KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
 KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
 KBUILD_CFLAGS += $(call cc-disable-warning, format)
-KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option)
 KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
 KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
diff -druNp --no-dereference linux-libre-4.4.164-gnu/scripts/Makefile.lib linux-libre-4.4.165-gnu/scripts/Makefile.lib
--- linux-libre-4.4.164-gnu/scripts/Makefile.lib	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/scripts/Makefile.lib	2018-11-27 10:08:03.000000000 -0500
@@ -388,3 +388,34 @@ quiet_cmd_xzmisc = XZMISC  $@
 cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
 	xz --check=crc32 --lzma2=dict=1MiB) > $@ || \
 	(rm -f $@ ; false)
+
+# ASM offsets
+# ---------------------------------------------------------------------------
+
+# Default sed regexp - multiline due to syntax constraints
+#
+# Use [:space:] because LLVM's integrated assembler inserts <tab> around
+# the .ascii directive whereas GCC keeps the <space> as-is.
+define sed-offsets
+	's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; \
+	/^->/{s:->#\(.*\):/* \1 */:; \
+	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
+	s:->::; p;}'
+endef
+
+# Use filechk to avoid rebuilds when a header changes, but the resulting file
+# does not
+define filechk_offsets
+	(set -e; \
+	 echo "#ifndef $2"; \
+	 echo "#define $2"; \
+	 echo "/*"; \
+	 echo " * DO NOT MODIFY."; \
+	 echo " *"; \
+	 echo " * This file was generated by Kbuild"; \
+	 echo " */"; \
+	 echo ""; \
+	 sed -ne $(sed-offsets); \
+	 echo ""; \
+	 echo "#endif" )
+endef
diff -druNp --no-dereference linux-libre-4.4.164-gnu/scripts/mod/Makefile linux-libre-4.4.165-gnu/scripts/mod/Makefile
--- linux-libre-4.4.164-gnu/scripts/mod/Makefile	2018-11-21 03:27:45.000000000 -0500
+++ linux-libre-4.4.165-gnu/scripts/mod/Makefile	2018-11-27 10:08:03.000000000 -0500
@@ -5,32 +5,8 @@ modpost-objs	:= modpost.o file2alias.o s
 
 devicetable-offsets-file := devicetable-offsets.h
 
-define sed-y
-	"/^->/{s:->#\(.*\):/* \1 */:; \
-	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
-	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-	s:->::; p;}"
-endef
-
-quiet_cmd_offsets = GEN     $@
-define cmd_offsets
-	(set -e; \
-	 echo "#ifndef __DEVICETABLE_OFFSETS_H__"; \
-	 echo "#define __DEVICETABLE_OFFSETS_H__"; \
-	 echo "/*"; \
-	 echo " * DO NOT MODIFY."; \
-	 echo " *"; \
-	 echo " * This file was generated by Kbuild"; \
-	 echo " *"; \
-	 echo " */"; \
-	 echo ""; \
-	 sed -ne $(sed-y) $<; \
-	 echo ""; \
-	 echo "#endif" ) > $@
-endef
-
-$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s
-	$(call if_changed,offsets)
+$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE
+	$(call filechk,offsets,__DEVICETABLE_OFFSETS_H__)
 
 targets += $(devicetable-offsets-file) devicetable-offsets.s
 
