Skip to contentSkip to conversation

Linux 4.4.34

PATCH In review Greg KH 6 participants 21 messages Nov 21, 2016 – Nov 22, 2016

Subsystems (3)
lore
Share & tools
lore

Greg KH

author maintainer
#0 lore raw

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h

------------

 Makefile                              |    2 
 arch/sparc/include/asm/mmu_64.h       |    3 
 arch/sparc/include/asm/uaccess_64.h   |   66 ------
 arch/sparc/kernel/dtlb_prot.S         |    4 
 arch/sparc/kernel/head_64.S           |   36 ---
 arch/sparc/kernel/jump_label.c        |   23 +-
 arch/sparc/kernel/ktlb.S              |   12 +
 arch/sparc/kernel/sparc_ksyms_64.c    |    1 
 arch/sparc/kernel/tsb.S               |   12 -
 arch/sparc/lib/GENcopy_from_user.S    |    4 
 arch/sparc/lib/GENcopy_to_user.S      |    4 
 arch/sparc/lib/GENmemcpy.S            |   48 +++-
 arch/sparc/lib/Makefile               |    2 
 arch/sparc/lib/NG2copy_from_user.S    |    8 
 arch/sparc/lib/NG2copy_to_user.S      |    8 
 arch/sparc/lib/NG2memcpy.S            |  228 +++++++++++++-------
 arch/sparc/lib/NG4copy_from_user.S    |    8 
 arch/sparc/lib/NG4copy_to_user.S      |    8 
 arch/sparc/lib/NG4memcpy.S            |  294 ++++++++++++++++++++------
 arch/sparc/lib/NGcopy_from_user.S     |    4 
 arch/sparc/lib/NGcopy_to_user.S       |    4 
 arch/sparc/lib/NGmemcpy.S             |  233 ++++++++++++++-------
 arch/sparc/lib/U1copy_from_user.S     |    8 
 arch/sparc/lib/U1copy_to_user.S       |    8 
 arch/sparc/lib/U1memcpy.S             |  345 ++++++++++++++++++++-----------
 arch/sparc/lib/U3copy_from_user.S     |    8 
 arch/sparc/lib/U3copy_to_user.S       |    8 
 arch/sparc/lib/U3memcpy.S             |  227 ++++++++++++++------
 arch/sparc/lib/copy_in_user.S         |   35 ++-
 arch/sparc/lib/user_fixup.c           |   71 ------
 arch/sparc/mm/fault_64.c              |    6 
 arch/sparc/mm/hugetlbpage.c           |    4 
 arch/sparc/mm/init_64.c               |    3 
 arch/sparc/mm/tlb.c                   |    4 
 arch/sparc/mm/tsb.c                   |   31 ++
 arch/sparc/mm/ultra.S                 |  374 +++++++++++++++++++++++++++-------
 drivers/net/ethernet/broadcom/bgmac.c |    5 
 drivers/tty/serial/sunhv.c            |    6 
 drivers/tty/tty_ldisc.c               |    7 
 include/linux/filter.h                |    6 
 include/net/ip6_tunnel.h              |    1 
 include/net/tcp.h                     |    1 
 net/core/dev.c                        |    2 
 net/core/filter.c                     |   10 
 net/core/flow_dissector.c             |   11 -
 net/core/sock.c                       |    1 
 net/dccp/ipv4.c                       |   14 -
 net/dccp/ipv6.c                       |   16 -
 net/dccp/proto.c                      |    4 
 net/ipv4/fib_trie.c                   |   21 -
 net/ipv4/route.c                      |    4 
 net/ipv4/tcp.c                        |    2 
 net/ipv4/tcp_dctcp.c                  |   13 +
 net/ipv4/tcp_ipv4.c                   |   19 +
 net/ipv6/tcp_ipv6.c                   |    6 
 net/sctp/socket.c                     |    7 
 net/socket.c                          |    2 
 57 files changed, 1499 insertions(+), 803 deletions(-)

Alexander Duyck (1):
fib_trie: Correct /proc/net/route off by one error

Andy Gospodarek (1):
bgmac: stop clearing DMA receive control register right after it is set

Dan Carpenter (1):
sparc: serial: sunhv: fix a double lock bug

David S. Miller (17):
sparc: Don't leak context bits into thread->fault_address
sparc64: Handle extremely large kernel TSB range flushes sanely.
sparc64: Fix illegal relative branches in hypervisor patched TLB code.
sparc64: Fix instruction count in comment for __hypervisor_flush_tlb_pending.
sparc64: Fix illegal relative branches in hypervisor patched TLB cross-call code.
sparc64: Handle extremely large kernel TLB range flushes more gracefully.
sparc64: Delete __ret_efault.
sparc64: Prepare to move to more saner user copy exception handling.
sparc64: Convert copy_in_user to accurate exception reporting.
sparc64: Convert GENcopy_{from,to}_user to accurate exception reporting.
sparc64: Convert U1copy_{from,to}_user to accurate exception reporting.
sparc64: Convert NG4copy_{from,to}_user to accurate exception reporting.
sparc64: Convert NGcopy_{from,to}_user to accurate exception reporting.
sparc64: Convert NG2copy_{from,to}_user to accurate exception reporting.
sparc64: Convert U3copy_{from,to}_user to accurate exception reporting.
sparc64: Delete now unused user copy assembler helpers.
sparc64: Delete now unused user copy fixup functions.

Eli Cooper (1):
ip6_tunnel: Clear IP6CB in ip6tunnel_xmit()

Eric Dumazet (9):
net: clear sk_err_soft in sk_clone_lock()
net: mangle zero checksum in skb_checksum_help()
tcp: fix potential memory corruption
dccp: do not send reset to already closed sockets
dccp: fix out of bound access in dccp_v4_err()
ipv6: dccp: fix out of bound access in dccp_v6_err()
ipv6: dccp: add missing bind_conflict to dccp_ipv6_mapped
net: __skb_flow_dissect() must cap its return value
tcp: take care of truncations done by sk_filter()

Florian Westphal (1):
dctcp: avoid bogus doubling of cwnd after loss

Greg Kroah-Hartman (1):

      Linux 4.4.34

James Clarke (1):
sparc: Handle negative offsets in arch_jump_label_transform

Marcelo Ricardo Leitner (1):
sctp: assign assoc_id earlier in __sctp_connect

Mike Kravetz (1):
sparc64 mm: Fix base TSB sizing when hugetlb pages are used

Peter Hurley (1):
tty: Prevent ldisc drivers from re-using stale tty fields

Soheil Hassas Yeganeh (1):
sock: fix sendmmsg for partial sendmsg

Stephen Suryaputra Lin (1):
ipv4: use new_gw for redirect neigh lookup

author maintainer
#1 lore raw
Makefile +1 -1
index a513c045c8de..30924aabf1b4 100644
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 4
-SUBLEVEL = 33
+SUBLEVEL = 34
 EXTRAVERSION =
 NAME = Blurry Fish Butt
 
arch/sparc/include/asm/mmu_64.h +2 -1
index 70067ce184b1..f7de0dbc38af 100644
@@ -92,7 +92,8 @@ struct tsb_config {
 typedef struct {
 	spinlock_t		lock;
 	unsigned long		sparc64_ctx_val;
-	unsigned long		huge_pte_count;
+	unsigned long		hugetlb_pte_count;
+	unsigned long		thp_pte_count;
 	struct tsb_config	tsb_block[MM_NUM_TSBS];
 	struct hv_tsb_descr	tsb_descr[MM_NUM_TSBS];
 } mm_context_t;
arch/sparc/include/asm/uaccess_64.h +3 -63

110 lines not on this page · raw message

arch/sparc/kernel/dtlb_prot.S +2 -2
index d668ca149e64..4087a62f96b0 100644
@@ -25,13 +25,13 @@
 
 /* PROT ** ICACHE line 2: More real fault processing */
 	ldxa		[%g4] ASI_DMMU, %g5		! Put tagaccess in %g5
+	srlx		%g5, PAGE_SHIFT, %g5
+	sllx		%g5, PAGE_SHIFT, %g5		! Clear context ID bits
 	bgu,pn		%xcc, winfix_trampoline		! Yes, perform winfixup
 	 mov		FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4
 	ba,pt		%xcc, sparc64_realfault_common	! Nope, normal fault
 	 nop
 	nop
-	nop
-	nop
 
 /* PROT ** ICACHE line 3: Unused...	*/
 	nop
arch/sparc/kernel/head_64.S +0 -36
index 51faf92ace00..7eeeb1d5a410 100644
@@ -922,47 +922,11 @@ prom_tba:	.xword	0
 tlb_type:	.word	0	/* Must NOT end up in BSS */
 	.section	".fixup",#alloc,#execinstr
 
-	.globl	__ret_efault, __retl_efault, __ret_one, __retl_one
-ENTRY(__ret_efault)
-	ret
-	 restore %g0, -EFAULT, %o0
-ENDPROC(__ret_efault)
-
 ENTRY(__retl_efault)
 	retl
 	 mov	-EFAULT, %o0
 ENDPROC(__retl_efault)
 
-ENTRY(__retl_one)
-	retl
-	 mov	1, %o0
-ENDPROC(__retl_one)
-
-ENTRY(__retl_one_fp)
-	VISExitHalf
-	retl
-	 mov	1, %o0
-ENDPROC(__retl_one_fp)
-
-ENTRY(__ret_one_asi)
-	wr	%g0, ASI_AIUS, %asi
-	ret
-	 restore %g0, 1, %o0
-ENDPROC(__ret_one_asi)
-
-ENTRY(__retl_one_asi)
-	wr	%g0, ASI_AIUS, %asi
-	retl
-	 mov	1, %o0
-ENDPROC(__retl_one_asi)
-
-ENTRY(__retl_one_asi_fp)
-	wr	%g0, ASI_AIUS, %asi
-	VISExitHalf
-	retl
-	 mov	1, %o0
-ENDPROC(__retl_one_asi_fp)
-
 ENTRY(__retl_o1)
 	retl
 	 mov	%o1, %o0
arch/sparc/kernel/jump_label.c +17 -6
index 59bbeff55024..07933b9e9ce0 100644
@@ -13,19 +13,30 @@
 void arch_jump_label_transform(struct jump_entry *entry,
 			       enum jump_label_type type)
 {
-	u32 val;
 	u32 *insn = (u32 *) (unsigned long) entry->code;
+	u32 val;
 
 	if (type == JUMP_LABEL_JMP) {
 		s32 off = (s32)entry->target - (s32)entry->code;
+		bool use_v9_branch = false;
+
+		BUG_ON(off & 3);
 
 #ifdef CONFIG_SPARC64
-		/* ba,pt %xcc, . + (off << 2) */
-		val = 0x10680000 | ((u32) off >> 2);
-#else
-		/* ba . + (off << 2) */
-		val = 0x10800000 | ((u32) off >> 2);
+		if (off <= 0xfffff && off >= -0x100000)
+			use_v9_branch = true;
 #endif
+		if (use_v9_branch) {
+			/* WDISP19 - target is . + immed << 2 */
+			/* ba,pt %xcc, . + off */
+			val = 0x10680000 | (((u32) off >> 2) & 0x7ffff);
+		} else {
+			/* WDISP22 - target is . + immed << 2 */
+			BUG_ON(off > 0x7fffff);
+			BUG_ON(off < -0x800000);
+			/* ba . + off */
+			val = 0x10800000 | (((u32) off >> 2) & 0x3fffff);
+		}
 	} else {
 		val = 0x01000000;
 	}
arch/sparc/kernel/ktlb.S +12 -0
index ef0d8e9e1210..f22bec0db645 100644
@@ -20,6 +20,10 @@ kvmap_itlb:
 	mov		TLB_TAG_ACCESS, %g4
 	ldxa		[%g4] ASI_IMMU, %g4
 
+	/* The kernel executes in context zero, therefore we do not
+	 * need to clear the context ID bits out of %g4 here.
+	 */
+
 	/* sun4v_itlb_miss branches here with the missing virtual
 	 * address already loaded into %g4
 	 */
@@ -128,6 +132,10 @@ kvmap_dtlb:
 	mov		TLB_TAG_ACCESS, %g4
 	ldxa		[%g4] ASI_DMMU, %g4
 
+	/* The kernel executes in context zero, therefore we do not
+	 * need to clear the context ID bits out of %g4 here.
+	 */
+
 	/* sun4v_dtlb_miss branches here with the missing virtual
 	 * address already loaded into %g4
 	 */
@@ -251,6 +259,10 @@ kvmap_dtlb_longpath:
 	nop
 	.previous
 
+	/* The kernel executes in context zero, therefore we do not
+	 * need to clear the context ID bits out of %g5 here.
+	 */
+
 	be,pt	%xcc, sparc64_realfault_common
 	 mov	FAULT_CODE_DTLB, %g4
 	ba,pt	%xcc, winfix_trampoline
arch/sparc/kernel/sparc_ksyms_64.c +0 -1
index a92d5d2c46a3..51b25325a961 100644
@@ -27,7 +27,6 @@ EXPORT_SYMBOL(__flushw_user);
 EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
 
 /* from head_64.S */
-EXPORT_SYMBOL(__ret_efault);
 EXPORT_SYMBOL(tlb_type);
 EXPORT_SYMBOL(sun4v_chip_type);
 EXPORT_SYMBOL(prom_root_node);
arch/sparc/kernel/tsb.S +10 -2
index be98685c14c6..d568c8207af7 100644
@@ -29,13 +29,17 @@
 	 */
 tsb_miss_dtlb:
 	mov		TLB_TAG_ACCESS, %g4
+	ldxa		[%g4] ASI_DMMU, %g4
+	srlx		%g4, PAGE_SHIFT, %g4
 	ba,pt		%xcc, tsb_miss_page_table_walk
-	 ldxa		[%g4] ASI_DMMU, %g4
+	 sllx		%g4, PAGE_SHIFT, %g4
 
 tsb_miss_itlb:
 	mov		TLB_TAG_ACCESS, %g4
+	ldxa		[%g4] ASI_IMMU, %g4
+	srlx		%g4, PAGE_SHIFT, %g4
 	ba,pt		%xcc, tsb_miss_page_table_walk
-	 ldxa		[%g4] ASI_IMMU, %g4
+	 sllx		%g4, PAGE_SHIFT, %g4
 
 	/* At this point we have:
 	 * %g1 --	PAGE_SIZE TSB entry address
@@ -284,6 +288,10 @@ tsb_do_dtlb_fault:
 	nop
 	.previous
 
+	/* Clear context ID bits.  */
+	srlx		%g5, PAGE_SHIFT, %g5
+	sllx		%g5, PAGE_SHIFT, %g5
+
 	be,pt	%xcc, sparc64_realfault_common
 	 mov	FAULT_CODE_DTLB, %g4
 	ba,pt	%xcc, winfix_trampoline
arch/sparc/lib/GENcopy_from_user.S +2 -2
index b7d0bd6b1406..69a439fa2fc1 100644
@@ -3,11 +3,11 @@
  * Copyright (C) 2007 David S. Miller ([email protected])
  */
 
-#define EX_LD(x)		\
+#define EX_LD(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/GENcopy_to_user.S +2 -2
index 780550e1afc7..9947427ce354 100644
@@ -3,11 +3,11 @@
  * Copyright (C) 2007 David S. Miller ([email protected])
  */
 
-#define EX_ST(x)		\
+#define EX_ST(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/GENmemcpy.S +34 -14

93 lines not on this page · raw message

arch/sparc/lib/Makefile +1 -1
index 3269b0234093..4f2384a4286a 100644
@@ -38,7 +38,7 @@ lib-$(CONFIG_SPARC64) +=  NG4patch.o NG4copy_page.o NG4clear_page.o NG4memset.o
 lib-$(CONFIG_SPARC64) += GENmemcpy.o GENcopy_from_user.o GENcopy_to_user.o
 lib-$(CONFIG_SPARC64) += GENpatch.o GENpage.o GENbzero.o
 
-lib-$(CONFIG_SPARC64) += copy_in_user.o user_fixup.o memmove.o
+lib-$(CONFIG_SPARC64) += copy_in_user.o memmove.o
 lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o
 
 obj-$(CONFIG_SPARC64) += iomap.o
arch/sparc/lib/NG2copy_from_user.S +4 -4
index d5242b8c4f94..b79a6998d87c 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 2007 David S. Miller ([email protected])
  */
 
-#define EX_LD(x)		\
+#define EX_LD(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_LD_FP(x)		\
+#define EX_LD_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi_fp;\
+	.word 98b, y##_fp;	\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/NG2copy_to_user.S +4 -4
index 4e962d993b10..dcec55f254ab 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 2007 David S. Miller ([email protected])
  */
 
-#define EX_ST(x)		\
+#define EX_ST(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_ST_FP(x)		\
+#define EX_ST_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi_fp;\
+	.word 98b, y##_fp;	\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/NG2memcpy.S +145 -83

384 lines not on this page · raw message

arch/sparc/lib/NG4copy_from_user.S +4 -4
index 2e8ee7ad07a9..16a286c1a528 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 2012 David S. Miller ([email protected])
  */
 
-#define EX_LD(x)		\
+#define EX_LD(x, y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_LD_FP(x)		\
+#define EX_LD_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi_fp;\
+	.word 98b, y##_fp;	\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/NG4copy_to_user.S +4 -4
index be0bf4590df8..6b0276ffc858 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 2012 David S. Miller ([email protected])
  */
 
-#define EX_ST(x)		\
+#define EX_ST(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_ST_FP(x)		\
+#define EX_ST_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_asi_fp;\
+	.word 98b, y##_fp;	\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/NG4memcpy.S +223 -71

447 lines not on this page · raw message

arch/sparc/lib/NGcopy_from_user.S +2 -2
index 5d1e4d1ac21e..9cd42fcbc781 100644
@@ -3,11 +3,11 @@
  * Copyright (C) 2006, 2007 David S. Miller ([email protected])
  */
 
-#define EX_LD(x)		\
+#define EX_LD(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __ret_one_asi;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/NGcopy_to_user.S +2 -2
index ff630dcb273c..5c358afd464e 100644
@@ -3,11 +3,11 @@
  * Copyright (C) 2006, 2007 David S. Miller ([email protected])
  */
 
-#define EX_ST(x)		\
+#define EX_ST(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __ret_one_asi;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/NGmemcpy.S +158 -75

375 lines not on this page · raw message

arch/sparc/lib/U1copy_from_user.S +4 -4
index ecc5692fa2b4..bb6ff73229e3 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 1999, 2000, 2004 David S. Miller ([email protected])
  */
 
-#define EX_LD(x)		\
+#define EX_LD(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_LD_FP(x)		\
+#define EX_LD_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_fp;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/U1copy_to_user.S +4 -4
index 9eea392e44d4..ed92ce739558 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 1999, 2000, 2004 David S. Miller ([email protected])
  */
 
-#define EX_ST(x)		\
+#define EX_ST(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_ST_FP(x)		\
+#define EX_ST_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_fp;\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/U1memcpy.S +229 -116

561 lines not on this page · raw message

arch/sparc/lib/U3copy_from_user.S +4 -4
index 88ad73d86fe4..db73010a1af8 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 1999, 2000, 2004 David S. Miller ([email protected])
  */
 
-#define EX_LD(x)		\
+#define EX_LD(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_LD_FP(x)		\
+#define EX_LD_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_fp;\
+	.word 98b, y##_fp;	\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/U3copy_to_user.S +4 -4
index 845139d75537..c4ee858e352a 100644
@@ -3,19 +3,19 @@
  * Copyright (C) 1999, 2000, 2004 David S. Miller ([email protected])
  */
 
-#define EX_ST(x)		\
+#define EX_ST(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, y;		\
 	.text;			\
 	.align 4;
 
-#define EX_ST_FP(x)		\
+#define EX_ST_FP(x,y)		\
 98:	x;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one_fp;\
+	.word 98b, y##_fp;	\
 	.text;			\
 	.align 4;
 
arch/sparc/lib/U3memcpy.S +154 -73

411 lines not on this page · raw message

arch/sparc/lib/copy_in_user.S +25 -10
index 302c0e60dc2c..4c89b486fa0d 100644
@@ -8,18 +8,33 @@
 
 #define XCC xcc
 
-#define EX(x,y)			\
+#define EX(x,y,z)		\
 98:	x,y;			\
 	.section __ex_table,"a";\
 	.align 4;		\
-	.word 98b, __retl_one;	\
+	.word 98b, z;		\
 	.text;			\
 	.align 4;
 
+#define EX_O4(x,y) EX(x,y,__retl_o4_plus_8)
+#define EX_O2_4(x,y) EX(x,y,__retl_o2_plus_4)
+#define EX_O2_1(x,y) EX(x,y,__retl_o2_plus_1)
+
 	.register	%g2,#scratch
 	.register	%g3,#scratch
 
 	.text
+__retl_o4_plus_8:
+	add	%o4, %o2, %o4
+	retl
+	 add	%o4, 8, %o0
+__retl_o2_plus_4:
+	retl
+	 add	%o2, 4, %o0
+__retl_o2_plus_1:
+	retl
+	 add	%o2, 1, %o0
+
 	.align	32
 
 	/* Don't try to get too fancy here, just nice and
@@ -44,8 +59,8 @@ ENTRY(___copy_in_user)	/* %o0=dst, %o1=src, %o2=len */
 	andn		%o2, 0x7, %o4
 	and		%o2, 0x7, %o2
 1:	subcc		%o4, 0x8, %o4
-	EX(ldxa [%o1] %asi, %o5)
-	EX(stxa %o5, [%o0] %asi)
+	EX_O4(ldxa [%o1] %asi, %o5)
+	EX_O4(stxa %o5, [%o0] %asi)
 	add		%o1, 0x8, %o1
 	bgu,pt		%XCC, 1b
 	 add		%o0, 0x8, %o0
@@ -53,8 +68,8 @@ ENTRY(___copy_in_user)	/* %o0=dst, %o1=src, %o2=len */
 	be,pt		%XCC, 1f
 	 nop
 	sub		%o2, 0x4, %o2
-	EX(lduwa [%o1] %asi, %o5)
-	EX(stwa %o5, [%o0] %asi)
+	EX_O2_4(lduwa [%o1] %asi, %o5)
+	EX_O2_4(stwa %o5, [%o0] %asi)
 	add		%o1, 0x4, %o1
 	add		%o0, 0x4, %o0
 1:	cmp		%o2, 0
@@ -70,8 +85,8 @@ ENTRY(___copy_in_user)	/* %o0=dst, %o1=src, %o2=len */
 
 82:
 	subcc		%o2, 4, %o2
-	EX(lduwa [%o1] %asi, %g1)
-	EX(stwa %g1, [%o0] %asi)
+	EX_O2_4(lduwa [%o1] %asi, %g1)
+	EX_O2_4(stwa %g1, [%o0] %asi)
 	add		%o1, 4, %o1
 	bgu,pt		%XCC, 82b
 	 add		%o0, 4, %o0
@@ -82,8 +97,8 @@ ENTRY(___copy_in_user)	/* %o0=dst, %o1=src, %o2=len */
 	.align	32
 90:
 	subcc		%o2, 1, %o2
-	EX(lduba [%o1] %asi, %g1)
-	EX(stba %g1, [%o0] %asi)
+	EX_O2_1(lduba [%o1] %asi, %g1)
+	EX_O2_1(stba %g1, [%o0] %asi)
 	add		%o1, 1, %o1
 	bgu,pt		%XCC, 90b
 	 add		%o0, 1, %o0
arch/sparc/lib/user_fixup.c deleted +0 -71

71 lines not on this page · raw message

arch/sparc/mm/fault_64.c +3 -3
index dbabe5713a15..e15f33715103 100644
@@ -479,14 +479,14 @@ good_area:
 	up_read(&mm->mmap_sem);
 
 	mm_rss = get_mm_rss(mm);
-#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
-	mm_rss -= (mm->context.huge_pte_count * (HPAGE_SIZE / PAGE_SIZE));
+#if defined(CONFIG_TRANSPARENT_HUGEPAGE)
+	mm_rss -= (mm->context.thp_pte_count * (HPAGE_SIZE / PAGE_SIZE));
 #endif
 	if (unlikely(mm_rss >
 		     mm->context.tsb_block[MM_TSB_BASE].tsb_rss_limit))
 		tsb_grow(mm, MM_TSB_BASE, mm_rss);
 #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
-	mm_rss = mm->context.huge_pte_count;
+	mm_rss = mm->context.hugetlb_pte_count + mm->context.thp_pte_count;
 	if (unlikely(mm_rss >
 		     mm->context.tsb_block[MM_TSB_HUGE].tsb_rss_limit)) {
 		if (mm->context.tsb_block[MM_TSB_HUGE].tsb)
arch/sparc/mm/hugetlbpage.c +2 -2
index 364d093f46c6..da1142401bf4 100644
@@ -180,7 +180,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 	unsigned long nptes;
 
 	if (!pte_present(*ptep) && pte_present(entry))
-		mm->context.huge_pte_count++;
+		mm->context.hugetlb_pte_count++;
 
 	addr &= HPAGE_MASK;
 
@@ -212,7 +212,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
 
 	entry = *ptep;
 	if (pte_present(entry))
-		mm->context.huge_pte_count--;
+		mm->context.hugetlb_pte_count--;
 
 	addr &= HPAGE_MASK;
 	nptes = 1 << HUGETLB_PAGE_ORDER;
arch/sparc/mm/init_64.c +2 -1
index 3c4b8975fa76..a5331c336b2a 100644
@@ -346,7 +346,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *
 	spin_lock_irqsave(&mm->context.lock, flags);
 
 #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
-	if (mm->context.huge_pte_count && is_hugetlb_pte(pte))
+	if ((mm->context.hugetlb_pte_count || mm->context.thp_pte_count) &&
+	    is_hugetlb_pte(pte))
 		__update_mmu_tsb_insert(mm, MM_TSB_HUGE, REAL_HPAGE_SHIFT,
 					address, pte_val(pte));
 	else
arch/sparc/mm/tlb.c +2 -2
index f81cd9736700..3659d37b4d81 100644
@@ -175,9 +175,9 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 
 	if ((pmd_val(pmd) ^ pmd_val(orig)) & _PAGE_PMD_HUGE) {
 		if (pmd_val(pmd) & _PAGE_PMD_HUGE)
-			mm->context.huge_pte_count++;
+			mm->context.thp_pte_count++;
 		else
-			mm->context.huge_pte_count--;
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

arch/sparc/mm/tsb.c +25 -6
index a0604a493a36..9cdeca0fa955 100644

Lines of this file are not shown. View the raw message.

arch/sparc/mm/ultra.S +301 -73

374 lines not on this page · raw message

drivers/net/ethernet/broadcom/bgmac.c +4 -1
index c32f5d32f811..b56c9c581359 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/sunhv.c +0 -6
index ca0d3802f2af..4e603d060e80 100644

Lines of this file are not shown. View the raw message.

drivers/tty/tty_ldisc.c +7 -0
index 629e3c865072..9bee25cfa0be 100644

Lines of this file are not shown. View the raw message.

include/linux/filter.h +5 -1
index 5110d4211866..ccb98b459c59 100644

Lines of this file are not shown. View the raw message.

include/net/ip6_tunnel.h +1 -0
index ff788b665277..9c2c044153f6 100644

Lines of this file are not shown. View the raw message.

include/net/tcp.h +1 -0
index 9c3ab544d3a8..e9d7a8ef9a6d 100644

Lines of this file are not shown. View the raw message.

net/core/dev.c +1 -1
index b3fa4b86ab4c..9ca749c81b6c 100644

Lines of this file are not shown. View the raw message.

net/core/filter.c +5 -5
index 75e9b2b2336d..e94355452166 100644

Lines of this file are not shown. View the raw message.

net/core/flow_dissector.c +8 -3
index 4ab6ead3d8ee..9aba9e93c0a2 100644

Lines of this file are not shown. View the raw message.

net/core/sock.c +1 -0
index 0d91f7dca751..88f017854509 100644

Lines of this file are not shown. View the raw message.

net/dccp/ipv4.c +8 -6
index 8be8f27bfacc..861e1fa25d5e 100644

Lines of this file are not shown. View the raw message.

net/dccp/ipv6.c +9 -7
index b8608b71a66d..27c4e81efa24 100644

Lines of this file are not shown. View the raw message.

net/dccp/proto.c +4 -0
index 41e65804ddf5..9fe25bf63296 100644

Lines of this file are not shown. View the raw message.

net/ipv4/fib_trie.c +9 -12
index e5a3ff210fec..7c52afb98c42 100644

Lines of this file are not shown. View the raw message.

net/ipv4/route.c +3 -1
index 8533a75a9328..7ceb8a574a50 100644

Lines of this file are not shown. View the raw message.

net/ipv4/tcp.c +1 -1
index 036a76ba2ac2..69daa81736f6 100644

Lines of this file are not shown. View the raw message.

net/ipv4/tcp_dctcp.c +12 -1
index 7e538f71f5fb..55d7da1d2ce9 100644

Lines of this file are not shown. View the raw message.

net/ipv4/tcp_ipv4.c +18 -1
index b5853cac3269..b58a38eea059 100644

Lines of this file are not shown. View the raw message.

net/ipv6/tcp_ipv6.c +4 -2
index fbd521fdae53..5f581616bf6a 100644

Lines of this file are not shown. View the raw message.

net/sctp/socket.c +5 -2
index 402817be3873..b5fd4ab56156 100644

Lines of this file are not shown. View the raw message.

net/socket.c +2 -0
index 263b334ec5e4..0090225eeb1e 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

author maintainer
#3 lore raw
In reply to Andre Noll
Quoted 18 lines · Andre Noll

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 3 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Quoted 2 lines

Please consider applying something like the patch below for mainline and -stable.

If this issue is also the same for Linus's tree, we should cc: netdev so that the patch can get into there, right?

thanks,

greg k-h

#4 lore raw
Quoted 22 lines · Greg KH
Quoted 18 lines · Andre Noll

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 3 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Quoted 2 lines

Please consider applying something like the patch below for mainline and -stable.

Quoted 6 lines

If this issue is also the same for Linus's tree, we should cc: netdev so that the patch can get into there, right?

thanks,

greg k-h

We definitely want to fix the real bug, not working around it.

Seems an aliasing problem, key_control and key_basic might point to adjacent memory
and a barrier() would solve the issue as well.

Adding a test in fast path looks overkill to me.

Thanks.

#18 lore raw
In reply to Greg KH

On Tue, Nov 22, 18:06, Greg KH wrote

Quoted 19 lines · Andre Noll
Quoted 18 lines

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 3 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Quoted 5 lines
Quoted 2 lines

Please consider applying something like the patch below for mainline and -stable.

If this issue is also the same for Linus's tree, we should cc: netdev so that the patch can get into there, right?

Right, but I haven't tested PXE boot on any kernel newer than 4.4.x so far. All I can say for sure is that the problematic commit is also in Linus' tree (called 34fad54c there).

Do you want me to check if mainline is also affected?

Andre

Signature · 3 lines
Max Planck Institute for Developmental Biology
Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/
#19 lore raw
Quoted 23 lines · Andre Noll

On Tue, Nov 22, 18:06, Greg KH wrote

Quoted 22 lines · Andre Noll
Quoted 20 lines

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 3 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Please consider applying something like the patch below for mainline and -stable.

Quoted 9 lines
Quoted 2 lines

If this issue is also the same for Linus's tree, we should cc: netdev so that the patch can get into there, right?

Right, but I haven't tested PXE boot on any kernel newer than 4.4.x so far. All I can say for sure is that the problematic commit is also in Linus' tree (called 34fad54c there).

Do you want me to check if mainline is also affected?

Mainline is affected, we had a report of someone using IGB and hitting the bug.

We now have a hint based on your patch, thanks !

author maintainer
#20 lore raw
In reply to Andre Noll
Quoted 23 lines · Andre Noll

On Tue, Nov 22, 18:06, Greg KH wrote

Quoted 22 lines · Andre Noll
Quoted 20 lines

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 3 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Please consider applying something like the patch below for mainline and -stable.

Quoted 8 lines
Quoted 2 lines

If this issue is also the same for Linus's tree, we should cc: netdev so that the patch can get into there, right?

Right, but I haven't tested PXE boot on any kernel newer than 4.4.x so far. All I can say for sure is that the problematic commit is also in Linus' tree (called 34fad54c there).

Do you want me to check if mainline is also affected?

That would be great if you could do so.

thanks,

greg k-h

#2 lore raw
In reply to Greg KH

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 3 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Please consider applying something like the patch below for mainline and -stable.

Thanks
Andre

[1] http://people.tuebingen.mpg.de/maan/.eth_type_trans_panic.png
---
commit 3494d99764da2b7bbac5d0eed364d03552fefd36

Author: Andre Noll <[email protected]>
Date:   Tue Nov 22 11:34:11 2016 +0100

net: __skb_flow_dissect() must set ->thoff *after* ->n_proto and ->ip_proto

Without this, PXE boot fails on some AMD Opteron machines.

net/core/flow_dissector.c +7 -9
index 9aba9e9..fde26e4 100644
@@ -491,18 +491,17 @@ ip_proto_again:
 
 out_good:
 	ret = true;
-
-	key_control->thoff = (u16)nhoff;
+	goto out;
+out_bad:
+	ret = false;
 out:
 	key_basic->n_proto = proto;
 	key_basic->ip_proto = ip_proto;
-
+	if (ret)
+		key_control->thoff = (u16)nhoff;
+	else
+		key_control->thoff = min_t(u16, nhoff, skb ? skb->len : hlen);
 	return ret;
-
-out_bad:
-	ret = false;
-	key_control->thoff = min_t(u16, nhoff, skb ? skb->len : hlen);
-	goto out;
 }
 EXPORT_SYMBOL(__skb_flow_dissect);
-- 

Max Planck Institute for Developmental Biology Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/

#5 lore raw
In reply to Eric Dumazet

On Tue, Nov 22, 09:14, Eric Dumazet wrote

Quoted 5 lines

We definitely want to fix the real bug, not working around it.

Seems an aliasing problem, key_control and key_basic might point to adjacent memory
and a barrier() would solve the issue as well.

This was also my first idea. I added some printk statements which confirmed that key_basic->n_proto, key_basic->ip_proto and key_control->thoff were indeed close to each other. They did not overlap though.

Hope this helps
Andre

Signature · 3 lines
Max Planck Institute for Developmental Biology
Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/
#6 lore raw
In reply to Eric Dumazet
Quoted 35 lines · Eric Dumazet
Quoted 25 lines · Greg KH
Quoted 20 lines · Andre Noll

On Mon, Nov 21, 10:28, Greg KH wrote

Quoted 4 lines

I'm announcing the release of the 4.4.34 kernel.

All users of the 4.4 kernel series must upgrade.

This update broke PXE boot on our 4-way AMD boxes. The kernel panics in eth_type_trans(), presumably during kernel-level IP autoconfiguration, see [1]. Bisection points me at 5c67f947 (net: __skb_flow_dissect() must cap its return value). And indeed, reverting this commit fixes the problem for me.

Investigation showed that the real problem is not the change in the above commit per se (i.e., capping ->thoff) but the fact that in the success case, where we jump to the "out_good" label, ->thoff is now set *after* ->n_proto and ->ip_proto. I fail to see how order matters here, but it clearly does, since the crash is 100% reproducible, and is fixed by the commit below (on top of v4.4.34).

Quoted 2 lines

Please consider applying something like the patch below for mainline and -stable.

Quoted 6 lines

If this issue is also the same for Linus's tree, we should cc: netdev so that the patch can get into there, right?

thanks,

greg k-h

We definitely want to fix the real bug, not working around it.

Quoted 7 lines

Seems an aliasing problem, key_control and key_basic might point to adjacent memory
and a barrier() would solve the issue as well.

Adding a test in fast path looks overkill to me.

Thanks.

I was wondering if we shouldn't just cap all cases?

It seems like this could potentially return a value greater than skb-

Quoted 1 line

len in the "good" case since things like IP header length isn't

validated other then making sure it meets the minimum value, and if there isn't a recognized L4 header after that we could return that as a final value.

- Alex

#7 lore raw

.

Quoted 9 lines

I was wondering if we shouldn't just cap all cases?

It seems like this could potentially return a value greater than skb-

Quoted 1 line

len in the "good" case since things like IP header length isn't

validated other then making sure it meets the minimum value, and if there isn't a recognized L4 header after that we could return that as a final value.

I honestly think you are looking at the wrong causes.

This is an aliasing problem.
Tom code is hard to read and understand.

Andre, could you try :

net/core/flow_dissector.c +1 -0
index 69e4463a4b1b..b045980faaea 100644
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
                memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
        }
 
+       barrier();
 again:
        switch (proto) {
        case htons(ETH_P_IP): {
#8 lore raw

On Tue, Nov 22, 09:46, Eric Dumazet wrote

Quoted 10 lines

This is an aliasing problem.
Tom code is hard to read and understand.

Andre, could you try :

net/core/flow_dissector.c +0 -0
index 69e4463a4b1b..b045980faaea 100644

net/core/flow_dissector.c bool __skb_flow_dissect(const struct sk_buff *skb, · line 163

Quoted 7 lines
net/core/flow_dissector.c +1 -0
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
                memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
        }
 
+       barrier();
 again:
        switch (proto) {
        case htons(ETH_P_IP): {

This patch on top of v4.4.34 makes no difference: I'm still getting the panic in eth_type_trans().

Andre

Signature · 3 lines
Max Planck Institute for Developmental Biology
Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/
#9 lore raw
Quoted 14 lines · Andre Noll

On Tue, Nov 22, 09:46, Eric Dumazet wrote

Quoted 13 lines

This is an aliasing problem.
Tom code is hard to read and understand.

Andre, could you try :

net/core/flow_dissector.c +0 -0
index 69e4463a4b1b..b045980faaea 100644
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
                memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
        }
 
Quoted 8 lines

net/core/flow_dissector.c bool __skb_flow_dissect(const struct sk_buff *skb, · line 163

Quoted 4 lines
net/core/flow_dissector.c +1 -0
+       barrier();
 again:
        switch (proto) {
        case htons(ETH_P_IP): {

This patch on top of v4.4.34 makes no difference: I'm still getting the panic in eth_type_trans().

What compiler are you using exactly ?

Please try :

net/core/flow_dissector.c +1 -0
index 69e4463a4b1b..48791f372aa2 100644
@@ -551,6 +551,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 
        key_control->thoff = (u16)nhoff;
 out:
+       barrier();
        key_basic->n_proto = proto;
        key_basic->ip_proto = ip_proto;
#10 lore raw

On Tue, Nov 22, 09:56, Eric Dumazet wrote

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0 -0
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
                memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
        }
 
Quoted 8 lines

Review bool __skb_flow_dissect(const struct sk_buff *skb, · line 163

Quoted 4 lines
(quoted diff) +1 -0
+       barrier();
 again:
        switch (proto) {
        case htons(ETH_P_IP): {

This patch on top of v4.4.34 makes no difference: I'm still getting the panic in eth_type_trans().

Quoted 1 line

What compiler are you using exactly ?

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, as shipped with Ubuntu-12.04. I've also tried gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 from Ubuntu-14.04. No difference.

net/core/flow_dissector.c bool __skb_flow_dissect(const struct sk_buff *skb, · line 556

Quoted 11 lines
net/core/flow_dissector.c +1 -0
index 69e4463a4b1b..48791f372aa2 100644
@@ -551,6 +551,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 
        key_control->thoff = (u16)nhoff;
 out:
+       barrier();
        key_basic->n_proto = proto;
        key_basic->ip_proto = ip_proto;

No luck: Still the same panic.

Andre

Signature · 3 lines
Max Planck Institute for Developmental Biology
Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/
#17 lore raw
In reply to Eric Dumazet
Quoted 35 lines · Eric Dumazet
Quoted 16 lines · Andre Noll

On Tue, Nov 22, 09:46, Eric Dumazet wrote

Quoted 14 lines

This is an aliasing problem.
Tom code is hard to read and understand.

Andre, could you try :

net/core/flow_dissector.c +0 -0
index 69e4463a4b1b..b045980faaea 100644
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
                memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
        }
 
Quoted 8 lines

net/core/flow_dissector.c bool __skb_flow_dissect(const struct sk_buff *skb, · line 163

Quoted 4 lines
net/core/flow_dissector.c +1 -0
+       barrier();
 again:
        switch (proto) {
        case htons(ETH_P_IP): {

This patch on top of v4.4.34 makes no difference: I'm still getting the panic in eth_type_trans().

What compiler are you using exactly ?

Please try :

net/core/flow_dissector.c +0 -0
index 69e4463a4b1b..48791f372aa2 100644

net/core/flow_dissector.c bool __skb_flow_dissect(const struct sk_buff *skb, · line 556

Quoted 6 lines
net/core/flow_dissector.c +1 -0
@@ -551,6 +551,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 
        key_control->thoff = (u16)nhoff;
 out:
+       barrier();
        key_basic->n_proto = proto;
        key_basic->ip_proto = ip_proto;

Okay so things are starting to make sense for what I was seeing.

I think key_control and key_basic are actually the same pointer.  What has been happening is that storing the network proto is completely overwriting the network header offset with the value of 8.

Now to just figure out why.

- Alex

#11 lore raw
In reply to Andre Noll
Quoted 38 lines · Andre Noll

On Tue, Nov 22, 09:56, Eric Dumazet wrote

Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
(quoted diff) +0 -0
@@ -157,6 +157,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
                memcpy(key_eth_addrs, &eth->h_dest, sizeof(*key_eth_addrs));
        }
 
Quoted 8 lines

Review bool __skb_flow_dissect(const struct sk_buff *skb, · line 163

Quoted 4 lines
(quoted diff) +1 -0
+       barrier();
 again:
        switch (proto) {
        case htons(ETH_P_IP): {

This patch on top of v4.4.34 makes no difference: I'm still getting the panic in eth_type_trans().

Quoted 1 line

What compiler are you using exactly ?

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, as shipped with Ubuntu-12.04. I've also tried gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 from Ubuntu-14.04. No difference.

net/core/flow_dissector.c bool __skb_flow_dissect(const struct sk_buff *skb, · line 556

Quoted 12 lines
net/core/flow_dissector.c +1 -0
index 69e4463a4b1b..48791f372aa2 100644
@@ -551,6 +551,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 
        key_control->thoff = (u16)nhoff;
 out:
+       barrier();
        key_basic->n_proto = proto;
        key_basic->ip_proto = ip_proto;

No luck: Still the same panic.

Quoted 1 line

Andre

Okay I think I have figured it out, but I am not sure what a good solution is.

I think the problem is the fact that the keys may not be initialized until init_default_flow_dissectors is called and I am not sure that is happening before the network interface is trying to do DHCP.

I have to look at the initialization framework to verify if that is the case.  It would make sense why I don't usually see it though since I usually run igb as a module and that doesn't get loaded until later if I am not mistaken.

- Alex

#12 lore raw
Quoted 12 lines · Alexander H

Okay I think I have figured it out, but I am not sure what a good solution is.

I think the problem is the fact that the keys may not be initialized until init_default_flow_dissectors is called and I am not sure that is happening before the network interface is trying to do DHCP.

I have to look at the initialization framework to verify if that is the case. It would make sense why I don't usually see it though since I usually run igb as a module and that doesn't get loaded until later if I am not mistaken.

Oh that might be that, goot catch !

Time to try :

net/core/flow_dissector.c +1 -1
index 69e4463a4b1b..c6d8207ffa7e 100644
@@ -1013,4 +1013,4 @@ static int __init init_default_flow_dissectors(void)
        return 0;
 }
 
-late_initcall_sync(init_default_flow_dissectors);
+core_initcall(init_default_flow_dissectors);
#13 lore raw
In reply to Duyck, Alexander H

On Tue, Nov 22, 18:08, Duyck, Alexander H wrote

Quoted 11 lines

Okay I think I have figured it out, but I am not sure what a good solution is.

I think the problem is the fact that the keys may not be initialized until init_default_flow_dissectors is called and I am not sure that is happening before the network interface is trying to do DHCP.

I have to look at the initialization framework to verify if that is the case.  It would make sense why I don't usually see it though since I usually run igb as a module and that doesn't get loaded until later if I am not mistaken.

Sounds plausible. On our kernels the driver (ixgbe btw) is compiled in.

Andre

Signature · 3 lines
Max Planck Institute for Developmental Biology
Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/
#14 lore raw

PATCH 1/1 flow_dissect: call init_default_flow_dissectors() earlier

From: Eric Dumazet <[email protected]>

Andre Noll reported panics after my recent fix (commit 34fad54c2537 "net: __skb_flow_dissect() must cap its return value")

After some more headaches, Alexander root caused the problem to init_default_flow_dissectors() being called too late, in case a network driver like IGB is not a module and receives DHCP message very early.

Fix is to call init_default_flow_dissectors() much earlier, as it is a core infrastructure and does not depend on another kernel service.

Fixes 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
---
 net/core/flow_dissector.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/flow_dissector.c +1 -1
index 69e4463a4b1b..c6d8207ffa7e 100644
@@ -1013,4 +1013,4 @@ static int __init init_default_flow_dissectors(void)
 	return 0;
 }
 
-late_initcall_sync(init_default_flow_dissectors);
+core_initcall(init_default_flow_dissectors);
Tested-by on v1 1/1
#15 lore raw

Re: [PATCH net] flow_dissect: call init_default_flow_dissectors() earlier

On Tue, Nov 22, 11:17, Eric Dumazet wrote

net/core/flow_dissector.c static int __init init_default_flow_dissectors(void) · line 1016

Quoted 2 lines
net/core/flow_dissector.c +1 -1
-late_initcall_sync(init_default_flow_dissectors);
+core_initcall(init_default_flow_dissectors);

Indeed, that fixed it. Feel free to add

Thanks a lot
Andre

Signature · 3 lines
Max Planck Institute for Developmental Biology
Spemannstraße 35, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/
maintainer
#16 lore raw

Re: [PATCH net] flow_dissect: call init_default_flow_dissectors() earlier

In reply to Eric Dumazet

From: Eric Dumazet <[email protected]>
Date: Tue, 22 Nov 2016 11:17:30 -0800

Quoted 10 lines

From: Eric Dumazet <[email protected]>

Andre Noll reported panics after my recent fix (commit 34fad54c2537 "net: __skb_flow_dissect() must cap its return value")

After some more headaches, Alexander root caused the problem to init_default_flow_dissectors() being called too late, in case a network driver like IGB is not a module and receives DHCP message very early.

Quoted 8 lines

Fix is to call init_default_flow_dissectors() much earlier, as it is a core infrastructure and does not depend on another kernel service.

Fixes 06635a35d13d4 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")

Applied and queued up for -stable, I'll try to fast-track this.