Skip to contentSkip to conversation

3.16.60-rc1 review

PATCH In review Ben Hutchings 4 participants 373 messages Oct 14, 2018 – Apr 1, 2019 2 messages not in the archive Page 3 of 3

Subsystems (6)
lore
Share & tools
lore
#311 lore raw

PATCH 308/366 MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRs

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: "Maciej W. Rozycki" <[email protected]>

commit 9a3a92ccfe3620743d4ae57c987dc8e9c5f88996 upstream.

Check the TIF_32BIT_FPREGS task setting of the tracee rather than the tracer in determining the layout of floating-point general registers in the floating-point context, correcting access to odd-numbered registers for o32 tracees where the setting disagrees between the two processes.

Fixes 597ce1723e0f ("MIPS: Support for 64-bit FP with O32 binaries")
Cc Ralf Baechle <[email protected]>
---
 arch/mips/kernel/ptrace.c   | 4 ++--
 arch/mips/kernel/ptrace32.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/kernel/ptrace.c +2 -2
@@ -741,7 +741,7 @@ long arch_ptrace(struct task_struct *chi
 			fregs = get_fpu_regs(child);
 
 #ifdef CONFIG_32BIT
-			if (test_thread_flag(TIF_32BIT_FPREGS)) {
+			if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) {
 				/*
 				 * The odd registers are actually the high
 				 * order bits of the values stored in the even
@@ -830,7 +830,7 @@ long arch_ptrace(struct task_struct *chi
 
 			init_fp_ctx(child);
 #ifdef CONFIG_32BIT
-			if (test_thread_flag(TIF_32BIT_FPREGS)) {
+			if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) {
 				/*
 				 * The odd registers are actually the high
 				 * order bits of the values stored in the even
arch/mips/kernel/ptrace32.c +2 -2
@@ -97,7 +97,7 @@ long compat_arch_ptrace(struct task_stru
 				break;
 			}
 			fregs = get_fpu_regs(child);
-			if (test_thread_flag(TIF_32BIT_FPREGS)) {
+			if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) {
 				/*
 				 * The odd registers are actually the high
 				 * order bits of the values stored in the even
@@ -203,7 +203,7 @@ long compat_arch_ptrace(struct task_stru
 				       sizeof(child->thread.fpu));
 				child->thread.fpu.fcr31 = 0;
 			}
-			if (test_thread_flag(TIF_32BIT_FPREGS)) {
+			if (test_tsk_thread_flag(child, TIF_32BIT_FPREGS)) {
 				/*
 				 * The odd registers are actually the high
 				 * order bits of the values stored in the even
#312 lore raw

PATCH 309/366 VMXNET3: Check for map error in vmxnet3_set_mc

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Andy King <[email protected]>

commit 4ad9a64f53c619969dede1143d56ccda1a453c39 upstream.

We should check if the map of the table actually succeeds, and also free resources accordingly.

Version bumped to 1.2.1.0

---
 drivers/net/vmxnet3/vmxnet3_drv.c | 15 ++++++++-------
 drivers/net/vmxnet3/vmxnet3_int.h |  4 ++--
 2 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +8 -7
@@ -2056,7 +2056,6 @@ vmxnet3_set_mc(struct net_device *netdev
 		if (!netdev_mc_empty(netdev)) {
 			new_table = vmxnet3_copy_mc(netdev);
 			if (new_table) {
-				new_mode |= VMXNET3_RXM_MCAST;
 				rxConf->mfTableLen = cpu_to_le16(
 					netdev_mc_count(netdev) * ETH_ALEN);
 				new_table_pa = dma_map_single(
@@ -2064,15 +2063,18 @@ vmxnet3_set_mc(struct net_device *netdev
 							new_table,
 							rxConf->mfTableLen,
 							PCI_DMA_TODEVICE);
+			}
+
+			if (new_table_pa) {
+				new_mode |= VMXNET3_RXM_MCAST;
 				rxConf->mfTablePA = cpu_to_le64(new_table_pa);
 			} else {
-				netdev_info(netdev, "failed to copy mcast list"
-					    ", setting ALL_MULTI\n");
+				netdev_info(netdev,
+					    "failed to copy mcast list, setting ALL_MULTI\n");
 				new_mode |= VMXNET3_RXM_ALL_MULTI;
 			}
 		}
 
-
 	if (!(new_mode & VMXNET3_RXM_MCAST)) {
 		rxConf->mfTableLen = 0;
 		rxConf->mfTablePA = 0;
@@ -2091,11 +2093,10 @@ vmxnet3_set_mc(struct net_device *netdev
 			       VMXNET3_CMD_UPDATE_MAC_FILTERS);
 	spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
-	if (new_table) {
+	if (new_table_pa)
 		dma_unmap_single(&adapter->pdev->dev, new_table_pa,
 				 rxConf->mfTableLen, PCI_DMA_TODEVICE);
-		kfree(new_table);
-	}
+	kfree(new_table);
 }
 
 void
drivers/net/vmxnet3/vmxnet3_int.h +2 -2
@@ -69,10 +69,10 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.2.0.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.2.1.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01020000
+#define VMXNET3_DRIVER_VERSION_NUM      0x01020100
 
 #if defined(CONFIG_PCI_MSI)
 	/* RSS only makes sense if MSI-X is supported. */
#313 lore raw

PATCH 310/366 vmxnet3: fix checks for dma mapping errors

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Alexey Khoroshilov <[email protected]>

commit 5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c upstream.

vmxnet3_drv does not check dma_addr with dma_mapping_error() after mapping dma memory. The patch adds the checks and tries to handle failures.

Found by Linux Driver Verification project (linuxtesting.org).

[bwh: Backported to 3.16: adjust context, indentation]
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 71 ++++++++++++++++++++++++++-----
 1 file changed, 60 insertions(+), 11 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +60 -11
@@ -587,6 +587,12 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_r
 						&adapter->pdev->dev,
 						rbi->skb->data, rbi->len,
 						PCI_DMA_FROMDEVICE);
+				if (dma_mapping_error(&adapter->pdev->dev,
+						      rbi->dma_addr)) {
+					dev_kfree_skb_any(rbi->skb);
+					rq->stats.rx_buf_alloc_failure++;
+					break;
+				}
 			} else {
 				/* rx buffer skipped by the device */
 			}
@@ -605,13 +611,18 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_r
 						&adapter->pdev->dev,
 						rbi->page, 0, PAGE_SIZE,
 						PCI_DMA_FROMDEVICE);
+				if (dma_mapping_error(&adapter->pdev->dev,
+						      rbi->dma_addr)) {
+					put_page(rbi->page);
+					rq->stats.rx_buf_alloc_failure++;
+					break;
+				}
 			} else {
 				/* rx buffers skipped by the device */
 			}
 			val = VMXNET3_RXD_BTYPE_BODY << VMXNET3_RXD_BTYPE_SHIFT;
 		}
 
-		BUG_ON(rbi->dma_addr == 0);
 		gd->rxd.addr = cpu_to_le64(rbi->dma_addr);
 		gd->dword[2] = cpu_to_le32((!ring->gen << VMXNET3_RXD_GEN_SHIFT)
 					   | val | rbi->len);
@@ -655,7 +666,7 @@ vmxnet3_append_frag(struct sk_buff *skb,
 }
 
 
-static void
+static int
 vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx,
 		struct vmxnet3_tx_queue *tq, struct pci_dev *pdev,
 		struct vmxnet3_adapter *adapter)
@@ -715,6 +726,8 @@ vmxnet3_map_pkt(struct sk_buff *skb, str
 		tbi->dma_addr = dma_map_single(&adapter->pdev->dev,
 				skb->data + buf_offset, buf_size,
 				PCI_DMA_TODEVICE);
+		if (dma_mapping_error(&adapter->pdev->dev, tbi->dma_addr))
+			return -EFAULT;
 
 		tbi->len = buf_size;
 
@@ -755,6 +768,8 @@ vmxnet3_map_pkt(struct sk_buff *skb, str
 			tbi->dma_addr = skb_frag_dma_map(&adapter->pdev->dev, frag,
 							 buf_offset, buf_size,
 							 DMA_TO_DEVICE);
+			if (dma_mapping_error(&adapter->pdev->dev, tbi->dma_addr))
+				return -EFAULT;
 
 			tbi->len = buf_size;
 
@@ -782,6 +797,8 @@ vmxnet3_map_pkt(struct sk_buff *skb, str
 	/* set the last buf_info for the pkt */
 	tbi->skb = skb;
 	tbi->sop_idx = ctx->sop_txd - tq->tx_ring.base;
+
+	return 0;
 }
 
 
@@ -1006,7 +1023,8 @@ vmxnet3_tq_xmit(struct sk_buff *skb, str
 	}
 
 	/* fill tx descs related to addr & len */
-	vmxnet3_map_pkt(skb, &ctx, tq, adapter->pdev, adapter);
+	if (vmxnet3_map_pkt(skb, &ctx, tq, adapter->pdev, adapter))
+		goto unlock_drop_pkt;
 
 	/* setup the EOP desc */
 	ctx.eop_txd->dword[3] = cpu_to_le32(VMXNET3_TXD_CQ | VMXNET3_TXD_EOP);
@@ -1170,6 +1188,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
 		struct vmxnet3_rx_buf_info *rbi;
 		struct sk_buff *skb, *new_skb = NULL;
 		struct page *new_page = NULL;
+		dma_addr_t new_dma_addr;
 		int num_to_alloc;
 		struct Vmxnet3_RxDesc *rxd;
 		u32 idx, ring_idx;
@@ -1227,6 +1246,21 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
 				skip_page_frags = true;
 				goto rcd_done;
 			}
+			new_dma_addr = dma_map_single(&adapter->pdev->dev,
+						      new_skb->data, rbi->len,
+						      PCI_DMA_FROMDEVICE);
+			if (dma_mapping_error(&adapter->pdev->dev,
+					      new_dma_addr)) {
+				dev_kfree_skb(new_skb);
+				/* Skb allocation failed, do not handover this
+				 * skb to stack. Reuse it. Drop the existing pkt
+				 */
+				rq->stats.rx_buf_alloc_failure++;
+				ctx->skb = NULL;
+				rq->stats.drop_total++;
+				skip_page_frags = true;
+				goto rcd_done;
+			}
 
 			dma_unmap_single(&adapter->pdev->dev, rbi->dma_addr,
 					 rbi->len,
@@ -1243,9 +1277,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
 
 			/* Immediate refill */
 			rbi->skb = new_skb;
-			rbi->dma_addr = dma_map_single(&adapter->pdev->dev,
-						       rbi->skb->data, rbi->len,
-						       PCI_DMA_FROMDEVICE);
+			rbi->dma_addr = new_dma_addr;
 			rxd->addr = cpu_to_le64(rbi->dma_addr);
 			rxd->len = rbi->len;
 
@@ -1275,6 +1307,19 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
 				skip_page_frags = true;
 				goto rcd_done;
 			}
+			new_dma_addr = dma_map_page(&adapter->pdev->dev,
+						rbi->page,
+						0, PAGE_SIZE,
+						PCI_DMA_FROMDEVICE);
+			if (dma_mapping_error(&adapter->pdev->dev,
+					      new_dma_addr)) {
+				put_page(new_page);
+				rq->stats.rx_buf_alloc_failure++;
+				dev_kfree_skb(ctx->skb);
+				ctx->skb = NULL;
+				skip_page_frags = true;
+				goto rcd_done;
+			}
 
 			if (rcd->len) {
 				dma_unmap_page(&adapter->pdev->dev,
@@ -1286,10 +1331,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
 
 			/* Immediate refill */
 			rbi->page = new_page;
-			rbi->dma_addr = dma_map_page(&adapter->pdev->dev,
-						     rbi->page,
-						     0, PAGE_SIZE,
-						     PCI_DMA_FROMDEVICE);
+			rbi->dma_addr = new_dma_addr;
 			rxd->addr = cpu_to_le64(rbi->dma_addr);
 			rxd->len = rbi->len;
 		}
@@ -2065,7 +2107,8 @@ vmxnet3_set_mc(struct net_device *netdev
 							PCI_DMA_TODEVICE);
 			}
 
-			if (new_table_pa) {
+			if (!dma_mapping_error(&adapter->pdev->dev,
+					       new_table_pa)) {
 				new_mode |= VMXNET3_RXM_MCAST;
 				rxConf->mfTablePA = cpu_to_le64(new_table_pa);
 			} else {
@@ -2976,6 +3019,11 @@ vmxnet3_probe_device(struct pci_dev *pde
 	adapter->adapter_pa = dma_map_single(&adapter->pdev->dev, adapter,
 					     sizeof(struct vmxnet3_adapter),
 					     PCI_DMA_TODEVICE);
+	if (dma_mapping_error(&adapter->pdev->dev, adapter->adapter_pa)) {
+		dev_err(&pdev->dev, "Failed to map dma\n");
+		err = -EFAULT;
+		goto err_dma_map;
+	}
 	adapter->shared = dma_alloc_coherent(
 				&adapter->pdev->dev,
 				sizeof(struct Vmxnet3_DriverShared),
@@ -3129,6 +3177,7 @@ err_alloc_queue_desc:
 err_alloc_shared:
 	dma_unmap_single(&adapter->pdev->dev, adapter->adapter_pa,
 			 sizeof(struct vmxnet3_adapter), PCI_DMA_TODEVICE);
+err_dma_map:
 	free_netdev(netdev);
 	return err;
 }
#314 lore raw

Re: [PATCH 3.16 310/366] vmxnet3: fix checks for dma mapping errors

Quoted 1 line

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

Sorry for the late response, this just hit the kernel in Debian Jessie (oldstable) a few days ago.

Quoted 9 lines

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

From: Alexey Khoroshilov <[email protected]>

commit 5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c upstream.

vmxnet3_drv does not check dma_addr with dma_mapping_error() after mapping dma memory. The patch adds the checks and tries to handle failures.

We are seeing kernel panics/machine freezes/BUGs with the new 3.16.64 from Debian. I bisected it with the vanilla stable kernel and it boiled down to this commit. VMs of multiple nodes of our vmware cluster are affected.
The bug can be triggered in multiple ways, I have seen it when an external network request is served, when installing packages over the network and performing a git clone.

I will try to get the specific versions of the involved hardware components next week.
The 4.9.144 stable kernel (which also contains this commit works fine on the affected machine)

Below you can see the dmesg log of one affected machine:

[    1.772994] vmxnet3 0000:03:00.0 eth0: intr type 3, mode 0, 5 vectors allocated
[    1.774079] vmxnet3 0000:03:00.0 eth0: NIC Link is Up 10000 Mbps
[    9.622787] gunicorn: worke: Corrupted page table at address 362d000
[    9.622817] PGD 80000000753b7067 PUD 6f84e067 PMD 76cbb067 PTE 6461685368637845
[    9.622848] Bad pagetable: 000d [#1] SMP 
[    9.622866] Modules linked in: binfmt_misc ip6table_filter ip6_tables ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_comment xt_multiport xt_conntrack nf_conntrack iptable_filter ip_tables x_tables crc32_pclmul crc32c_intel aesni_intel aes_x86_64 glue_helper lrw vmw_vsock_vmci_transport vsock gf128mul vmw_balloon ppdev evdev ablk_helper cryptd pcspkr serio_raw vmwgfx drm_kms_helper ttm ac processor battery button parport_pc thermal_sys drm parport shpchp vmw_vmci autofs4 ext4 crc16 mbcache jbd2 dm_mod sg sr_mod cdrom sd_mod crc_t10dif crct10dif_generic ata_generic crct10dif_pclmul crct10dif_common psmouse vmxnet3 ata_piix mptspi scsi_transport_spi mptscsih libata i2c_piix4 mptbase scsi_mod i2c_core
[    9.623168] CPU: 1 PID: 717 Comm: gunicorn: worke Not tainted 3.16.59+ #18
[    9.623191] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.623225] task: ffff88007835e090 ti: ffff88006f834000 task.ti: ffff88006f834000
[    9.623249] RIP: 0033:[<00007fb4bfb6d123>]  [<00007fb4bfb6d123>] 0x7fb4bfb6d123
[    9.623278] RSP: 002b:00007fff6e4718b8  EFLAGS: 00010206
[    9.623296] RAX: fffffffffff7b8c0 RBX: 00000000036aadc0 RCX: 00000000036b1740
[    9.623318] RDX: 000000000372f500 RSI: 0000000003626690 RDI: 00000000036aade0
[    9.623341] RBP: 0000000000084740 R08: fffffffffff7b8b0 R09: fffffffffff7b8a0
[    9.623363] R10: fffffffffff7b890 R11: 0000000000000037 R12: 0000000000085760
[    9.623385] R13: 00000000004cd810 R14: 0000000000001000 R15: 0000000003589dd0
[    9.623408] FS:  00007fb4c0ffe700(0000) GS:ffff88007fc80000(0000) knlGS:0000000000000000
[    9.623433] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    9.623451] CR2: 000000000362d000 CR3: 00000000753fa000 CR4: 0000000000360770
[    9.623524] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    9.623547] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    9.623577] RIP  [<00007fb4bfb6d123>] 0x7fb4bfb6d123
[    9.623600]  RSP <00007fff6e4718b8>
[    9.623614] ---[ end trace f863ea854df6c9a5 ]---
[    9.624169] swap_free: Bad swap file entry 1001a1e5a32423f7
[    9.624189] BUG: Bad page map in process gunicorn: worke  pte:417869736f702024 pmd:76cbb067
[    9.624215] addr:0000000003600000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3600
[    9.625444] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G      D       3.16.59+ #18
[    9.626070] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.627321]  0000000000000000 ffffffff8151fda4 0000000003600000 ffff8800753700d0
[    9.627968]  ffffffff8116f380 0000000000000008 ffff880076cbb000 417869736f702024
[    9.628596]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003600000
[    9.629213] Call Trace:
[    9.629811]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.630413]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.630991]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[    9.631556]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.632106]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.632640]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.633162]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.633677]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.634171]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.634653]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.635129]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.635629] BUG: Bad page map in process gunicorn: worke  pte:2420746e756f6363 pmd:76cbb067
[    9.636111] addr:0000000003601000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3601
[    9.637080] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.637594] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.638611]  0000000000000000 ffffffff8151fda4 0000000003601000 ffff8800753700d0
[    9.639145]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb008 2420746e756f6363
[    9.639671]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003601000
[    9.640203] Call Trace:
[    9.640737]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.641268]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.641798]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.642320]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.642839]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.643357]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.643867]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.644359]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.644837]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.645304]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.645758]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.646196]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.646634]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.647078] BUG: Bad page map in process gunicorn: worke  pte:4d68637845736d20 pmd:76cbb067
[    9.647552] addr:0000000003602000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3602
[    9.648420] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.648876] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.649810]  0000000000000000 ffffffff8151fda4 0000000003602000 ffff8800753700d0
[    9.650310]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb010 4d68637845736d20
[    9.650827]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003602000
[    9.651341] Call Trace:
[    9.651846]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.652362]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.652903]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.653419]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.653917]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.654406]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.654879]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.655341]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.655789]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.656221]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.656647]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.657062]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.657487]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.657912] BUG: Bad page map in process gunicorn: worke  pte:614d786f626c6961 pmd:76cbb067
[    9.658331] addr:0000000003603000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3603
[    9.659218] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.659676] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.660610]  0000000000000000 ffffffff8151fda4 0000000003603000 ffff8800753700d0
[    9.661110]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb018 614d786f626c6961
[    9.661620]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003603000
[    9.662132] Call Trace:
[    9.662637]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.663156]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.663673]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.664182]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.664686]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.665175]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.665649]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.666111]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.666559]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.666992]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.667425]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.667841]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.668252]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.668676] BUG: Bad page map in process gunicorn: worke  pte:6c6f50726567616e pmd:76cbb067
[    9.669096] addr:0000000003604000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3604
[    9.669951] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.670407] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.671345]  0000000000000000 ffffffff8151fda4 0000000003604000 ffff8800753700d0
[    9.671851]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb020 6c6f50726567616e
[    9.672357]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003604000
[    9.672870] Call Trace:
[    9.673376]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.673892]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.674410]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.674924]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.675424]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.675912]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.676385]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.676848]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.677296]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.677744]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.678165]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.678579]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.678990]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.679410] BUG: Bad page map in process gunicorn: worke  pte:414d202920796369 pmd:76cbb067
[    9.679829] addr:0000000003605000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3605
[    9.680682] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.681137] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.682076]  0000000000000000 ffffffff8151fda4 0000000003605000 ffff8800753700d0
[    9.682575]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb028 414d202920796369
[    9.683079]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003605000
[    9.683593] Call Trace:
[    9.684098]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.684620]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.685137]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.685647]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.686144]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.686633]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.687106]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.687580]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.688027]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.688460]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.688887]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.689301]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.689712]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.690131] BUG: Bad page map in process gunicorn: worke  pte:49776f6873282059 pmd:76cbb067
[    9.690551] addr:0000000003606000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3606
[    9.691424] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.691881] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.692816]  0000000000000000 ffffffff8151fda4 0000000003606000 ffff8800753700d0
[    9.693315]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb030 49776f6873282059
[    9.693825]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003606000
[    9.694338] Call Trace:
[    9.694843]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.695361]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.695878]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.696387]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.696891]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.697379]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.697866]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.698328]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.698777]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.699215]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.699636]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.700051]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.700468]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.700909] BUG: Bad page map in process gunicorn: worke  pte:737365726464416e pmd:76cbb067
[    9.701327] addr:0000000003607000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3607
[    9.702181] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.702636] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.703592]  0000000000000000 ffffffff8151fda4 0000000003607000 ffff8800753700d0
[    9.704092]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb038 737365726464416e
[    9.704597]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003607000
[    9.705110] Call Trace:
[    9.705719]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.706305]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.706936]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.707492]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.707991]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.708487]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.708962]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.709426]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.709881]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.710315]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.710743]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.711159]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.711572]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.712000] BUG: Bad page map in process gunicorn: worke  pte:6c2024206b6f6f42 pmd:76cbb067
[    9.712422] addr:0000000003608000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3608
[    9.713280] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.713737] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.714681]  0000000000000000 ffffffff8151fda4 0000000003608000 ffff8800753700d0
[    9.715186]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb040 6c2024206b6f6f42
[    9.715698]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003608000
[    9.716212] Call Trace:
[    9.716719]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.717237]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.717770]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.718281]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.718780]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.719270]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.719758]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.720222]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.720677]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.721111]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.721533]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.721954]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.722366]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.722791] BUG: Bad page map in process gunicorn: worke  pte:6378457963616765 pmd:76cbb067
[    9.723226] addr:0000000003609000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3609
[    9.724088] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.724550] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.725491]  0000000000000000 ffffffff8151fda4 0000000003609000 ffff8800753700d0
[    9.725991]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb048 6378457963616765
[    9.726496]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003609000
[    9.727008] Call Trace:
[    9.727534]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.728050]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.728568]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.729081]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.729580]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.730069]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.730549]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.731012]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.731461]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.731899]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.732326]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.732741]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.733153]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.733582] BUG: Bad page map in process gunicorn: worke  pte:204e4465676e6168 pmd:76cbb067
[    9.734002] addr:000000000360a000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:360a
[    9.734857] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.735322] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.736257]  0000000000000000 ffffffff8151fda4 000000000360a000 ffff8800753700d0
[    9.736770]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb050 204e4465676e6168
[    9.737276]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000360a000
[    9.737806] Call Trace:
[    9.738314]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.738830]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.739347]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.739856]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.740359]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.740853]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.741327]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.741789]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.742238]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.742676]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.743097]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.743518]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.743935]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.744365] swap_free: Bad swap file entry 1a01e721eea324b7
[    9.744771] BUG: Bad page map in process gunicorn: worke  pte:68637845736d2024 pmd:76cbb067
[    9.745190] addr:000000000360b000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:360b
[    9.746077] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.746546] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.747512]  0000000000000000 ffffffff8151fda4 000000000360b000 ffff8800753700d0
[    9.748022]  ffffffff8116f380 000000000000000d ffff880076cbb058 68637845736d2024
[    9.748534]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000360b000
[    9.749052] Call Trace:
[    9.749562]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.750087]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.750613]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[    9.751123]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.751621]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.752114]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.752586]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.753045]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.753494]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.753926]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.754354]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.754805] BUG: Bad page map in process gunicorn: worke  pte:61447972616e6143 pmd:76cbb067
[    9.755255] addr:000000000360c000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:360c
[    9.756128] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.756594] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.757577]  0000000000000000 ffffffff8151fda4 000000000360c000 ffff8800753700d0
[    9.758087]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb060 61447972616e6143
[    9.758607]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000360c000
[    9.759132] Call Trace:
[    9.759650]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.760177]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.760711]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.761232]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.761752]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.762275]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.762780]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.763272]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.763761]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.764233]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.764687]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.765125]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.765555]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.765999] BUG: Bad page map in process gunicorn: worke  pte:6568202420326174 pmd:76cbb067
[    9.766438] addr:000000000360d000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:360d
[    9.767325] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.767799] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.768732]  0000000000000000 ffffffff8151fda4 000000000360d000 ffff8800753700d0
[    9.769231]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb068 6568202420326174
[    9.769736]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000360d000
[    9.770253] Call Trace:
[    9.770771]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.771290]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.771807]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.772322]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.772820]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.773309]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.773789]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.774251]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.774699]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.775135]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.775556]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.775977]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.776388]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.776814] BUG: Bad page map in process gunicorn: worke  pte:7363697473697275 pmd:76cbb067
[    9.777234] addr:000000000360e000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:360e
[    9.778105] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.778561] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.779498]  0000000000000000 ffffffff8151fda4 000000000360e000 ffff8800753700d0
[    9.780003]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb070 7363697473697275
[    9.780514]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000360e000
[    9.781027] Call Trace:
[    9.781533]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.782054]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.782572]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.783087]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.783593]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.784082]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.784556]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.785019]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.785468]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.785902]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.786323]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.786744]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.787155]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.787598] swap_free: Bad swap file entry 180121eea324b7f6
[    9.788001] BUG: Bad page map in process gunicorn: worke  pte:637845736d202420 pmd:76cbb067
[    9.788421] addr:000000000360f000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:360f
[    9.789290] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.789748] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.790698]  0000000000000000 ffffffff8151fda4 000000000360f000 ffff8800753700d0
[    9.791202]  ffffffff8116f380 000000000000000c ffff880076cbb078 637845736d202420
[    9.791716]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000360f000
[    9.792234] Call Trace:
[    9.792744]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.793263]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.793792]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[    9.794303]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.794800]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.795284]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.795756]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.796215]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.796664]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.797096]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.797540]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.797979] swap_free: Bad swap file entry 100122e467a466aa
[    9.798398] BUG: Bad page map in process gunicorn: worke  pte:43746e616e655468 pmd:76cbb067
[    9.798832] addr:0000000003610000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3610
[    9.799738] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.800211] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.801201]  0000000000000000 ffffffff8151fda4 0000000003610000 ffff8800753700d0
[    9.801717]  ffffffff8116f380 0000000000000008 ffff880076cbb080 43746e616e655468
[    9.802240]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003610000
[    9.802775] Call Trace:
[    9.803300]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.803833]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.804366]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[    9.804901]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.805429]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.805952]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.806456]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.806946]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.807424]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.807902]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.808357]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.808821] BUG: Bad page map in process gunicorn: worke  pte:24207972746e756f pmd:76cbb067
[    9.809276] addr:0000000003611000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3611
[    9.810180] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.810648] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.811615]  0000000000000000 ffffffff8151fda4 0000000003611000 ffff8800753700d0
[    9.812125]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb088 24207972746e756f
[    9.812641]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003611000
[    9.813165] Call Trace:
[    9.813682]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.814210]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.814746]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.815269]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.815790]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.816309]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.816821]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.817315]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.817808]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.818276]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.818730]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.819169]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.819600]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.820041] BUG: Bad page map in process gunicorn: worke  pte:5368637845736d20 pmd:76cbb067
[    9.820483] addr:0000000003612000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3612
[    9.821351] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.821812] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.822753]  0000000000000000 ffffffff8151fda4 0000000003612000 ffff8800753700d0
[    9.823256]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb090 5368637845736d20
[    9.823761]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003612000
[    9.824273] Call Trace:
[    9.824779]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.825296]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.825822]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.826332]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.826830]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.827319]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.827809]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.828271]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.828720]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.829152]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.829573]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.829987]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.830398]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.830835] BUG: Bad page map in process gunicorn: worke  pte:7461745370757465 pmd:76cbb067
[    9.831272] addr:0000000003613000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3613
[    9.832127] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.832583] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.833516]  0000000000000000 ffffffff8151fda4 0000000003613000 ffff8800753700d0
[    9.834039]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb098 7461745370757465
[    9.834545]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003613000
[    9.835058] Call Trace:
[    9.835567]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.836083]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.836607]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.837117]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.837635]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.838123]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.838597]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.839059]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.839507]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.839940]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.840361]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.840781]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.841193]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.841615] BUG: Bad page map in process gunicorn: worke  pte:45736d2024207375 pmd:76cbb067
[    9.842036] addr:0000000003614000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3614
[    9.842890] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.843348] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.844285]  0000000000000000 ffffffff8151fda4 0000000003614000 ffff8800753700d0
[    9.844790]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0a0 45736d2024207375
[    9.845296]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003614000
[    9.845808] Call Trace:
[    9.846314]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.846831]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.847348]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.847877]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.848375]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.848864]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.849338]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.849800]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.850249]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.850688]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.851109]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.851523]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.851935]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.852355] BUG: Bad page map in process gunicorn: worke  pte:736e617254686378 pmd:76cbb067
[    9.852775] addr:0000000003615000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3615
[    9.853628] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.854083] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.855025]  0000000000000000 ffffffff8151fda4 0000000003615000 ffff8800753700d0
[    9.855526]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0a8 736e617254686378
[    9.856031]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003615000
[    9.856544] Call Trace:
[    9.857049]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.857580]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.858098]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.858608]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.859141]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.859665]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.860185]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.860681]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.861131]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.861660]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.862108]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.862597]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.863072]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.863499] BUG: Bad page map in process gunicorn: worke  pte:6f626e4974726f70 pmd:76cbb067
[    9.863920] addr:0000000003616000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3616
[    9.864776] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.865233] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.866176]  0000000000000000 ffffffff8151fda4 0000000003616000 ffff8800753700d0
[    9.866679]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0b0 6f626e4974726f70
[    9.867185]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003616000
[    9.867721] Call Trace:
[    9.868228]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.868745]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.869262]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.869772]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.870271]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.870766]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.871240]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.871703]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.872152]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.872608]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.873047]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.873462]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.873879]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.874301] BUG: Bad page map in process gunicorn: worke  pte:6974746553646e75 pmd:76cbb067
[    9.874721] addr:0000000003617000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3617
[    9.875593] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.876049] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.876983]  0000000000000000 ffffffff8151fda4 0000000003617000 ffff8800753700d0
[    9.877483]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0b8 6974746553646e75
[    9.878001]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003617000
[    9.878514] Call Trace:
[    9.879019]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.879538]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.880055]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.880565]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.881068]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.881557]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.882031]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.882493]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.882946]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.883379]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.883805]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.884219]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.884630]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.885050] BUG: Bad page map in process gunicorn: worke  pte:736d20242073676e pmd:76cbb067
[    9.885470] addr:0000000003618000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3618
[    9.886324] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.886779] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.887733]  0000000000000000 ffffffff8151fda4 0000000003618000 ffff8800753700d0
[    9.888232]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0c0 736d20242073676e
[    9.888738]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003618000
[    9.889250] Call Trace:
[    9.889755]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.890272]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.890795]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.891306]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.891804]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.892294]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.892769]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.893232]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.893687]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.894120]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.894542]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.894957]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.895368]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.895789] BUG: Bad page map in process gunicorn: worke  pte:624f4c4168637845 pmd:76cbb067
[    9.896208] addr:0000000003619000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3619
[    9.897063] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.897519] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.898467]  0000000000000000 ffffffff8151fda4 0000000003619000 ffff8800753700d0
[    9.898967]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0c8 624f4c4168637845
[    9.899476]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003619000
[    9.899989] Call Trace:
[    9.900495]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.901018]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.901536]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.902048]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.902548]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.903038]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.903513]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.903983]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.904432]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.904866]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.905288]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.905704]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.906115]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.906535] BUG: Bad page map in process gunicorn: worke  pte:737265567463656a pmd:76cbb067
[    9.906954] addr:000000000361a000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:361a
[    9.907851] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.908309] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.909245]  0000000000000000 ffffffff8151fda4 000000000361a000 ffff8800753700d0
[    9.909745]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0d0 737265567463656a
[    9.910250]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000361a000
[    9.910769] Call Trace:
[    9.911275]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.911793]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.912310]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.912819]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.913318]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.913812]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.914286]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.914748]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.915197]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.915631]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.916052]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.916467]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.916883]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.917304] BUG: Bad page map in process gunicorn: worke  pte:65722024206e6f69 pmd:76cbb067
[    9.917739] addr:000000000361b000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:361b
[    9.918592] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.919046] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.919983]  0000000000000000 ffffffff8151fda4 000000000361b000 ffff8800753700d0
[    9.920483]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0d8 65722024206e6f69
[    9.920993]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000361b000
[    9.921505] Call Trace:
[    9.922011]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.922527]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.923044]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.923554]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.924062]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.924551]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.925025]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.925524]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.925974]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.926406]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.926827]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.927241]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.927667]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.928087] swap_free: Bad swap file entry 1a0025a2e7a725a4
[    9.928492] BUG: Bad page map in process gunicorn: worke  pte:6f69746163696c70 pmd:76cbb067
[    9.928912] addr:000000000361c000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:361c
[    9.929780] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.930238] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.931186]  0000000000000000 ffffffff8151fda4 000000000361c000 ffff8800753700d0
[    9.931692]  ffffffff8116f380 000000000000000d ffff880076cbb0e0 6f69746163696c70
[    9.932204]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000361c000
[    9.932721] Call Trace:
[    9.933231]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.933755]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.934300]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[    9.934833]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.935339]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.935822]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.936294]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.936758]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.937200]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.937644]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.938071]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.938519] BUG: Bad page map in process gunicorn: worke  pte:7574616e6769536e pmd:76cbb067
[    9.938952] addr:000000000361d000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:361d
[    9.939843] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.940311] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.941268]  0000000000000000 ffffffff8151fda4 000000000361d000 ffff8800753700d0
[    9.941777]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0e8 7574616e6769536e
[    9.942293]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000361d000
[    9.942822] Call Trace:
[    9.943341]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.943869]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.944415]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.944938]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.945459]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.945984]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.946490]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.946984]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.947463]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.947949]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.948404]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.948843]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.949274]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.949718] BUG: Bad page map in process gunicorn: worke  pte:45736d2024206572 pmd:76cbb067
[    9.950158] addr:000000000361e000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:361e
[    9.951028] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.951507] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.952445]  0000000000000000 ffffffff8151fda4 000000000361e000 ffff8800753700d0
[    9.952946]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0f0 45736d2024206572
[    9.953453]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000361e000
[    9.953972] Call Trace:
[    9.954479]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.954997]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.955515]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.956026]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.956526]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.957021]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.957496]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.957972]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.958421]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.958855]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.959277]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.959692]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.960103]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.960525] BUG: Bad page map in process gunicorn: worke  pte:7973726944686378 pmd:76cbb067
[    9.960945] addr:000000000361f000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:361f
[    9.961798] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.962253] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.963196]  0000000000000000 ffffffff8151fda4 000000000361f000 ffff8800753700d0
[    9.963697]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb0f8 7973726944686378
[    9.964203]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000361f000
[    9.964716] Call Trace:
[    9.965221]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.965744]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.966262]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.966772]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.967270]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.967773]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.968247]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.968710]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.969159]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.969593]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.970014]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.970430]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.970848]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.971269] BUG: Bad page map in process gunicorn: worke  pte:726f68747541636e pmd:76cbb067
[    9.971706] addr:0000000003620000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3620
[    9.972562] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.973018] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.973955]  0000000000000000 ffffffff8151fda4 0000000003620000 ffff8800753700d0
[    9.974456]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb100 726f68747541636e
[    9.974967]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003620000
[    9.975481] Call Trace:
[    9.975987]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.976504]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.977021]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.977532]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.978045]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.978534]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.979009]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.979472]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.979922]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.980355]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.980783]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.981198]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.981609]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.982030] BUG: Bad page map in process gunicorn: worke  pte:646174654d797469 pmd:76cbb067
[    9.982450] addr:0000000003621000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3621
[    9.983304] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.983762] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.984701]  0000000000000000 ffffffff8151fda4 0000000003621000 ffff8800753700d0
[    9.985200]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb108 646174654d797469
[    9.985705]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003621000
[    9.986218] Call Trace:
[    9.986723]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.987239]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.987773]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.988284]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.988782]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[    9.989271]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[    9.989746]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[    9.990208]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[    9.990658]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[    9.991096]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[    9.991517]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[    9.991933]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[    9.992344]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[    9.992765] BUG: Bad page map in process gunicorn: worke  pte:736d202420617461 pmd:76cbb067
[    9.993184] addr:0000000003622000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3622
[    9.994039] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[    9.994495] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[    9.995433]  0000000000000000 ffffffff8151fda4 0000000003622000 ffff8800753700d0
[    9.995941]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb110 736d202420617461
[    9.996447]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003622000
[    9.996961] Call Trace:
[    9.997466]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[    9.997997]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.998514]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[    9.999024]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[    9.999523]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.000012]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.000488]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.000959]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.001410]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.001845]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.002268]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.002684]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.003096]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.003517] BUG: Bad page map in process gunicorn: worke  pte:6166654468637845 pmd:76cbb067
[   10.003936] addr:0000000003623000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3623
[   10.004792] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.005249] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.006191]  0000000000000000 ffffffff8151fda4 0000000003623000 ffff8800753700d0
[   10.006692]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb118 6166654468637845
[   10.007199]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003623000
[   10.007728] Call Trace:
[   10.008235]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.008753]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.009272]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.009784]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.010284]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.010784]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.011259]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.011723]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.012173]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.012607]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.013029]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.013449]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.013867]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.014287] BUG: Bad page map in process gunicorn: worke  pte:696c627550746c75 pmd:76cbb067
[   10.014706] addr:0000000003624000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3624
[   10.015660] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.016167] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.017131]  0000000000000000 ffffffff8151fda4 0000000003624000 ffff8800753700d0
[   10.017631]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb120 696c627550746c75
[   10.018152]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003624000
[   10.018665] Call Trace:
[   10.019170]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.019689]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.020206]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.020722]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.021220]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.021708]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.022182]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.022644]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.023092]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.023525]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.023951]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.024365]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.024775]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.025199] BUG: Bad page map in process gunicorn: worke  pte:4d7265646c6f4663 pmd:76cbb067
[   10.025617] addr:0000000003625000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3625
[   10.026508] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.026963] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.028333]  0000000000000000 ffffffff8151fda4 0000000003625000 ffff8800753700d0
[   10.028844]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb128 4d7265646c6f4663
[   10.029348]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003625000
[   10.029861] Call Trace:
[   10.030368]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.030885]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.031403]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.031919]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.032418]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.032908]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.033382]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.033844]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.034293]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.034732]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.035153]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.035569]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.035986]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.036412] BUG: Bad page map in process gunicorn: worke  pte:2420786f626c6961 pmd:76cbb067
[   10.036832] addr:0000000003626000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3626
[   10.037688] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.038152] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.039088]  0000000000000000 ffffffff8151fda4 0000000003626000 ffff8800753700d0
[   10.039590]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb130 2420786f626c6961
[   10.040097]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003626000
[   10.040620] Call Trace:
[   10.041126]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.041643]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.042161]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.042671]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.043176]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.043665]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.044139]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.044602]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.045051]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.045484]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.045912]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.046327]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.046738]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.047160] BUG: Bad page map in process gunicorn: worke  pte:4568637845736d20 pmd:76cbb067
[   10.047594] addr:0000000003627000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3627
[   10.048457] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.048912] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.049845]  0000000000000000 ffffffff8151fda4 0000000003627000 ffff8800753700d0
[   10.050344]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb138 4568637845736d20
[   10.050855]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003627000
[   10.051367] Call Trace:
[   10.051876]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.052392]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.052909]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.053419]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.053923]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.054412]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.054886]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.055348]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.055797]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.056229]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.056650]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.057071]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.057482]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.057922] BUG: Bad page map in process gunicorn: worke  pte:656c62616e457377 pmd:76cbb067
[   10.058343] addr:0000000003628000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3628
[   10.059197] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.059655] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.060589]  0000000000000000 ffffffff8151fda4 0000000003628000 ffff8800753700d0
[   10.061094]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb140 656c62616e457377
[   10.061600]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003628000
[   10.062113] Call Trace:
[   10.062619]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.063135]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.063653]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.064169]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.064668]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.065157]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.065631]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.066094]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.066544]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.066983]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.067404]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.067837]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.068248]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.068669] swap_free: Bad swap file entry 1a00e3e6a377f6f7
[   10.069073] BUG: Bad page map in process gunicorn: worke  pte:6c70657220242064 pmd:76cbb067
[   10.069493] addr:0000000003629000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3629
[   10.070362] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.070826] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.071773]  0000000000000000 ffffffff8151fda4 0000000003629000 ffff8800753700d0
[   10.072276]  ffffffff8116f380 000000000000000d ffff880076cbb148 6c70657220242064
[   10.072790]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003629000
[   10.073308] Call Trace:
[   10.073825]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.074345]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.074866]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[   10.075378]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.075876]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.076361]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.076842]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.077301]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.077761]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.078193]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.078623]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.079064] BUG: Bad page map in process gunicorn: worke  pte:624f646574616369 pmd:76cbb067
[   10.079514] addr:000000000362a000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:362a
[   10.080385] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.080851] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.081815]  0000000000000000 ffffffff8151fda4 000000000362a000 ffff8800753700d0
[   10.082324]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb150 624f646574616369
[   10.082840]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000362a000
[   10.083362] Call Trace:
[   10.083881]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.084408]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.084943]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.085464]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.085985]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.086504]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.087009]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.087503]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.087992]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.088459]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.088915]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.089355]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.089786]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.090228] BUG: Bad page map in process gunicorn: worke  pte:737265567463656a pmd:76cbb067
[   10.090667] addr:000000000362b000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:362b
[   10.091555] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.092013] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.092949]  0000000000000000 ffffffff8151fda4 000000000362b000 ffff8800753700d0
[   10.093448]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb158 737265567463656a
[   10.093959]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000362b000
[   10.094472] Call Trace:
[   10.094978]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.095497]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.096015]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.096525]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.097030]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.097520]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.098010]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.098474]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.098923]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.099356]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.099778]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.100194]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.100606]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.101031] BUG: Bad page map in process gunicorn: worke  pte:736d2024206e6f69 pmd:76cbb067
[   10.101450] addr:000000000362c000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:362c
[   10.102307] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.102764] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.103702]  0000000000000000 ffffffff8151fda4 000000000362c000 ffff8800753700d0
[   10.104208]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb160 736d2024206e6f69
[   10.104714]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000362c000
[   10.105227] Call Trace:
[   10.105733]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.106251]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.106775]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.107286]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.107803]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.108306]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.108781]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.109244]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.109693]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.110127]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.110549]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.110969]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.111381]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.111802] BUG: Bad page map in process gunicorn: worke  pte:6461685368637845 pmd:76cbb067
[   10.112219] addr:000000000362d000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:362d
[   10.113073] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.113529] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.114464]  0000000000000000 ffffffff8151fda4 000000000362d000 ffff8800753700d0
[   10.114969]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb168 6461685368637845
[   10.115478]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000362d000
[   10.115992] Call Trace:
[   10.116499]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.117016]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.117534]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.118057]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.118556]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.119046]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.119521]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.119984]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.120433]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.120873]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.121295]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.121711]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.122123]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.122544] BUG: Bad page map in process gunicorn: worke  pte:48726568744f776f pmd:76cbb067
[   10.122962] addr:000000000362e000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:362e
[   10.123836] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.124293] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.125231]  0000000000000000 ffffffff8151fda4 000000000362e000 ffff8800753700d0
[   10.125731]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb170 48726568744f776f
[   10.126237]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000362e000
[   10.126750] Call Trace:
[   10.127260]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.127796]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.128314]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.128824]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.129322]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.129811]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.130285]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.130747]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.131201]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.131634]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.132056]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.132470]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.132881]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.133303] BUG: Bad page map in process gunicorn: worke  pte:656e6f6850656d6f pmd:76cbb067
[   10.133722] addr:000000000362f000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:362f
[   10.134574] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.135029] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.135970]  0000000000000000 ffffffff8151fda4 000000000362f000 ffff8800753700d0
[   10.136476]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb178 656e6f6850656d6f
[   10.136981]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000362f000
[   10.137493] Call Trace:
[   10.138013]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.138530]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.139053]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.139562]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.140060]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.140549]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.141036]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.141498]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.141947]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.142379]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.142800]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.143215]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.143627]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.144054] swap_free: Bad swap file entry 1c0166a4a462b7f6
[   10.144459] BUG: Bad page map in process gunicorn: worke  pte:72656d6e75202420 pmd:76cbb067
[   10.144881] addr:0000000003630000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3630
[   10.145752] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.146212] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.147167]  0000000000000000 ffffffff8151fda4 0000000003630000 ffff8800753700d0
[   10.147674]  ffffffff8116f380 000000000000000e ffff880076cbb180 72656d6e75202420
[   10.148201]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003630000
[   10.148718] Call Trace:
[   10.149229]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.149749]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.150270]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[   10.150783]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.151286]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.151771]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.152245]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.152704]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.153214]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.153654]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.154083]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.154531] BUG: Bad page map in process gunicorn: worke  pte:2073747441646567 pmd:76cbb067
[   10.154963] addr:0000000003631000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3631
[   10.155854] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.156323] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.157280]  0000000000000000 ffffffff8151fda4 0000000003631000 ffff8800753700d0
[   10.157789]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb188 2073747441646567
[   10.158322]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003631000
[   10.158851] Call Trace:
[   10.159368]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.159897]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.160427]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.160954]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.161488]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.162006]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.162511]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.163010]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.163488]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.163966]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.164429]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.164869]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.165300]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.165742] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.166165] BUG: Bad page map in process gunicorn: worke  pte:68637845736d2024 pmd:76cbb067
[   10.166602] addr:0000000003632000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3632
[   10.167475] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.167994] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.169003]  0000000000000000 ffffffff8151fda4 0000000003632000 ffff8800753700d0
[   10.169514]  ffffffff8116f380 000000000000000d ffff880076cbb190 68637845736d2024
[   10.170027]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003632000
[   10.170545] Call Trace:
[   10.171056]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.171585]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.172106]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[   10.172618]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.173116]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.173601]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.174074]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.174534]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.174978]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.175410]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.175839]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.176281] BUG: Bad page map in process gunicorn: worke  pte:6f437463656a624f pmd:76cbb067
[   10.176714] addr:0000000003633000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3633
[   10.177592] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.178075] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.179038]  0000000000000000 ffffffff8151fda4 0000000003633000 ffff8800753700d0
[   10.179555]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb198 6f437463656a624f
[   10.180071]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003633000
[   10.180594] Call Trace:
[   10.181118]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.181645]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.182174]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.182697]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.183224]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.183743]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.184259]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.184753]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.185232]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.185700]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.186154]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.186594]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.187030]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.187471] BUG: Bad page map in process gunicorn: worke  pte:61746f7551746e75 pmd:76cbb067
[   10.187935] addr:0000000003634000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3634
[   10.188804] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.189261] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.190202]  0000000000000000 ffffffff8151fda4 0000000003634000 ffff8800753700d0
[   10.190702]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1a0 61746f7551746e75
[   10.191213]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003634000
[   10.191729] Call Trace:
[   10.192235]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.192752]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.193269]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.193785]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.194290]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.194780]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.195261]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.195724]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.196173]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.196606]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.197036]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.197451]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.197876]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.198296] swap_free: Bad swap file entry 180121eea324b7f6
[   10.198701] BUG: Bad page map in process gunicorn: worke  pte:637845736d202420 pmd:76cbb067
[   10.199125] addr:0000000003635000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3635
[   10.200016] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.200476] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.201418]  0000000000000000 ffffffff8151fda4 0000000003635000 ffff8800753700d0
[   10.201921]  ffffffff8116f380 000000000000000c ffff880076cbb1a8 637845736d202420
[   10.202432]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003635000
[   10.202959] Call Trace:
[   10.203468]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.203990]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.204515]  [<ffffffff811707a2>] ? unmap_single_vma+0x4c2/0x830
[   10.205026]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.205524]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.206013]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.206486]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.206944]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.207387]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.207818]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.208267]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.208708] BUG: Bad page map in process gunicorn: worke  pte:54776f6461685368 pmd:76cbb067
[   10.209143] addr:0000000003636000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3636
[   10.210014] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.210481] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.211445]  0000000000000000 ffffffff8151fda4 0000000003636000 ffff8800753700d0
[   10.211957]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1b0 54776f6461685368
[   10.212473]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003636000
[   10.212996] Call Trace:
[   10.213519]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.214155]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.214686]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.215209]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.215763]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.216310]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.216824]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.217318]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.217804]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.218287]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.218743]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.219183]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.219615]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.220066] BUG: Bad page map in process gunicorn: worke  pte:6d202420656c7469 pmd:76cbb067
[   10.220507] addr:0000000003637000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3637
[   10.221377] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.221842] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.222778]  0000000000000000 ffffffff8151fda4 0000000003637000 ffff8800753700d0
[   10.223284]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1b8 6d202420656c7469
[   10.223792]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003637000
[   10.224306] Call Trace:
[   10.224813]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.225344]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.225868]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.226379]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.226878]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.227373]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.227860]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.228325]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.228775]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.229209]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.229630]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.230046]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.230463]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.230891] BUG: Bad page map in process gunicorn: worke  pte:6168536863784573 pmd:76cbb067
[   10.231312] addr:0000000003638000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3638
[   10.232198] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.232657] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.233596]  0000000000000000 ffffffff8151fda4 0000000003638000 ffff8800753700d0
[   10.234096]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1c0 6168536863784573
[   10.234602]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003638000
[   10.235121] Call Trace:
[   10.235629]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.236146]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.236664]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.237174]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.237679]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.238177]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.238652]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.239114]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.239564]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.240002]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.240424]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.240839]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.241256]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.241683] BUG: Bad page map in process gunicorn: worke  pte:6c69626f4d776f64 pmd:76cbb067
[   10.242103] addr:0000000003639000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:3639
[   10.242957] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.243413] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.244356]  0000000000000000 ffffffff8151fda4 0000000003639000 ffff8800753700d0
[   10.244855]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1c8 6c69626f4d776f64
[   10.245361]  0000000000000000 000000000373f000 ffff88006f837dd0 0000000003639000
[   10.245874] Call Trace:
[   10.246380]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.246902]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.247420]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.247944]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.248443]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.248932]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.249406]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.249869]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.250319]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.250752]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.251179]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.251595]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.252007]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.252427] BUG: Bad page map in process gunicorn: worke  pte:7845736d20242065 pmd:76cbb067
[   10.252845] addr:000000000363a000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:363a
[   10.253701] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.254157] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.255099]  0000000000000000 ffffffff8151fda4 000000000363a000 ffff8800753700d0
[   10.255601]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1d0 7845736d20242065
[   10.256107]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000363a000
[   10.256620] Call Trace:
[   10.257126]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.257642]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.258174]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.258685]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.259184]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.259673]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.260147]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.260610]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.261065]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.261498]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.261920]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.262334]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.262745]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.263164] BUG: Bad page map in process gunicorn: worke  pte:533450414d496863 pmd:76cbb067
[   10.263599] addr:000000000363b000 vm_flags:08100073 anon_vma:ffff88007538c470 mapping:          (null) index:363b
[   10.264453] CPU: 1 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.264909] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.265843]  0000000000000000 ffffffff8151fda4 000000000363b000 ffff8800753700d0
[   10.266348]  ffffffff8116f380 ffffffff8116f380 ffff880076cbb1d8 533450414d496863
[   10.266853]  0000000000000000 000000000373f000 ffff88006f837dd0 000000000363b000
[   10.267365] Call Trace:
[   10.267873]  [<ffffffff8151fda4>] ? dump_stack+0x5d/0x78
[   10.268401]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.268919]  [<ffffffff8116f380>] ? print_bad_pte+0x1b0/0x280
[   10.269428]  [<ffffffff811702a7>] ? vm_normal_page+0x87/0xc0
[   10.269927]  [<ffffffff81170820>] ? unmap_single_vma+0x540/0x830
[   10.270417]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.270897]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.271359]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.271809]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.272242]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.272663]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.273078]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.273490]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.273915] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.274322] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.274717] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.275112] swap_free: Bad swap file entry 180121eea324b7f6
[   10.275504] swap_free: Bad swap file entry 180121eea324b7f6
[   10.275910] swap_free: Bad swap file entry 801f6f7e32627a4
[   10.276295] swap_free: Bad swap file entry 180121eea324b7f6
[   10.276676] swap_free: Bad swap file entry 180121eea324b7f6
[   10.277050] swap_free: Bad swap file entry 1a0023e32467a36a
[   10.277422] swap_free: Bad swap file entry 1c00a42762e2ac22
[   10.277791] swap_free: Bad swap file entry 1a0065a2e2e6ab26
[   10.278174] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.278537] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.278892] swap_free: Bad swap file entry 180121eea324b7f6
[   10.279233] swap_free: Bad swap file entry 180121eea324b7f6
[   10.279556] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.279885] swap_free: Bad swap file entry 1a01e721eea324b7
[   10.280177] swap_free: Bad swap file entry 180121eea324b7f6
[   10.280452] swap_free: Bad swap file entry 1e01eea324b7f6f7
[   10.280709] swap_free: Bad swap file entry 1000a324b7f6f7e2
[   10.280951] swap_free: Bad swap file entry 180121eea324b7f6
[   10.281184] swap_free: Bad swap file entry 1e01eea324b7f6f7
[   10.281407] swap_free: Bad swap file entry 1a00a2ac66a46425
[   10.281619] swap_free: Bad swap file entry 1c0126a32326a366
[   10.281824] swap_free: Bad swap file entry 180121eea324b7f6
[   10.282030] swap_free: Bad swap file entry 180121eea324b7f6
[   10.282231] swap_free: Bad swap file entry 18012461a32365ae
[   10.282428] swap_free: Bad swap offset entry 1defef5b5b7e2
[   10.282623] swap_free: Bad swap file entry c0133b3b473f2f1
[   10.282818] swap_free: Bad swap file entry 1000acafac77f332
[   10.283012] swap_free: Bad swap file entry 1801a2e4242777f5
[   10.283202] swap_free: Bad swap file entry 180125a266aee6a4
[   10.283391] swap_free: Bad swap file entry 1c0162a726ab26a4
[   10.283576] swap_free: Bad swap file entry 1800a6a6a5b7f6f7
[   10.283779] swap_free: Bad swap file entry 180125a266aef373
[   10.283960] swap_free: Bad swap file entry 14012ee324b7f6f7
[   10.284135] swap_free: Bad swap file entry 10012aeb6324b7f6
[   10.284301] swap_free: Bad swap file entry 1800ab26a325a363
[   10.284470] swap_free: Bad swap file entry 10012aeb6324b7f6
[   10.285057] stack segment: 0000 [#2] SMP 
[   10.285249] Modules linked in: binfmt_misc ip6table_filter ip6_tables ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_comment xt_multiport xt_conntrack nf_conntrack iptable_filter ip_tables x_tables crc32_pclmul crc32c_intel aesni_intel aes_x86_64 glue_helper lrw vmw_vsock_vmci_transport vsock gf128mul vmw_balloon ppdev evdev ablk_helper cryptd pcspkr serio_raw vmwgfx drm_kms_helper ttm ac processor battery button parport_pc thermal_sys drm parport shpchp vmw_vmci autofs4 ext4 crc16 mbcache jbd2 dm_mod sg sr_mod cdrom sd_mod crc_t10dif crct10dif_generic ata_generic crct10dif_pclmul crct10dif_common psmouse vmxnet3 ata_piix mptspi scsi_transport_spi mptscsih libata i2c_piix4 mptbase scsi_mod i2c_core
[   10.287519] CPU: 2 PID: 717 Comm: gunicorn: worke Tainted: G    B D       3.16.59+ #18
[   10.287874] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 04/05/2016
[   10.288623] task: ffff88007835e090 ti: ffff88006f834000 task.ti: ffff88006f834000
[   10.289024] RIP: 0010:[<ffffffff81184f8c>]  [<ffffffff81184f8c>] free_pages_and_swap_cache+0x5c/0xc0
[   10.289870] RSP: 0018:ffff88006f837c60  EFLAGS: 00010282
[   10.290311] RAX: 000000000000000d RBX: ffff880076d1a010 RCX: 0000000000000000
[   10.290768] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88007fd12140
[   10.291235] RBP: 7265726576696c65 R08: 0000000000000001 R09: 0000000000016ef8
[   10.291702] R10: 0000000000000004 R11: ffffffff8172a2cb R12: ffff880076d1a080
[   10.292179] R13: ffff880076d1a010 R14: 000000000000000e R15: 0000000068637845
[   10.292665] FS:  00007fb4c0ffe700(0000) GS:ffff88007fd00000(0000) knlGS:0000000000000000
[   10.293167] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   10.293687] CR2: 00007f97a8265050 CR3: 000000007ade2000 CR4: 0000000000360770
[   10.294263] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   10.294793] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   10.295316] Stack:
[   10.295839]  ffff880076d1a000 ffff88006f837df8 ffff88006f837dd0 00007fb4bbc00000
[   10.296393]  ffff88006f837dd0 00007fb4bbb9a000 ffffffff8116f05c ffffffffffffffff
[   10.296961]  ffffea000179f040 0000000000000000 ffffffff8117092a ffff8800783cd080
[   10.297531] Call Trace:
[   10.298111]  [<ffffffff8116f05c>] ? tlb_flush_mmu_free+0x2c/0x50
[   10.298694]  [<ffffffff8117092a>] ? unmap_single_vma+0x64a/0x830
[   10.299280]  [<ffffffff81171c6c>] ? unmap_vmas+0x4c/0xa0
[   10.299869]  [<ffffffff8117ad62>] ? exit_mmap+0x92/0x160
[   10.300460]  [<ffffffff81069b4c>] ? mmput+0x5c/0x120
[   10.301060]  [<ffffffff8106f033>] ? do_exit+0x333/0xae0
[   10.301648]  [<ffffffff8151e706>] ? printk+0x4f/0x57
[   10.302226]  [<ffffffff81017697>] ? oops_end+0x97/0xe0
[   10.302786]  [<ffffffff8105b896>] ? __do_page_fault+0x376/0x470
[   10.303333]  [<ffffffff81527f08>] ? page_fault+0x28/0x30
[   10.303863] Code: 00 45 0f 4e f7 45 85 f6 7e 55 41 8d 46 ff 4c 89 eb 4c 8d 24 c5 08 00 00 00 4d 01 ec eb 0a 90 48 83 c3 08 4c 39 e3 74 37 48 8b 2b <48> 8b 45 00 a9 00 00 01 00 74 e9 8b 45 18 85 c0 79 e2 f0 0f ba 
[   10.305611] RIP  [<ffffffff81184f8c>] free_pages_and_swap_cache+0x5c/0xc0
[   10.306580]  RSP <ffff88006f837c60>
[   10.307535] ---[ end trace f863ea854df6c9a6 ]---
[   10.308180] Fixing recursive fault but reboot is needed!

A message that is not in the archive (sent off-list or not yet received): [email protected]

#316 lore raw

Re: [PATCH 3.16 310/366] vmxnet3: fix checks for dma mapping errors

Quoted 30 lines · Thomas Weißschuh

Hi Ben,

I forgot you to Cc: on the following mail:

https://lore.kernel.org/stable/[email protected]/

Thomas

Quoted 21 lines · Thomas Weißschuh
Quoted 1 line

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

Sorry for the late response, this just hit the kernel in Debian Jessie (oldstable) a few days ago.

Quoted 9 lines

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

From: Alexey Khoroshilov <[email protected]>

commit 5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c upstream.

vmxnet3_drv does not check dma_addr with dma_mapping_error() after mapping dma memory. The patch adds the checks and tries to handle failures.

We are seeing kernel panics/machine freezes/BUGs with the new 3.16.64 from Debian. I bisected it with the vanilla stable kernel and it boiled down to this commit. VMs of multiple nodes of our vmware cluster are affected.
The bug can be triggered in multiple ways, I have seen it when an external network request is served, when installing packages over the network and performing a git clone.

[...]

I missed the upstream follow-up to this, which was commit 58caf637365f "Driver: Vmxnet3: Fix regression caused by 5738a09".

I'm attaching a backport of that. I don't have any VMware installation to test on; could you do that?

Ben.

Signature · 3 lines
Ben Hutchings
It is easier to change the specification to fit the program
than vice versa.

From: Shrikrishna Khare <[email protected]>
Date: Wed, 6 Jan 2016 10:44:27 -0800
Subject: Driver: Vmxnet3: Fix regression caused by 5738a09
Origin: https://git.kernel.org/linus/58caf637365fef97c8e84ea5699a8e34d68fce93

[bwh: Backported to 3.16:
- Bump version from 1.2.2.0-k to 1.2.3.0-k, which wasn't used in mainline
- Adjust context, indentation]

---
 drivers/net/vmxnet3/vmxnet3_drv.c | 8 ++++----
 drivers/net/vmxnet3/vmxnet3_int.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +3 -3
@@ -1308,9 +1308,9 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx
 				goto rcd_done;
 			}
 			new_dma_addr = dma_map_page(&adapter->pdev->dev,
-						rbi->page,
-						0, PAGE_SIZE,
-						PCI_DMA_FROMDEVICE);
+						    new_page,
+						    0, PAGE_SIZE,
+						    PCI_DMA_FROMDEVICE);
 			if (dma_mapping_error(&adapter->pdev->dev,
 					      new_dma_addr)) {
 				put_page(new_page);
drivers/net/vmxnet3/vmxnet3_int.h +2 -2
@@ -69,12 +69,12 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.2.2.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.2.3.0-k"
 
 /* Each byte of this 32-bit integer encodes a version number in
  * VMXNET3_DRIVER_VERSION_STRING.
  */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01020200
+#define VMXNET3_DRIVER_VERSION_NUM      0x01020300
 
 #if defined(CONFIG_PCI_MSI)
 	/* RSS only makes sense if MSI-X is supported. */
#317 lore raw

Re: [PATCH 3.16 310/366] vmxnet3: fix checks for dma mapping errors

Hi Ben,

thanks for the prompt reply.

Quoted 31 lines · Ben Hutchings
Quoted 30 lines · Thomas Weißschuh

Hi Ben,

I forgot you to Cc: on the following mail:

https://lore.kernel.org/stable/[email protected]/

Thomas

Quoted 21 lines · Thomas Weißschuh
Quoted 1 line

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

Sorry for the late response, this just hit the kernel in Debian Jessie (oldstable) a few days ago.

Quoted 9 lines

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

From: Alexey Khoroshilov <[email protected]>

commit 5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c upstream.

vmxnet3_drv does not check dma_addr with dma_mapping_error() after mapping dma memory. The patch adds the checks and tries to handle failures.

We are seeing kernel panics/machine freezes/BUGs with the new 3.16.64 from Debian. I bisected it with the vanilla stable kernel and it boiled down to this commit. VMs of multiple nodes of our vmware cluster are affected.
The bug can be triggered in multiple ways, I have seen it when an external network request is served, when installing packages over the network and performing a git clone.

Quoted 7 lines

[...]

I missed the upstream follow-up to this, which was commit 58caf637365f "Driver: Vmxnet3: Fix regression caused by 5738a09".

I'm attaching a backport of that. I don't have any VMware installation to test on; could you do that?

This indeed fixes the issue.

Thomas

#318 lore raw

PATCH 311/366 vmxnet3: avoid assumption about invalid dma_pa in vmxnet3_set_mc()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Alexey Khoroshilov <[email protected]>

commit fb5c6cfaec126d9a96b9dd471d4711bf4c737a6f upstream.

vmxnet3_set_mc() checks new_table_pa returned by dma_map_single() with dma_mapping_error(), but even there it assumes zero is invalid pa (it assumes dma_mapping_error(...,0) returns true if new_table is NULL).

The patch adds an explicit variable to track status of new_table_pa.

Found by Linux Driver Verification project (linuxtesting.org).

v2: use "bool" and "true"/"false" for boolean variables.

---
 drivers/net/vmxnet3/vmxnet3_drv.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +10 -7
@@ -2078,6 +2078,7 @@ vmxnet3_set_mc(struct net_device *netdev
 					&adapter->shared->devRead.rxFilterConf;
 	u8 *new_table = NULL;
 	dma_addr_t new_table_pa = 0;
+	bool new_table_pa_valid = false;
 	u32 new_mode = VMXNET3_RXM_UCAST;
 
 	if (netdev->flags & IFF_PROMISC) {
@@ -2105,13 +2106,15 @@ vmxnet3_set_mc(struct net_device *netdev
 							new_table,
 							rxConf->mfTableLen,
 							PCI_DMA_TODEVICE);
+				if (!dma_mapping_error(&adapter->pdev->dev,
+						       new_table_pa)) {
+					new_mode |= VMXNET3_RXM_MCAST;
+					new_table_pa_valid = true;
+					rxConf->mfTablePA = cpu_to_le64(
+								new_table_pa);
+				}
 			}
-
-			if (!dma_mapping_error(&adapter->pdev->dev,
-					       new_table_pa)) {
-				new_mode |= VMXNET3_RXM_MCAST;
-				rxConf->mfTablePA = cpu_to_le64(new_table_pa);
-			} else {
+			if (!new_table_pa_valid) {
 				netdev_info(netdev,
 					    "failed to copy mcast list, setting ALL_MULTI\n");
 				new_mode |= VMXNET3_RXM_ALL_MULTI;
@@ -2136,7 +2139,7 @@ vmxnet3_set_mc(struct net_device *netdev
 			       VMXNET3_CMD_UPDATE_MAC_FILTERS);
 	spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
-	if (new_table_pa)
+	if (new_table_pa_valid)
 		dma_unmap_single(&adapter->pdev->dev, new_table_pa,
 				 rxConf->mfTableLen, PCI_DMA_TODEVICE);
 	kfree(new_table);
#319 lore raw

PATCH 312/366 vmxnet3: set the DMA mask before the first DMA map operation

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: "[email protected]" <[email protected]>

commit 61aeecea40afb2b89933e27cd4adb10fc2e75cfd upstream.

The DMA mask must be set before, not after, the first DMA map operation, or the first DMA map operation could in theory fail on some systems.

Fixes b0eb57cb97e78 ("VMXNET3: Add support for virtual IOMMU")

[bwh: Backported to 3.16: Bump version from 1.2.1.0-k to 1.2.2.0-k, which
wasn't used in mainline]

---
 drivers/net/vmxnet3/vmxnet3_drv.c | 50 +++++++++++++++----------------
 drivers/net/vmxnet3/vmxnet3_int.h |  8 +++--
 2 files changed, 30 insertions(+), 28 deletions(-)
drivers/net/vmxnet3/vmxnet3_drv.c +25 -25
@@ -2445,7 +2445,7 @@ vmxnet3_set_mac_addr(struct net_device *
 /* ==================== initialization and cleanup routines ============ */
 
 static int
-vmxnet3_alloc_pci_resources(struct vmxnet3_adapter *adapter, bool *dma64)
+vmxnet3_alloc_pci_resources(struct vmxnet3_adapter *adapter)
 {
 	int err;
 	unsigned long mmio_start, mmio_len;
@@ -2457,30 +2457,12 @@ vmxnet3_alloc_pci_resources(struct vmxne
 		return err;
 	}
 
-	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) == 0) {
-		if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) {
-			dev_err(&pdev->dev,
-				"pci_set_consistent_dma_mask failed\n");
-			err = -EIO;
-			goto err_set_mask;
-		}
-		*dma64 = true;
-	} else {
-		if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) {
-			dev_err(&pdev->dev,
-				"pci_set_dma_mask failed\n");
-			err = -EIO;
-			goto err_set_mask;
-		}
-		*dma64 = false;
-	}
-
 	err = pci_request_selected_regions(pdev, (1 << 2) - 1,
 					   vmxnet3_driver_name);
 	if (err) {
 		dev_err(&pdev->dev,
 			"Failed to request region for adapter: error %d\n", err);
-		goto err_set_mask;
+		goto err_enable_device;
 	}
 
 	pci_set_master(pdev);
@@ -2508,7 +2490,7 @@ err_bar1:
 	iounmap(adapter->hw_addr0);
 err_ioremap:
 	pci_release_selected_regions(pdev, (1 << 2) - 1);
-err_set_mask:
+err_enable_device:
 	pci_disable_device(pdev);
 	return err;
 }
@@ -2973,7 +2955,7 @@ vmxnet3_probe_device(struct pci_dev *pde
 #endif
 	};
 	int err;
-	bool dma64 = false; /* stupid gcc */
+	bool dma64;
 	u32 ver;
 	struct net_device *netdev;
 	struct vmxnet3_adapter *adapter;
@@ -3018,6 +3000,24 @@ vmxnet3_probe_device(struct pci_dev *pde
 	adapter->tx_ring_size = VMXNET3_DEF_TX_RING_SIZE;
 	adapter->rx_ring_size = VMXNET3_DEF_RX_RING_SIZE;
 
+	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) == 0) {
+		if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) {
+			dev_err(&pdev->dev,
+				"pci_set_consistent_dma_mask failed\n");
+			err = -EIO;
+			goto err_set_mask;
+		}
+		dma64 = true;
+	} else {
+		if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) {
+			dev_err(&pdev->dev,
+				"pci_set_dma_mask failed\n");
+			err = -EIO;
+			goto err_set_mask;
+		}
+		dma64 = false;
+	}
+
 	spin_lock_init(&adapter->cmd_lock);
 	adapter->adapter_pa = dma_map_single(&adapter->pdev->dev, adapter,
 					     sizeof(struct vmxnet3_adapter),
@@ -3025,7 +3025,7 @@ vmxnet3_probe_device(struct pci_dev *pde
 	if (dma_mapping_error(&adapter->pdev->dev, adapter->adapter_pa)) {
 		dev_err(&pdev->dev, "Failed to map dma\n");
 		err = -EFAULT;
-		goto err_dma_map;
+		goto err_set_mask;
 	}
 	adapter->shared = dma_alloc_coherent(
 				&adapter->pdev->dev,
@@ -3076,7 +3076,7 @@ vmxnet3_probe_device(struct pci_dev *pde
 	}
 #endif /* VMXNET3_RSS */
 
-	err = vmxnet3_alloc_pci_resources(adapter, &dma64);
+	err = vmxnet3_alloc_pci_resources(adapter);
 	if (err < 0)
 		goto err_alloc_pci;
 
@@ -3180,7 +3180,7 @@ err_alloc_queue_desc:
 err_alloc_shared:
 	dma_unmap_single(&adapter->pdev->dev, adapter->adapter_pa,
 			 sizeof(struct vmxnet3_adapter), PCI_DMA_TODEVICE);
-err_dma_map:
+err_set_mask:
 	free_netdev(netdev);
 	return err;
 }
drivers/net/vmxnet3/vmxnet3_int.h +5 -3
@@ -69,10 +69,12 @@
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.2.1.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.2.2.0-k"
 
-/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01020100
+/* Each byte of this 32-bit integer encodes a version number in
+ * VMXNET3_DRIVER_VERSION_STRING.
+ */
+#define VMXNET3_DRIVER_VERSION_NUM      0x01020200
 
 #if defined(CONFIG_PCI_MSI)
 	/* RSS only makes sense if MSI-X is supported. */
#320 lore raw

PATCH 313/366 mmap: introduce sane default mmap limits

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Linus Torvalds <[email protected]>

commit be83bbf806822b1b89e0a0f23cd87cddc409e429 upstream.

The internal VM "mmap()" interfaces are based on the mmap target doing everything using page indexes rather than byte offsets, because traditionally (ie 32-bit) we had the situation that the byte offset didn't fit in a register. So while the mmap virtual address was limited by the word size of the architecture, the backing store was not.

So we're basically passing "pgoff" around as a page index, in order to be able to describe backing store locations that are much bigger than the word size (think files larger than 4GB etc).

But while this all makes a ton of sense conceptually, we've been dogged by various drivers that don't really understand this, and internally work with byte offsets, and then try to work with the page index by turning it into a byte offset with "pgoff << PAGE_SHIFT".

Which obviously can overflow.

Adding the size of the mapping to it to get the byte offset of the end of the backing store just exacerbates the problem, and if you then use this overflow-prone value to check various limits of your device driver mmap capability, you're just setting yourself up for problems.

The correct thing for drivers to do is to do their limit math in page indices, the way the interface is designed. Because the generic mmap code _does_ test that the index doesn't overflow, since that's what the mmap code really cares about.

HOWEVER.

Finding and fixing various random drivers is a sisyphean task, so let's just see if we can just make the core mmap() code do the limiting for us. Realistically, the only "big" backing stores we need to care about are regular files and block devices, both of which are known to do this properly, and which have nice well-defined limits for how much data they can access.

So let's special-case just those two known cases, and then limit other random mmap users to a backing store that still fits in "unsigned long". Realistically, that's not much of a limit at all on 64-bit, and on 32-bit architectures the only worry might be the GPU drivers, which can have big physical address spaces.

To make it possible for drivers like that to say that they are 64-bit clean, this patch does repurpose the "FMODE_UNSIGNED_OFFSET" bit in the file flags to allow drivers to mark their file descriptors as safe in the full 64-bit mmap address space.

[ The timing for doing this is less than optimal, and this should really
go in a merge window. But realistically, this needs wide testing more than it needs anything else, and being main-line is the only way to do that.

So the earlier the better, even if it's outside the proper development
cycle - Linus ]

Cc Kees Cook <[email protected]>
Cc Dan Carpenter <[email protected]>
Cc Al Viro <[email protected]>
Cc Willy Tarreau <[email protected]>
Cc Dave Airlie <[email protected]>
---
 mm/mmap.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
mm/mmap.c +32 -0
@@ -1234,6 +1234,35 @@ static inline int mlock_future_check(str
 	return 0;
 }
 
+static inline u64 file_mmap_size_max(struct file *file, struct inode *inode)
+{
+	if (S_ISREG(inode->i_mode))
+		return inode->i_sb->s_maxbytes;
+
+	if (S_ISBLK(inode->i_mode))
+		return MAX_LFS_FILESIZE;
+
+	/* Special "we do even unsigned file positions" case */
+	if (file->f_mode & FMODE_UNSIGNED_OFFSET)
+		return 0;
+
+	/* Yes, random drivers might want more. But I'm tired of buggy drivers */
+	return ULONG_MAX;
+}
+
+static inline bool file_mmap_ok(struct file *file, struct inode *inode,
+				unsigned long pgoff, unsigned long len)
+{
+	u64 maxsize = file_mmap_size_max(file, inode);
+
+	if (maxsize && len > maxsize)
+		return false;
+	maxsize -= len;
+	if (pgoff > maxsize >> PAGE_SHIFT)
+		return false;
+	return true;
+}
+
 /*
  * The caller must hold down_write(&current->mm->mmap_sem).
  */
@@ -1301,6 +1330,9 @@ unsigned long do_mmap_pgoff(struct file
 	if (file) {
 		struct inode *inode = file_inode(file);
 
+		if (!file_mmap_ok(file, inode, pgoff, len))
+			return -EOVERFLOW;
+
 		switch (flags & MAP_TYPE) {
 		case MAP_SHARED:
 			if ((prot&PROT_WRITE) && !(file->f_mode&FMODE_WRITE))
#321 lore raw

PATCH 314/366 drm: set FMODE_UNSIGNED_OFFSET for drm files

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Dave Airlie <[email protected]>

commit 76ef6b28ea4f81c3d511866a9b31392caa833126 upstream.

Since we have the ttm and gem vma managers using a subset of the file address space for objects, and these start at 0x100000000 they will overflow the new mmap checks.

I've checked all the mmap routines I could see for any bad behaviour but overall most people use GEM/TTM VMA managers even the legacy drivers have a hashtable.

Reported-and-Tested-by Arthur Marsh (amarsh04 on #radeon)
Fixes be83bbf8068 (mmap: introduce sane default mmap limits)
[bwh: Backported to 3.16: adjust filename]
---
 drivers/gpu/drm/drm_fops.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_fops.c +1 -0
@@ -251,6 +251,7 @@ static int drm_open_helper(struct file *
 		return -ENOMEM;
 
 	filp->private_data = priv;
+	filp->f_mode |= FMODE_UNSIGNED_OFFSET;
 	priv->filp = filp;
 	priv->uid = current_euid();
 	priv->pid = get_pid(task_pid(current));
#322 lore raw

PATCH 315/366 mmap: relax file size limit for regular files

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Linus Torvalds <[email protected]>

commit 423913ad4ae5b3e8fb8983f70969fb522261ba26 upstream.

Commit be83bbf80682 ("mmap: introduce sane default mmap limits") was introduced to catch problems in various ad-hoc character device drivers doing mmap and getting the size limits wrong. In the process, it used "known good" limits for the normal cases of mapping regular files and block device drivers.

It turns out that the "s_maxbytes" limit was less "known good" than I thought. In particular, /proc doesn't set it, but exposes one regular file to mmap: /proc/vmcore. As a result, that file got limited to the default MAX_INT s_maxbytes value.

This went unnoticed for a while, because apparently the only thing that needs it is the s390 kernel zfcpdump, but there might be other tools that use this too.

Vasily suggested just changing s_maxbytes for all of /proc, which isn't wrong, but makes me nervous at this stage. So instead, just make the new mmap limit always be MAX_LFS_FILESIZE for regular files, which won't affect anything else. It wasn't the regular file case I was worried about.

I'd really prefer for maxsize to have been per-inode, but that is not how things are today.

Fixes be83bbf80682 ("mmap: introduce sane default mmap limits")
Cc Al Viro <[email protected]>
---
 mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mmap.c +1 -1
@@ -1237,7 +1237,7 @@ static inline int mlock_future_check(str
 static inline u64 file_mmap_size_max(struct file *file, struct inode *inode)
 {
 	if (S_ISREG(inode->i_mode))
-		return inode->i_sb->s_maxbytes;
+		return MAX_LFS_FILESIZE;
 
 	if (S_ISBLK(inode->i_mode))
 		return MAX_LFS_FILESIZE;
#323 lore raw

PATCH 316/366 s390/qdio: fix access to uninitialized qdio_q fields

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Julian Wiedmann <[email protected]>

commit e521813468f786271a87e78e8644243bead48fad upstream.

Ever since CQ/QAOB support was added, calling qdio_free() straight after qdio_alloc() results in qdio_release_memory() accessing uninitialized memory (ie. q->u.out.use_cq and q->u.out.aobs). Followed by a kmem_cache_free() on the random AOB addresses.

For older kernels that don't have 6e30c549f6ca, the same applies if qdio_establish() fails in the DEV_STATE_ONLINE check.

While initializing q->u.out.use_cq would be enough to fix this particular bug, the more future-proof change is to just zero-alloc the whole struct.

Fixes 104ea556ee7f ("qdio: support asynchronous delivery of storage blocks")
---
 drivers/s390/cio/qdio_setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/cio/qdio_setup.c +1 -1
@@ -90,7 +90,7 @@ static int __qdio_allocate_qs(struct qdi
 	int i;
 
 	for (i = 0; i < nr_queues; i++) {
-		q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL);
+		q = kmem_cache_zalloc(qdio_q_cache, GFP_KERNEL);
 		if (!q)
 			return -ENOMEM;
 
#324 lore raw

PATCH 317/366 s390/qdio: don't release memory in qdio_setup_irq()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Julian Wiedmann <[email protected]>

commit 2e68adcd2fb21b7188ba449f0fab3bee2910e500 upstream.

Calling qdio_release_memory() on error is just plain wrong. It frees the main qdio_irq struct, when following code still uses it.

Also, no other error path in qdio_establish() does this. So trust callers to clean up via qdio_free() if some step of the QDIO initialization fails.

Fixes 779e6e1c724d ("[S390] qdio: new qdio driver.")
---
 drivers/s390/cio/qdio_setup.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/s390/cio/qdio_setup.c +2 -8
@@ -406,7 +406,6 @@ int qdio_setup_irq(struct qdio_initializ
 {
 	struct ciw *ciw;
 	struct qdio_irq *irq_ptr = init_data->cdev->private->qdio_data;
-	int rc;
 
 	memset(&irq_ptr->qib, 0, sizeof(irq_ptr->qib));
 	memset(&irq_ptr->siga_flag, 0, sizeof(irq_ptr->siga_flag));
@@ -443,16 +442,14 @@ int qdio_setup_irq(struct qdio_initializ
 	ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE);
 	if (!ciw) {
 		DBF_ERROR("%4x NO EQ", irq_ptr->schid.sch_no);
-		rc = -EINVAL;
-		goto out_err;
+		return -EINVAL;
 	}
 	irq_ptr->equeue = *ciw;
 
 	ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE);
 	if (!ciw) {
 		DBF_ERROR("%4x NO AQ", irq_ptr->schid.sch_no);
-		rc = -EINVAL;
-		goto out_err;
+		return -EINVAL;
 	}
 	irq_ptr->aqueue = *ciw;
 
@@ -460,9 +457,6 @@ int qdio_setup_irq(struct qdio_initializ
 	irq_ptr->orig_handler = init_data->cdev->handler;
 	init_data->cdev->handler = qdio_int_handler;
 	return 0;
-out_err:
-	qdio_release_memory(irq_ptr);
-	return rc;
 }
 
 void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
#325 lore raw

PATCH 318/366 i2c: pmcmsp: return message count on master_xfer success

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Peter Rosin <[email protected]>

commit de9a8634f1cb4560a35696d472cc7f1383d9b866 upstream.

Returning zero is wrong in this case.

Fixes 1b144df1d7d6 ("i2c: New PMC MSP71xx TWI bus driver")
---
 drivers/i2c/busses/i2c-pmcmsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-pmcmsp.c +1 -1
@@ -599,7 +599,7 @@ static int pmcmsptwi_master_xfer(struct
 		return -1;
 	}
 
-	return 0;
+	return num;
 }
 
 static u32 pmcmsptwi_i2c_func(struct i2c_adapter *adapter)
#326 lore raw

PATCH 319/366 i2c: pmcmsp: fix error return from master_xfer

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Peter Rosin <[email protected]>

commit 12d9bbc5a7f347eaa65ff2a9d34995cadc05eb1b upstream.

Returning -1 (-EPERM) is not appropriate here, go with -EIO.

Fixes 1b144df1d7d6 ("i2c: New PMC MSP71xx TWI bus driver")
---
 drivers/i2c/busses/i2c-pmcmsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-pmcmsp.c +1 -1
@@ -596,7 +596,7 @@ static int pmcmsptwi_master_xfer(struct
 		 * TODO: We could potentially loop and retry in the case
 		 * of MSP_TWI_XFER_TIMEOUT.
 		 */
-		return -1;
+		return -EIO;
 	}
 
 	return num;
#327 lore raw

PATCH 320/366 i2c: viperboard: return message count on master_xfer success

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Peter Rosin <[email protected]>

commit 35cd67a0caf767aba472452865dcb4471fcce2b1 upstream.

Returning zero is wrong in this case.

Fixes 174a13aa8669 ("i2c: Add viperboard i2c master driver")
---
 drivers/i2c/busses/i2c-viperboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-viperboard.c +1 -1
@@ -341,7 +341,7 @@ static int vprbrd_i2c_xfer(struct i2c_ad
 		}
 		mutex_unlock(&vb->lock);
 	}
-	return 0;
+	return num;
 error:
 	mutex_unlock(&vb->lock);
 	return error;
#328 lore raw

PATCH 321/366 ARM: davinci: board-dm646x-evm: set VPIF capture card name

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Sekhar Nori <[email protected]>

commit bb7298a7e87cf3430eb62be8746e5d7a07ca9d7c upstream.

VPIF capture driver expects card name to be set since it uses it without checking for NULL. The commit which introduced VPIF display and capture support added card name only for display, not for capture.

Set it in platform data to probe driver successfully.

While at it, also fix the display card name to something more appropriate.

Fixes 85609c1ccda6 ("DaVinci: DM646x - platform changes for vpif capture and display drivers")
---
 arch/arm/mach-davinci/board-dm646x-evm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/board-dm646x-evm.c +2 -1
@@ -541,7 +541,7 @@ static struct vpif_display_config dm646x
 		.outputs = dm6467_ch0_outputs,
 		.output_count = ARRAY_SIZE(dm6467_ch0_outputs),
 	},
-	.card_name	= "DM646x EVM",
+	.card_name	= "DM646x EVM Video Display",
 };
 
 /**
@@ -699,6 +699,7 @@ static struct vpif_capture_config dm646x
 			.fid_pol = 0,
 		},
 	},
+	.card_name = "DM646x EVM Video Capture",
 };
 
 static void __init evm_init_video(void)
#329 lore raw

PATCH 322/366 tick/broadcast: Use for_each_cpu() specially on UP kernels

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Dexuan Cui <[email protected]>

commit 5596fe34495cf0f645f417eb928ef224df3e3cb4 upstream.

for_each_cpu() unintuitively reports CPU0 as set independent of the actual cpumask content on UP kernels. This causes an unexpected PIT interrupt storm on a UP kernel running in an SMP virtual machine on Hyper-V, and as a result, the virtual machine can suffer from a strange random delay of 1~20 minutes during boot-up, and sometimes it can hang forever.

Protect if by checking whether the cpumask is empty before entering the for_each_cpu() loop.

[ tglx: Use !IS_ENABLED(CONFIG_SMP) instead of #ifdeffery ]

---
 kernel/time/tick-broadcast.c | 8 ++++++++
 1 file changed, 8 insertions(+)
kernel/time/tick-broadcast.c +8 -0
@@ -585,6 +585,14 @@ again:
 	now = ktime_get();
 	/* Find all expired events */
 	for_each_cpu(cpu, tick_broadcast_oneshot_mask) {
+		/*
+		 * Required for !SMP because for_each_cpu() reports
+		 * unconditionally CPU0 as set on UP kernels.
+		 */
+		if (!IS_ENABLED(CONFIG_SMP) &&
+		    cpumask_empty(tick_broadcast_oneshot_mask))
+			break;
+
 		td = &per_cpu(tick_cpu_device, cpu);
 		if (td->evtdev->next_event.tv64 <= now.tv64) {
 			cpumask_set_cpu(cpu, tmpmask);
#330 lore raw

PATCH 323/366 tcp: purge write queue in tcp_connect_init()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Eric Dumazet <[email protected]>

commit 7f582b248d0a86bae5788c548d7bb5bca6f7691a upstream.

syzkaller found a reliable way to crash the host, hitting a BUG() in __tcp_retransmit_skb()

Malicous MSG_FASTOPEN is the root cause. We need to purge write queue in tcp_connect_init() at the point we init snd_una/write_seq.

This patch also replaces the BUG() by a less intrusive WARN_ON_ONCE()

kernel BUG at net/ipv4/tcp_output.c:2837!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)

Modules linked in:
CPU: 0 PID: 5276 Comm: syz-executor0 Not tainted 4.17.0-rc3+ #51
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__tcp_retransmit_skb+0x2992/0x2eb0 net/ipv4/tcp_output.c:2837
RSP: 0000:ffff8801dae06ff8 EFLAGS: 00010206
RAX: ffff8801b9fe61c0 RBX: 00000000ffc18a16 RCX: ffffffff864e1a49
RDX: 0000000000000100 RSI: ffffffff864e2e12 RDI: 0000000000000005
RBP: ffff8801dae073a0 R08: ffff8801b9fe61c0 R09: ffffed0039c40dd2
R10: ffffed0039c40dd2 R11: ffff8801ce206e93 R12: 00000000421eeaad
R13: ffff8801ce206d4e R14: ffff8801ce206cc0 R15: ffff8801cd4f4a80
FS:  0000000000000000(0000) GS:ffff8801dae00000(0063) knlGS:00000000096bc900
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 0000000020000000 CR3: 00000001c47b6000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 tcp_retransmit_skb+0x2e/0x250 net/ipv4/tcp_output.c:2923
 tcp_retransmit_timer+0xc50/0x3060 net/ipv4/tcp_timer.c:488
 tcp_write_timer_handler+0x339/0x960 net/ipv4/tcp_timer.c:573
 tcp_write_timer+0x111/0x1d0 net/ipv4/tcp_timer.c:593
 call_timer_fn+0x230/0x940 kernel/time/timer.c:1326
 expire_timers kernel/time/timer.c:1363 [inline]
 __run_timers+0x79e/0xc50 kernel/time/timer.c:1666
 run_timer_softirq+0x4c/0x70 kernel/time/timer.c:1692
 __do_softirq+0x2e0/0xaf5 kernel/softirq.c:285
 invoke_softirq kernel/softirq.c:365 [inline]
 irq_exit+0x1d1/0x200 kernel/softirq.c:405
 exiting_irq arch/x86/include/asm/apic.h:525 [inline]
 smp_apic_timer_interrupt+0x17e/0x710 arch/x86/kernel/apic/apic.c:1052
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863
Fixes cf60af03ca4e ("net-tcp: Fast Open client - sendmsg(MSG_FASTOPEN)")
Cc Yuchung Cheng <[email protected]>
Cc Neal Cardwell <[email protected]>
---
 net/ipv4/tcp_output.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/ipv4/tcp_output.c +5 -2
@@ -2450,8 +2450,10 @@ int __tcp_retransmit_skb(struct sock *sk
 		return -EBUSY;
 
 	if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) {
-		if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
-			BUG();
+		if (unlikely(before(TCP_SKB_CB(skb)->end_seq, tp->snd_una))) {
+			WARN_ON_ONCE(1);
+			return -EINVAL;
+		}
 		if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq))
 			return -ENOMEM;
 	}
@@ -2948,6 +2950,7 @@ static void tcp_connect_init(struct sock
 	sock_reset_flag(sk, SOCK_DONE);
 	tp->snd_wnd = 0;
 	tcp_init_wl(tp, 0);
+	tcp_write_queue_purge(sk);
 	tp->snd_una = tp->write_seq;
 	tp->snd_sml = tp->write_seq;
 	tp->snd_up = tp->write_seq;
#331 lore raw

PATCH 324/366 afs: Ignore AFS_ACE_READ and AFS_ACE_WRITE for directories

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Marc Dionne <[email protected]>

commit fd2498211a551fd42b2d6b9050d649d43536e75c upstream.

The AFS_ACE_READ and AFS_ACE_WRITE permission bits should not be used to make access decisions for the directory itself. They are meant to control access for the objects contained in that directory.

Reading a directory is allowed if the AFS_ACE_LOOKUP bit is set. This would cause an incorrect access denied error for a directory with AFS_ACE_LOOKUP but not AFS_ACE_READ.

The AFS_ACE_WRITE bit does not allow operations that modify the directory. For a directory with AFS_ACE_WRITE but neither AFS_ACE_INSERT nor AFS_ACE_DELETE, this would result in trying operations that would ultimately be denied by the server.

---
 fs/afs/security.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/afs/security.c +2 -3
@@ -327,12 +327,11 @@ int afs_permission(struct inode *inode,
 			if (!(access & AFS_ACE_LOOKUP))
 				goto permission_denied;
 		} else if (mask & MAY_READ) {
-			if (!(access & AFS_ACE_READ))
+			if (!(access & AFS_ACE_LOOKUP))
 				goto permission_denied;
 		} else if (mask & MAY_WRITE) {
 			if (!(access & (AFS_ACE_DELETE | /* rmdir, unlink, rename from */
-					AFS_ACE_INSERT | /* create, mkdir, symlink, rename to */
-					AFS_ACE_WRITE))) /* chmod */
+					AFS_ACE_INSERT))) /* create, mkdir, symlink, rename to */
 				goto permission_denied;
 		} else {
 			BUG();
#332 lore raw

PATCH 325/366 afs: Fix directory permissions check

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: David Howells <[email protected]>

commit 378831e4daec75fbba6d3612bcf3b4dd00ddbf08 upstream.

Doing faccessat("/afs/some/directory", 0) triggers a BUG in the permissions check code.

Fix this by just removing the BUG section. If no permissions are asked for, just return okay if the file exists.

Also:

(1) Split up the directory check so that it has separate if-statements rather than if-else-if (e.g. checking for MAY_EXEC shouldn't skip the check for MAY_READ and MAY_WRITE).

(2) Check for MAY_CHDIR as MAY_EXEC.

Without the main fix, the following BUG may occur:

kernel BUG at fs/afs/security.c:386!
invalid opcode: 0000 [#1] SMP PTI
...

 RIP: 0010:afs_permission+0x19d/0x1a0 [kafs]
 ...
 Call Trace:
  ? inode_permission+0xbe/0x180
  ? do_faccessat+0xdc/0x270
  ? do_syscall_64+0x60/0x1f0
  ? entry_SYSCALL_64_after_hwframe+0x49/0xbe
Fixes 00d3b7a4533e ("[AFS]: Add security support.")
---
 fs/afs/security.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
fs/afs/security.c +3 -7
@@ -323,18 +323,14 @@ int afs_permission(struct inode *inode,
 	       mask, access, S_ISDIR(inode->i_mode) ? "dir" : "file");
 
 	if (S_ISDIR(inode->i_mode)) {
-		if (mask & MAY_EXEC) {
+		if (mask & (MAY_EXEC | MAY_READ | MAY_CHDIR)) {
 			if (!(access & AFS_ACE_LOOKUP))
 				goto permission_denied;
-		} else if (mask & MAY_READ) {
-			if (!(access & AFS_ACE_LOOKUP))
-				goto permission_denied;
-		} else if (mask & MAY_WRITE) {
+		}
+		if (mask & MAY_WRITE) {
 			if (!(access & (AFS_ACE_DELETE | /* rmdir, unlink, rename from */
 					AFS_ACE_INSERT))) /* create, mkdir, symlink, rename to */
 				goto permission_denied;
-		} else {
-			BUG();
 		}
 	} else {
 		if (!(access & AFS_ACE_LOOKUP))
#333 lore raw

PATCH 326/366 Make asm/word-at-a-time.h available on all architectures

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Chris Metcalf <[email protected]>

commit a6e2f029ae34f41adb6ae3812c32c5d326e1abd2 upstream.

Added the x86 implementation of word-at-a-time to the generic version, which previously only supported big-endian.

Omitted the x86-specific load_unaligned_zeropad(), which in any case is also not present for the existing BE-only implementation of a word-at-a-time, and is only used under CONFIG_DCACHE_WORD_ACCESS.

Added as a "generic-y" to the Kbuilds of all architectures that didn't previously have it.

[bwh: Backported to 3.16:
- Drop change in arch/nios2
- Adjust context]

---

arch/arc/include/asm/Kbuild +1 -0
@@ -49,4 +49,5 @@ generic-y += types.h
 generic-y += ucontext.h
 generic-y += user.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/avr32/include/asm/Kbuild +1 -0
@@ -20,4 +20,5 @@ generic-y += sections.h
 generic-y += topology.h
 generic-y += trace_clock.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/blackfin/include/asm/Kbuild +1 -0
@@ -46,4 +46,5 @@ generic-y += types.h
 generic-y += ucontext.h
 generic-y += unaligned.h
 generic-y += user.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/c6x/include/asm/Kbuild +1 -0
@@ -58,4 +58,5 @@ generic-y += types.h
 generic-y += ucontext.h
 generic-y += user.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/cris/include/asm/Kbuild +1 -0
@@ -15,4 +15,5 @@ generic-y += module.h
 generic-y += preempt.h
 generic-y += trace_clock.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/frv/include/asm/Kbuild +1 -0
@@ -6,3 +6,4 @@ generic-y += hash.h
 generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
arch/hexagon/include/asm/Kbuild +1 -0
@@ -58,4 +58,5 @@ generic-y += types.h
 generic-y += ucontext.h
 generic-y += unaligned.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/ia64/include/asm/Kbuild +1 -0
@@ -7,3 +7,4 @@ generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += trace_clock.h
 generic-y += vtime.h
+generic-y += word-at-a-time.h
arch/m32r/include/asm/Kbuild +1 -0
@@ -7,3 +7,4 @@ generic-y += mcs_spinlock.h
 generic-y += module.h
 generic-y += preempt.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
arch/metag/include/asm/Kbuild +1 -0
@@ -54,4 +54,5 @@ generic-y += ucontext.h
 generic-y += unaligned.h
 generic-y += user.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/microblaze/include/asm/Kbuild +1 -0
@@ -9,3 +9,4 @@ generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += syscalls.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
arch/mips/include/asm/Kbuild +1 -0
@@ -15,4 +15,5 @@ generic-y += segment.h
 generic-y += serial.h
 generic-y += trace_clock.h
 generic-y += ucontext.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/mn10300/include/asm/Kbuild +1 -0
@@ -7,3 +7,4 @@ generic-y += hash.h
 generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
arch/powerpc/include/asm/Kbuild +1 -0
@@ -6,3 +6,4 @@ generic-y += preempt.h
 generic-y += rwsem.h
 generic-y += trace_clock.h
 generic-y += vtime.h
+generic-y += word-at-a-time.h
arch/s390/include/asm/Kbuild +1 -0
@@ -5,3 +5,4 @@ generic-y += hash.h
 generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
arch/score/include/asm/Kbuild +1 -0
@@ -10,3 +10,4 @@ generic-y += mcs_spinlock.h
 generic-y += preempt.h
 generic-y += trace_clock.h
 generic-y += xor.h
+generic-y += word-at-a-time.h
arch/tile/include/asm/Kbuild +1 -0
@@ -40,4 +40,5 @@ generic-y += termbits.h
 generic-y += termios.h
 generic-y += trace_clock.h
 generic-y += types.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/um/include/asm/Kbuild +1 -0
@@ -25,4 +25,5 @@ generic-y += sections.h
 generic-y += switch_to.h
 generic-y += topology.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/unicore32/include/asm/Kbuild +1 -0
@@ -62,4 +62,5 @@ generic-y += ucontext.h
 generic-y += unaligned.h
 generic-y += user.h
 generic-y += vga.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
arch/xtensa/include/asm/Kbuild +1 -0
@@ -29,4 +29,5 @@ generic-y += statfs.h
 generic-y += termios.h
 generic-y += topology.h
 generic-y += trace_clock.h
+generic-y += word-at-a-time.h
 generic-y += xor.h
include/asm-generic/word-at-a-time.h +72 -8

91 lines not on this page · raw message

#334 lore raw

PATCH 327/366 word-at-a-time.h: fix some Kbuild files

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Chris Metcalf <[email protected]>

commit 19c22f3a29fa8669c477f20a65f6c7c27108972a upstream.

arch/tile added word-at-a-time.h after the patch that added generic-y entries; the generic-y entry is now stale.

arch/h8300 is newer than the generic-y patch for word-at-a-time.h, and needs a generic-y entry.

arch/powerpc seems to have gotten a generic-y entry by mistake in the first patch; this change removes it.

[bwh: Backported to 3.16:
- Drop change in arch/h8300, which doesn't exist here
- Drop change in arch/tile, which is still using the generic implementation]

---

arch/powerpc/include/asm/Kbuild +0 -1
@@ -6,4 +6,3 @@ generic-y += preempt.h
 generic-y += rwsem.h
 generic-y += trace_clock.h
 generic-y += vtime.h
-generic-y += word-at-a-time.h
#335 lore raw

PATCH 328/366 string: provide strscpy()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Chris Metcalf <[email protected]>

commit 30035e45753b708e7d47a98398500ca005e02b86 upstream.

The strscpy() API is intended to be used instead of strlcpy(), and instead of most uses of strncpy().

- Unlike strlcpy(), it doesn't read from memory beyond (src + size).

- Unlike strlcpy() or strncpy(), the API provides an easy way to check for destination buffer overflow: an -E2BIG error return value.

- The provided implementation is robust in the face of the source buffer being asynchronously changed during the copy, unlike the current implementation of strlcpy().

- Unlike strncpy(), the destination buffer will be NUL-terminated if the string in the source buffer is too long.

- Also unlike strncpy(), the destination buffer will not be updated beyond the NUL termination, avoiding strncpy's behavior of zeroing the entire tail end of the destination buffer. (A memset() after the strscpy() can be used if this behavior is desired.)

- The implementation should be reasonably performant on all platforms since it uses the asm/word-at-a-time.h API rather than simple byte copy. Kernel-to-kernel string copy is not considered to be performance critical in any case.

[bwh: Backported to 3.16: adjust context]
---
 include/linux/string.h |  3 ++
 lib/string.c           | 88 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 91 insertions(+)
include/linux/string.h +3 -0
@@ -25,6 +25,9 @@ extern char * strncpy(char *,const char
 #ifndef __HAVE_ARCH_STRLCPY
 size_t strlcpy(char *, const char *, size_t);
 #endif
+#ifndef __HAVE_ARCH_STRSCPY
+ssize_t __must_check strscpy(char *, const char *, size_t);
+#endif
 #ifndef __HAVE_ARCH_STRCAT
 extern char * strcat(char *, const char *);
 #endif
lib/string.c +88 -0

100 lines not on this page · raw message

#336 lore raw

PATCH 329/366 netfilter: ebtables: handle string from userspace with care

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Paolo Abeni <[email protected]>

commit 94c752f99954797da583a84c4907ff19e92550a4 upstream.

strlcpy() can't be safely used on a user-space provided string, as it can try to read beyond the buffer's end, if the latter is not NULL terminated.

Leveraging the above, syzbot has been able to trigger the following splat:

BUG: KASAN: stack-out-of-bounds in strlcpy include/linux/string.h:300
[inline]
BUG: KASAN: stack-out-of-bounds in compat_mtw_from_user
net/bridge/netfilter/ebtables.c:1957 [inline]
BUG: KASAN: stack-out-of-bounds in ebt_size_mwt
net/bridge/netfilter/ebtables.c:2059 [inline]
BUG: KASAN: stack-out-of-bounds in size_entry_mwt
net/bridge/netfilter/ebtables.c:2155 [inline]
BUG: KASAN: stack-out-of-bounds in compat_copy_entries+0x96c/0x14a0
net/bridge/netfilter/ebtables.c:2194
Write of size 33 at addr ffff8801b0abf888 by task syz-executor0/4504

CPU: 0 PID: 4504 Comm: syz-executor0 Not tainted 4.17.0-rc2+ #40
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
  __dump_stack lib/dump_stack.c:77 [inline]
  dump_stack+0x1b9/0x294 lib/dump_stack.c:113
  print_address_description+0x6c/0x20b mm/kasan/report.c:256
  kasan_report_error mm/kasan/report.c:354 [inline]
  kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
  check_memory_region_inline mm/kasan/kasan.c:260 [inline]
  check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267
  memcpy+0x37/0x50 mm/kasan/kasan.c:303
  strlcpy include/linux/string.h:300 [inline]
  compat_mtw_from_user net/bridge/netfilter/ebtables.c:1957 [inline]
  ebt_size_mwt net/bridge/netfilter/ebtables.c:2059 [inline]
  size_entry_mwt net/bridge/netfilter/ebtables.c:2155 [inline]
  compat_copy_entries+0x96c/0x14a0 net/bridge/netfilter/ebtables.c:2194
  compat_do_replace+0x483/0x900 net/bridge/netfilter/ebtables.c:2285
  compat_do_ebt_set_ctl+0x2ac/0x324 net/bridge/netfilter/ebtables.c:2367
  compat_nf_sockopt net/netfilter/nf_sockopt.c:144 [inline]
  compat_nf_setsockopt+0x9b/0x140 net/netfilter/nf_sockopt.c:156
  compat_ip_setsockopt+0xff/0x140 net/ipv4/ip_sockglue.c:1279
  inet_csk_compat_setsockopt+0x97/0x120 net/ipv4/inet_connection_sock.c:1041
  compat_tcp_setsockopt+0x49/0x80 net/ipv4/tcp.c:2901
  compat_sock_common_setsockopt+0xb4/0x150 net/core/sock.c:3050
  __compat_sys_setsockopt+0x1ab/0x7c0 net/compat.c:403
  __do_compat_sys_setsockopt net/compat.c:416 [inline]
  __se_compat_sys_setsockopt net/compat.c:413 [inline]
  __ia32_compat_sys_setsockopt+0xbd/0x150 net/compat.c:413
  do_syscall_32_irqs_on arch/x86/entry/common.c:323 [inline]
  do_fast_syscall_32+0x345/0xf9b arch/x86/entry/common.c:394
  entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7fb3cb9
RSP: 002b:00000000fff0c26c EFLAGS: 00000282 ORIG_RAX: 000000000000016e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000000000
RDX: 0000000000000080 RSI: 0000000020000300 RDI: 00000000000005f4
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0006c2afc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 ffffea0006c20101 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Fix the issue replacing the unsafe function with strscpy() and taking care of possible errors.

Fixes 81e675c227ec ("netfilter: ebtables: add CONFIG_COMPAT support")
Reported-and-tested-by [email protected]
---
 net/bridge/netfilter/ebtables.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/bridge/netfilter/ebtables.c +2 -1
@@ -1897,7 +1897,8 @@ static int compat_mtw_from_user(struct c
 	int off, pad = 0;
 	unsigned int size_kern, match_size = mwt->match_size;
 
-	strlcpy(name, mwt->u.name, sizeof(name));
+	if (strscpy(name, mwt->u.name, sizeof(name)) < 0)
+		return -EINVAL;
 
 	if (state->buf_kern_start)
 		dst = state->buf_kern_start + state->buf_kern_offset;
#337 lore raw

PATCH 330/366 powerpc/powernv: Fix NVRAM sleep in invalid context when crashing

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Nicholas Piggin <[email protected]>

commit c1d2a31397ec51f0370f6bd17b19b39152c263cb upstream.

Similarly to opal_event_shutdown, opal_nvram_write can be called in the crash path with irqs disabled. Special case the delay to avoid sleeping in invalid context.

Fixes 3b8070335f75 ("powerpc/powernv: Fix OPAL NVRAM driver OPAL_BUSY loops")
---
 arch/powerpc/platforms/powernv/opal-nvram.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/opal-nvram.c +12 -2
@@ -43,6 +43,10 @@ static ssize_t opal_nvram_read(char *buf
 	return count;
 }
 
+/*
+ * This can be called in the panic path with interrupts off, so use
+ * mdelay in that case.
+ */
 static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index)
 {
 	s64 rc = OPAL_BUSY;
@@ -57,10 +61,16 @@ static ssize_t opal_nvram_write(char *bu
 	while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
 		rc = opal_write_nvram(__pa(buf), count, off);
 		if (rc == OPAL_BUSY_EVENT) {
-			msleep(OPAL_BUSY_DELAY_MS);
+			if (in_interrupt() || irqs_disabled())
+				mdelay(OPAL_BUSY_DELAY_MS);
+			else
+				msleep(OPAL_BUSY_DELAY_MS);
 			opal_poll_events(NULL);
 		} else if (rc == OPAL_BUSY) {
-			msleep(OPAL_BUSY_DELAY_MS);
+			if (in_interrupt() || irqs_disabled())
+				mdelay(OPAL_BUSY_DELAY_MS);
+			else
+				msleep(OPAL_BUSY_DELAY_MS);
 		}
 	}
 
#338 lore raw

PATCH 331/366 net: test tailroom before appending to linear skb

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Willem de Bruijn <[email protected]>

commit 113f99c3358564a0647d444c2ae34e8b1abfd5b9 upstream.

Device features may change during transmission. In particular with corking, a device may toggle scatter-gather in between allocating and writing to an skb.

Do not unconditionally assume that !NETIF_F_SG at write time implies that the same held at alloc time and thus the skb has sufficient tailroom.

This issue predates git history.

---
 net/ipv4/ip_output.c  | 3 ++-
 net/ipv6/ip6_output.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
net/ipv4/ip_output.c +2 -1
@@ -1025,7 +1025,8 @@ alloc_new_skb:
 		if (copy > length)
 			copy = length;
 
-		if (!(rt->dst.dev->features&NETIF_F_SG)) {
+		if (!(rt->dst.dev->features&NETIF_F_SG) &&
+		    skb_tailroom(skb) >= copy) {
 			unsigned int off;
 
 			off = skb->len;
net/ipv6/ip6_output.c +2 -1
@@ -1453,7 +1453,8 @@ alloc_new_skb:
 		if (copy > length)
 			copy = length;
 
-		if (!(rt->dst.dev->features&NETIF_F_SG)) {
+		if (!(rt->dst.dev->features&NETIF_F_SG) &&
+		    skb_tailroom(skb) >= copy) {
 			unsigned int off;
 
 			off = skb->len;
#339 lore raw

PATCH 332/366 powerpc/64s: Clear PCR on boot

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Michael Neuling <[email protected]>

commit faf37c44a105f3608115785f17cbbf3500f8bc71 upstream.

Clear the PCR (Processor Compatibility Register) on boot to ensure we are not running in a compatibility mode.

We've seen this cause problems when a crash (and kdump) occurs while running compat mode guests. The kdump kernel then runs with the PCR set and causes problems. The symptom in the kdump kernel (also seen in petitboot after fast-reboot) is early userspace programs taking sigills on newer instructions (seen in libc).

[bwh: Backported to 3.16: Drop changes in __{setup,restore}_cpu_power9
and __restore_cpu_cpufeatures()]

---

arch/powerpc/kernel/cpu_setup_power.S +4 -0
@@ -27,6 +27,7 @@ _GLOBAL(__setup_cpu_power7)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	bl	__init_LPCR
 	bl	__init_tlb_power7
@@ -40,6 +41,7 @@ _GLOBAL(__restore_cpu_power7)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	bl	__init_LPCR
 	bl	__init_tlb_power7
@@ -55,6 +57,7 @@ _GLOBAL(__setup_cpu_power8)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr	r3,SPRN_LPCR
 	ori	r3, r3, LPCR_PECEDH
 	bl	__init_LPCR
@@ -74,6 +77,7 @@ _GLOBAL(__restore_cpu_power8)
 	beqlr
 	li	r0,0
 	mtspr	SPRN_LPID,r0
+	mtspr	SPRN_PCR,r0
 	mfspr   r3,SPRN_LPCR
 	ori	r3, r3, LPCR_PECEDH
 	bl	__init_LPCR
#340 lore raw

PATCH 333/366 ALSA: timer: Call notifier in the same spinlock

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Takashi Iwai <[email protected]>

commit f65e0d299807d8a11812845c972493c3f9a18e10 upstream.

snd_timer_notify1() is called outside the spinlock and it retakes the lock after the unlock. This is rather racy, and it's safer to move snd_timer_notify() call inside the main spinlock.

The patch also contains a slight refactoring / cleanup of the code. Now all start/stop/continue/pause look more symmetric and a bit better readable.

[bwh: Backported to 3.16:
- Fix up another use of "event" in _snd_timer_stop()
- Adjust context]

---

sound/core/timer.c +103 -119
@@ -347,8 +347,6 @@ int snd_timer_open(struct snd_timer_inst
 	return err;
 }
 
-static int _snd_timer_stop(struct snd_timer_instance *timeri, int event);
-
 /*
  * close a timer instance
  * call this with register_mutex down.
@@ -445,7 +443,6 @@ unsigned long snd_timer_resolution(struc
 static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
 {
 	struct snd_timer *timer;
-	unsigned long flags;
 	unsigned long resolution = 0;
 	struct snd_timer_instance *ts;
 	struct timespec tstamp;
@@ -469,34 +466,66 @@ static void snd_timer_notify1(struct snd
 		return;
 	if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
 		return;
-	spin_lock_irqsave(&timer->lock, flags);
 	list_for_each_entry(ts, &ti->slave_active_head, active_list)
 		if (ts->ccallback)
 			ts->ccallback(ts, event + 100, &tstamp, resolution);
-	spin_unlock_irqrestore(&timer->lock, flags);
 }
 
-static int snd_timer_start1(struct snd_timer *timer, struct snd_timer_instance *timeri,
-			    unsigned long sticks)
+/* start/continue a master timer */
+static int snd_timer_start1(struct snd_timer_instance *timeri,
+			    bool start, unsigned long ticks)
 {
+	struct snd_timer *timer;
+	int result;
+	unsigned long flags;
+
+	timer = timeri->timer;
+	if (!timer)
+		return -EINVAL;
+
+	spin_lock_irqsave(&timer->lock, flags);
+	if (timer->card && timer->card->shutdown) {
+		result = -ENODEV;
+		goto unlock;
+	}
+	if (timeri->flags & (SNDRV_TIMER_IFLG_RUNNING |
+			     SNDRV_TIMER_IFLG_START)) {
+		result = -EBUSY;
+		goto unlock;
+	}
+
+	if (start)
+		timeri->ticks = timeri->cticks = ticks;
+	else if (!timeri->cticks)
+		timeri->cticks = 1;
+	timeri->pticks = 0;
+
 	list_move_tail(&timeri->active_list, &timer->active_list_head);
 	if (timer->running) {
 		if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
 			goto __start_now;
 		timer->flags |= SNDRV_TIMER_FLG_RESCHED;
 		timeri->flags |= SNDRV_TIMER_IFLG_START;
-		return 1;	/* delayed start */
+		result = 1; /* delayed start */
 	} else {
-		timer->sticks = sticks;
+		if (start)
+			timer->sticks = ticks;
 		timer->hw.start(timer);
 	      __start_now:
 		timer->running++;
 		timeri->flags |= SNDRV_TIMER_IFLG_RUNNING;
-		return 0;
+		result = 0;
 	}
+	snd_timer_notify1(timeri, start ? SNDRV_TIMER_EVENT_START :
+			  SNDRV_TIMER_EVENT_CONTINUE);
+ unlock:
+	spin_unlock_irqrestore(&timer->lock, flags);
+	return result;
 }
 
-static int snd_timer_start_slave(struct snd_timer_instance *timeri)
+/* start/continue a slave timer */
+static int snd_timer_start_slave(struct snd_timer_instance *timeri,
+				 bool start)
 {
 	unsigned long flags;
 
@@ -510,88 +539,37 @@ static int snd_timer_start_slave(struct
 		spin_lock(&timeri->timer->lock);
 		list_add_tail(&timeri->active_list,
 			      &timeri->master->slave_active_head);
+		snd_timer_notify1(timeri, start ? SNDRV_TIMER_EVENT_START :
+				  SNDRV_TIMER_EVENT_CONTINUE);
 		spin_unlock(&timeri->timer->lock);
 	}
 	spin_unlock_irqrestore(&slave_active_lock, flags);
 	return 1; /* delayed start */
 }
 
-/*
- *  start the timer instance
- */
-int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks)
-{
-	struct snd_timer *timer;
-	int result = -EINVAL;
-	unsigned long flags;
-
-	if (timeri == NULL || ticks < 1)
-		return -EINVAL;
-	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) {
-		result = snd_timer_start_slave(timeri);
-		if (result >= 0)
-			snd_timer_notify1(timeri, SNDRV_TIMER_EVENT_START);
-		return result;
-	}
-	timer = timeri->timer;
-	if (timer == NULL)
-		return -EINVAL;
-	if (timer->card && timer->card->shutdown)
-		return -ENODEV;
-	spin_lock_irqsave(&timer->lock, flags);
-	if (timeri->flags & (SNDRV_TIMER_IFLG_RUNNING |
-			     SNDRV_TIMER_IFLG_START)) {
-		result = -EBUSY;
-		goto unlock;
-	}
-	timeri->ticks = timeri->cticks = ticks;
-	timeri->pticks = 0;
-	result = snd_timer_start1(timer, timeri, ticks);
- unlock:
-	spin_unlock_irqrestore(&timer->lock, flags);
-	if (result >= 0)
-		snd_timer_notify1(timeri, SNDRV_TIMER_EVENT_START);
-	return result;
-}
-
-static int _snd_timer_stop(struct snd_timer_instance *timeri, int event)
+/* stop/pause a master timer */
+static int snd_timer_stop1(struct snd_timer_instance *timeri, bool stop)
 {
 	struct snd_timer *timer;
+	int result = 0;
 	unsigned long flags;
 
-	if (snd_BUG_ON(!timeri))
-		return -ENXIO;
-
-	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) {
-		spin_lock_irqsave(&slave_active_lock, flags);
-		if (!(timeri->flags & SNDRV_TIMER_IFLG_RUNNING)) {
-			spin_unlock_irqrestore(&slave_active_lock, flags);
-			return -EBUSY;
-		}
-		if (timeri->timer)
-			spin_lock(&timeri->timer->lock);
-		timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
-		list_del_init(&timeri->ack_list);
-		list_del_init(&timeri->active_list);
-		if (timeri->timer)
-			spin_unlock(&timeri->timer->lock);
-		spin_unlock_irqrestore(&slave_active_lock, flags);
-		goto __end;
-	}
 	timer = timeri->timer;
 	if (!timer)
 		return -EINVAL;
 	spin_lock_irqsave(&timer->lock, flags);
 	if (!(timeri->flags & (SNDRV_TIMER_IFLG_RUNNING |
 			       SNDRV_TIMER_IFLG_START))) {
-		spin_unlock_irqrestore(&timer->lock, flags);
-		return -EBUSY;
+		result = -EBUSY;
+		goto unlock;
 	}
 	list_del_init(&timeri->ack_list);
 	list_del_init(&timeri->active_list);
-	if (timer->card && timer->card->shutdown) {
-		spin_unlock_irqrestore(&timer->lock, flags);
-		return 0;
+	if (timer->card && timer->card->shutdown)
+		goto unlock;
+	if (stop) {
+		timeri->cticks = timeri->ticks;
+		timeri->pticks = 0;
 	}
 	if ((timeri->flags & SNDRV_TIMER_IFLG_RUNNING) &&
 	    !(--timer->running)) {
@@ -606,39 +584,64 @@ static int _snd_timer_stop(struct snd_ti
 		}
 	}
 	timeri->flags &= ~(SNDRV_TIMER_IFLG_RUNNING | SNDRV_TIMER_IFLG_START);
-	if (event == SNDRV_TIMER_EVENT_STOP)
+	if (stop)
 		timeri->flags &= ~SNDRV_TIMER_IFLG_PAUSED;
 	else
 		timeri->flags |= SNDRV_TIMER_IFLG_PAUSED;
+	snd_timer_notify1(timeri, stop ? SNDRV_TIMER_EVENT_STOP :
+			  SNDRV_TIMER_EVENT_CONTINUE);
+ unlock:
 	spin_unlock_irqrestore(&timer->lock, flags);
-      __end:
-	if (event != SNDRV_TIMER_EVENT_RESOLUTION)
-		snd_timer_notify1(timeri, event);
+	return result;
+}
+
+/* stop/pause a slave timer */
+static int snd_timer_stop_slave(struct snd_timer_instance *timeri, bool stop)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&slave_active_lock, flags);
+	if (!(timeri->flags & SNDRV_TIMER_IFLG_RUNNING)) {
+		spin_unlock_irqrestore(&slave_active_lock, flags);
+		return -EBUSY;
+	}
+	timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
+	if (timeri->timer) {
+		spin_lock(&timeri->timer->lock);
+		list_del_init(&timeri->ack_list);
+		list_del_init(&timeri->active_list);
+		snd_timer_notify1(timeri, stop ? SNDRV_TIMER_EVENT_STOP :
+				  SNDRV_TIMER_EVENT_CONTINUE);
+		spin_unlock(&timeri->timer->lock);
+	}
+	spin_unlock_irqrestore(&slave_active_lock, flags);
 	return 0;
 }
 
 /*
+ *  start the timer instance
+ */
+int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks)
+{
+	if (timeri == NULL || ticks < 1)
+		return -EINVAL;
+	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
+		return snd_timer_start_slave(timeri, true);
+	else
+		return snd_timer_start1(timeri, true, ticks);
+}
+
+/*
  * stop the timer instance.
  *
  * do not call this from the timer callback!
  */
 int snd_timer_stop(struct snd_timer_instance *timeri)
 {
-	struct snd_timer *timer;
-	unsigned long flags;
-	int err;
-
-	err = _snd_timer_stop(timeri, SNDRV_TIMER_EVENT_STOP);
-	if (err < 0)
-		return err;
-	timer = timeri->timer;
-	if (!timer)
-		return -EINVAL;
-	spin_lock_irqsave(&timer->lock, flags);
-	timeri->cticks = timeri->ticks;
-	timeri->pticks = 0;
-	spin_unlock_irqrestore(&timer->lock, flags);
-	return 0;
+	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
+		return snd_timer_stop_slave(timeri, true);
+	else
+		return snd_timer_stop1(timeri, true);
 }
 
 /*
@@ -646,36 +649,14 @@ int snd_timer_stop(struct snd_timer_inst
  */
 int snd_timer_continue(struct snd_timer_instance *timeri)
 {
-	struct snd_timer *timer;
-	int result = -EINVAL;
-	unsigned long flags;
-
-	if (timeri == NULL)
-		return result;
 	/* timer can continue only after pause */
 	if (!(timeri->flags & SNDRV_TIMER_IFLG_PAUSED))
 		return -EINVAL;
 
 	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
-		return snd_timer_start_slave(timeri);
-	timer = timeri->timer;
-	if (! timer)
-		return -EINVAL;
-	if (timer->card && timer->card->shutdown)
-		return -ENODEV;
-	spin_lock_irqsave(&timer->lock, flags);
-	if (timeri->flags & SNDRV_TIMER_IFLG_RUNNING) {
-		result = -EBUSY;
-		goto unlock;
-	}
-	if (!timeri->cticks)
-		timeri->cticks = 1;
-	timeri->pticks = 0;
-	result = snd_timer_start1(timer, timeri, timer->sticks);
- unlock:
-	spin_unlock_irqrestore(&timer->lock, flags);
-	snd_timer_notify1(timeri, SNDRV_TIMER_EVENT_CONTINUE);
-	return result;
+		return snd_timer_start_slave(timeri, false);
+	else
+		return snd_timer_start1(timeri, false, 0);
 }
 
 /*
@@ -683,7 +664,10 @@ int snd_timer_continue(struct snd_timer_
  */
 int snd_timer_pause(struct snd_timer_instance * timeri)
 {
-	return _snd_timer_stop(timeri, SNDRV_TIMER_EVENT_PAUSE);
+	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
+		return snd_timer_stop_slave(timeri, false);
+	else
+		return snd_timer_stop1(timeri, false);
 }
 
 /*
#341 lore raw

PATCH 334/366 ALSA: timer: Fix pause event notification

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Ben Hutchings <[email protected]>

commit 3ae180972564846e6d794e3615e1ab0a1e6c4ef9 upstream.

Commit f65e0d299807 ("ALSA: timer: Call notifier in the same spinlock") combined the start/continue and stop/pause functions, and in doing so changed the event code for the pause case to SNDRV_TIMER_EVENT_CONTINUE. Change it back to SNDRV_TIMER_EVENT_PAUSE.

Fixes f65e0d299807 ("ALSA: timer: Call notifier in the same spinlock")
---
 sound/core/timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/core/timer.c +2 -2
@@ -589,7 +589,7 @@ static int snd_timer_stop1(struct snd_ti
 	else
 		timeri->flags |= SNDRV_TIMER_IFLG_PAUSED;
 	snd_timer_notify1(timeri, stop ? SNDRV_TIMER_EVENT_STOP :
-			  SNDRV_TIMER_EVENT_CONTINUE);
+			  SNDRV_TIMER_EVENT_PAUSE);
  unlock:
 	spin_unlock_irqrestore(&timer->lock, flags);
 	return result;
@@ -611,7 +611,7 @@ static int snd_timer_stop_slave(struct s
 		list_del_init(&timeri->ack_list);
 		list_del_init(&timeri->active_list);
 		snd_timer_notify1(timeri, stop ? SNDRV_TIMER_EVENT_STOP :
-				  SNDRV_TIMER_EVENT_CONTINUE);
+				  SNDRV_TIMER_EVENT_PAUSE);
 		spin_unlock(&timeri->timer->lock);
 	}
 	spin_unlock_irqrestore(&slave_active_lock, flags);
#342 lore raw

PATCH 335/366 xen-swiotlb: fix the check condition for xen_swiotlb_free_coherent

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Joe Jin <[email protected]>

commit 4855c92dbb7b3b85c23e88ab7ca04f99b9677b41 upstream.

When run raidconfig from Dom0 we found that the Xen DMA heap is reduced, but Dom Heap is increased by the same size. Tracing raidconfig we found that the related ioctl() in megaraid_sas will call dma_alloc_coherent() to apply memory. If the memory allocated by Dom0 is not in the DMA area, it will exchange memory with Xen to meet the requiment. Later drivers call dma_free_coherent() to free the memory, on xen_swiotlb_free_coherent() the check condition (dev_addr + size - 1 <= dma_mask) is always false, it prevents calling xen_destroy_contiguous_region() to return the memory to the Xen DMA heap.

This issue introduced by commit 6810df88dcfc2 "xen-swiotlb: When doing coherent alloc/dealloc check before swizzling the MFNs.".

---
 drivers/xen/swiotlb-xen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/swiotlb-xen.c +1 -1
@@ -366,7 +366,7 @@ xen_swiotlb_free_coherent(struct device
 	 * physical address */
 	phys = xen_bus_to_phys(dev_addr);
 
-	if (((dev_addr + size - 1 > dma_mask)) ||
+	if (((dev_addr + size - 1 <= dma_mask)) ||
 	    range_straddles_page_boundary(phys, size))
 		xen_destroy_contiguous_region(phys, order);
 
#343 lore raw

PATCH 336/366 ARM: 8753/1: decompressor: add a missing parameter to the addruart macro

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Łukasz Stelmach <[email protected]>

commit e07e3c33b9c0b5751ade624f44325c9bf2487ea6 upstream.

In commit 639da5ee374b ("ARM: add an extra temp register to the low level debugging addruart macro") an additional temporary register was added to the addruart macro, but the decompressor code wasn't updated.

Fixes 639da5ee374b ("ARM: add an extra temp register to the low level debugging addruart macro")
---
 arch/arm/boot/compressed/head.S | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/compressed/head.S +8 -8
@@ -24,19 +24,19 @@
 #if defined(CONFIG_DEBUG_ICEDCC)
 
 #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
-		.macro	loadsp, rb, tmp
+		.macro	loadsp, rb, tmp1, tmp2
 		.endm
 		.macro	writeb, ch, rb
 		mcr	p14, 0, \ch, c0, c5, 0
 		.endm
 #elif defined(CONFIG_CPU_XSCALE)
-		.macro	loadsp, rb, tmp
+		.macro	loadsp, rb, tmp1, tmp2
 		.endm
 		.macro	writeb, ch, rb
 		mcr	p14, 0, \ch, c8, c0, 0
 		.endm
 #else
-		.macro	loadsp, rb, tmp
+		.macro	loadsp, rb, tmp1, tmp2
 		.endm
 		.macro	writeb, ch, rb
 		mcr	p14, 0, \ch, c1, c0, 0
@@ -52,7 +52,7 @@
 		.endm
 
 #if defined(CONFIG_ARCH_SA1100)
-		.macro	loadsp, rb, tmp
+		.macro	loadsp, rb, tmp1, tmp2
 		mov	\rb, #0x80000000	@ physical base address
 #ifdef CONFIG_DEBUG_LL_SER3
 		add	\rb, \rb, #0x00050000	@ Ser3
@@ -61,8 +61,8 @@
 #endif
 		.endm
 #else
-		.macro	loadsp,	rb, tmp
-		addruart \rb, \tmp
+		.macro	loadsp,	rb, tmp1, tmp2
+		addruart \rb, \tmp1, \tmp2
 		.endm
 #endif
 #endif
@@ -1219,7 +1219,7 @@ phex:		adr	r3, phexbuf
 		b	1b
 
 @ puts corrupts {r0, r1, r2, r3}
-puts:		loadsp	r3, r1
+puts:		loadsp	r3, r2, r1
 1:		ldrb	r2, [r0], #1
 		teq	r2, #0
 		moveq	pc, lr
@@ -1236,8 +1236,8 @@ puts:		loadsp	r3, r1
 @ putc corrupts {r0, r1, r2, r3}
 putc:
 		mov	r2, r0
+		loadsp	r3, r1, r0
 		mov	r0, #0
-		loadsp	r3, r1
 		b	2b
 
 @ memdump corrupts {r0, r1, r2, r3, r10, r11, r12, lr}
#344 lore raw

PATCH 337/366 ARM: 8771/1: kprobes: Prohibit kprobes on do_undefinstr

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Masami Hiramatsu <[email protected]>

commit eb0146daefdde65665b7f076fbff7b49dade95b9 upstream.

Prohibit kprobes on do_undefinstr because kprobes on arm is implemented by undefined instruction. This means if we probe do_undefinstr(), it can cause infinit recursive exception.

Fixes 24ba613c9d6c ("ARM kprobes: core code")
---
 arch/arm/kernel/traps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/kernel/traps.c +4 -1
@@ -19,6 +19,7 @@
 #include <linux/uaccess.h>
 #include <linux/hardirq.h>
 #include <linux/kdebug.h>
+#include <linux/kprobes.h>
 #include <linux/module.h>
 #include <linux/kexec.h>
 #include <linux/bug.h>
@@ -392,7 +393,8 @@ void unregister_undef_hook(struct undef_
 	raw_spin_unlock_irqrestore(&undef_lock, flags);
 }
 
-static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
+static nokprobe_inline
+int call_undef_hook(struct pt_regs *regs, unsigned int instr)
 {
 	struct undef_hook *hook;
 	unsigned long flags;
@@ -465,6 +467,7 @@ die_sig:
 
 	arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6);
 }
+NOKPROBE_SYMBOL(do_undefinstr)
 
 asmlinkage void do_unexp_fiq (struct pt_regs *regs)
 {
#345 lore raw

PATCH 338/366 ARM: 8772/1: kprobes: Prohibit kprobes on get_user functions

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Masami Hiramatsu <[email protected]>

commit 0d73c3f8e7f6ee2aab1bb350f60c180f5ae21a2c upstream.

Since do_undefinstr() uses get_user to get the undefined instruction, it can be called before kprobes processes recursive check. This can cause an infinit recursive exception.
Prohibit probing on get_user functions.

Fixes 24ba613c9d6c ("ARM kprobes: core code")
[bwh: Backported to 3.16: Drop changes to __get_user_{8,32_t_8,64t_{1,2,4}}]

---

arch/arm/include/asm/assembler.h +10 -0
@@ -425,4 +425,14 @@ THUMB(	orr	\reg , \reg , #PSR_T_BIT	)
 #endif
 	.endm
 
+#ifdef CONFIG_KPROBES
+#define _ASM_NOKPROBE(entry)				\
+	.pushsection "_kprobe_blacklist", "aw" ;	\
+	.balign 4 ;					\
+	.long entry;					\
+	.popsection
+#else
+#define _ASM_NOKPROBE(entry)
+#endif
+
 #endif /* __ASM_ASSEMBLER_H__ */
arch/arm/lib/getuser.S +4 -0
@@ -38,6 +38,7 @@ ENTRY(__get_user_1)
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_1)
+_ASM_NOKPROBE(__get_user_1)
 
 ENTRY(__get_user_2)
 	check_uaccess r0, 2, r1, r2, __get_user_bad
@@ -58,6 +59,7 @@ rb	.req	r0
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_2)
+_ASM_NOKPROBE(__get_user_2)
 
 ENTRY(__get_user_4)
 	check_uaccess r0, 4, r1, r2, __get_user_bad
@@ -65,12 +67,14 @@ ENTRY(__get_user_4)
 	mov	r0, #0
 	mov	pc, lr
 ENDPROC(__get_user_4)
+_ASM_NOKPROBE(__get_user_4)
 
 __get_user_bad:
 	mov	r2, #0
 	mov	r0, #-EFAULT
 	mov	pc, lr
 ENDPROC(__get_user_bad)
+_ASM_NOKPROBE(__get_user_bad)
 
 .pushsection __ex_table, "a"
 	.long	1b, __get_user_bad
#346 lore raw

PATCH 339/366 libata: blacklist Micron 500IT SSD with MU01 firmware

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Sudip Mukherjee <[email protected]>

commit 136d769e0b3475d71350aa3648a116a6ee7a8f6c upstream.

While whitelisting Micron M500DC drives, the tweaked blacklist entry enabled queued TRIM from M500IT variants also. But these do not support queued TRIM. And while using those SSDs with the latest kernel we have seen errors and even the partition table getting corrupted.

Some part from the dmesg:

[    6.727384] ata1.00: ATA-9: Micron_M500IT_MTFDDAK060MBD, MU01, max UDMA/133
[    6.727390] ata1.00: 117231408 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[    6.741026] ata1.00: supports DRM functions and may not be fully accessible
[    6.759887] ata1.00: configured for UDMA/133
[    6.762256] scsi 0:0:0:0: Direct-Access     ATA      Micron_M500IT_MT MU01 PQ: 0 ANSI: 5

and then for the error:

[  120.860334] ata1.00: exception Emask 0x1 SAct 0x7ffc0007 SErr 0x0 action 0x6 frozen
[  120.860338] ata1.00: irq_stat 0x40000008
[  120.860342] ata1.00: failed command: SEND FPDMA QUEUED
[  120.860351] ata1.00: cmd 64/01:00:00:00:00/00:00:00:00:00/a0 tag 0 ncq dma 512 out
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x5 (timeout)
[  120.860353] ata1.00: status: { DRDY }
[  120.860543] ata1: hard resetting link
[  121.166128] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[  121.166376] ata1.00: supports DRM functions and may not be fully accessible
[  121.186238] ata1.00: supports DRM functions and may not be fully accessible
[  121.204445] ata1.00: configured for UDMA/133
[  121.204454] ata1.00: device reported invalid CHS sector 0
[  121.204541] sd 0:0:0:0: [sda] tag#18 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[  121.204546] sd 0:0:0:0: [sda] tag#18 Sense Key : 0x5 [current]
[  121.204550] sd 0:0:0:0: [sda] tag#18 ASC=0x21 ASCQ=0x4
[  121.204555] sd 0:0:0:0: [sda] tag#18 CDB: opcode=0x93 93 08 00 00 00 00 00 04 28 80 00 00 00 30 00 00
[  121.204559] print_req_error: I/O error, dev sda, sector 272512

After few reboots with these errors, and the SSD is corrupted. After blacklisting it, the errors are not seen and the SSD does not get corrupted any more.

Fixes 243918be6393 ("libata: Do not blacklist Micron M500DC")
Cc Martin K. Petersen <[email protected]>
[bwh: Backported to 3.16: Drop ATA_HORKAGE_ZERO_AFTER_TRIM flag]
---
 drivers/ata/libata-core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/ata/libata-core.c +1 -0
@@ -4247,6 +4247,7 @@ static const struct ata_blacklist_entry
 	{ "SanDisk SD7UB3Q*G1001",	NULL,	ATA_HORKAGE_NOLPM, },
 
 	/* devices that don't properly handle queued TRIM commands */
+	{ "Micron_M500IT_*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Micron_M500_*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Crucial_CT*M500*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM, },
 	{ "Micron_M5[15]0_*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM, },
#347 lore raw

PATCH 340/366 affs_lookup(): close a race with affs_remove_link()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Al Viro <[email protected]>

commit 30da870ce4a4e007c901858a96e9e394a1daa74a upstream.

we unlock the directory hash too early - if we are looking at secondary link and primary (in another directory) gets removed just as we unlock, we could have the old primary moved in place of the secondary, leaving us to look into freed entry (and leaving our dentry with ->d_fsdata pointing to a freed entry).

---
 fs/affs/namei.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
fs/affs/namei.c +7 -3
@@ -224,9 +224,10 @@ affs_lookup(struct inode *dir, struct de
 
 	affs_lock_dir(dir);
 	bh = affs_find_entry(dir, dentry);
-	affs_unlock_dir(dir);
-	if (IS_ERR(bh))
+	if (IS_ERR(bh)) {
+		affs_unlock_dir(dir);
 		return ERR_CAST(bh);
+	}
 	if (bh) {
 		u32 ino = bh->b_blocknr;
 
@@ -240,10 +241,13 @@ affs_lookup(struct inode *dir, struct de
 		}
 		affs_brelse(bh);
 		inode = affs_iget(sb, ino);
-		if (IS_ERR(inode))
+		if (IS_ERR(inode)) {
+			affs_unlock_dir(dir);
 			return ERR_CAST(inode);
+		}
 	}
 	d_add(dentry, inode);
+	affs_unlock_dir(dir);
 	return NULL;
 }
 
#348 lore raw

PATCH 341/366 ext2: fix a block leak

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Al Viro <[email protected]>

commit 5aa1437d2d9a068c0334bd7c9dafa8ec4f97f13b upstream.

open file, unlink it, then use ioctl(2) to make it immutable or append only. Now close it and watch the blocks *not* freed...

Immutable/append-only checks belong in ->setattr().
Note: the bug is old and backport to anything prior to 737f2e93b972 ("ext2: convert to use the new truncate convention") will need these checks lifted into ext2_setattr().

[bwh: Backported to 3.16: adjust context]
---
 fs/ext2/inode.c | 10 ----------
 1 file changed, 10 deletions(-)
fs/ext2/inode.c +0 -10
@@ -1169,21 +1169,11 @@ do_indirects:
 
 static void ext2_truncate_blocks(struct inode *inode, loff_t offset)
 {
-	/*
-	 * XXX: it seems like a bug here that we don't allow
-	 * IS_APPEND inode to have blocks-past-i_size trimmed off.
-	 * review and fix this.
-	 *
-	 * Also would be nice to be able to handle IO errors and such,
-	 * but that's probably too much to ask.
-	 */
 	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
 	    S_ISLNK(inode->i_mode)))
 		return;
 	if (ext2_inode_is_fast_symlink(inode))
 		return;
-	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
-		return;
 	__ext2_truncate_blocks(inode, offset);
 }
 
#349 lore raw

PATCH 342/366 aio: fix io_destroy(2) vs. lookup_ioctx() race

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Al Viro <[email protected]>

commit baf10564fbb66ea222cae66fbff11c444590ffd9 upstream.

kill_ioctx() used to have an explicit RCU delay between removing the reference from ->ioctx_table and percpu_ref_kill() dropping the refcount. At some point that delay had been removed, on the theory that percpu_ref_kill() itself contained an RCU delay. Unfortunately, that was the wrong kind of RCU delay and it didn't care about rcu_read_lock() used by lookup_ioctx(). As the result, we could get ctx freed right under lookup_ioctx(). Tejun has fixed that in a6d7cff472e ("fs/aio: Add explicit RCU grace period when freeing kioctx"); however, that fix is not enough.

Suppose io_destroy() from one thread races with e.g. io_setup() from another; CPU1 removes the reference from current->mm->ioctx_table[...] just as CPU2 has picked it (under rcu_read_lock()). Then CPU1 proceeds to drop the refcount, getting it to 0 and triggering a call of free_ioctx_users(), which proceeds to drop the secondary refcount and once that reaches zero calls free_ioctx_reqs(). That does

        INIT_RCU_WORK(&ctx->free_rwork, free_ioctx);
        queue_rcu_work(system_wq, &ctx->free_rwork);

and schedules freeing the whole thing after RCU delay.

In the meanwhile CPU2 has gotten around to percpu_ref_get(), bumping the refcount from 0 to 1 and returned the reference to io_setup().

Tejun's fix (that queue_rcu_work() in there) guarantees that ctx won't get freed until after percpu_ref_get(). Sure, we'd increment the counter before ctx can be freed. Now we are out of rcu_read_lock() and there's nothing to stop freeing of the whole thing. Unfortunately, CPU2 assumes that since it has grabbed the reference, ctx is *NOT* going away until it gets around to dropping that reference.

The fix is obvious - use percpu_ref_tryget_live() and treat failure as miss. It's not costlier than what we currently do in normal case, it's safe to call since freeing *is* delayed and it closes the race window - either lookup_ioctx() comes before percpu_ref_kill() (in which case ctx->users won't reach 0 until the caller of lookup_ioctx() drops it) or lookup_ioctx() fails, ctx->users is unaffected and caller of lookup_ioctx() doesn't see the object in question at all.

Fixes a6d7cff472e "fs/aio: Add explicit RCU grace period when freeing kioctx"
---
 fs/aio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/aio.c +2 -2
@@ -1025,8 +1025,8 @@ static struct kioctx *lookup_ioctx(unsig
 
 	ctx = rcu_dereference(table->table[id]);
 	if (ctx && ctx->user_id == ctx_id) {
-		percpu_ref_get(&ctx->users);
-		ret = ctx;
+		if (percpu_ref_tryget_live(&ctx->users))
+			ret = ctx;
 	}
 out:
 	rcu_read_unlock();
#350 lore raw

PATCH 343/366 ipvs: fix buffer overflow with sync daemon and service

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Julian Anastasov <[email protected]>

commit 52f96757905bbf0edef47f3ee6c7c784e7f8ff8a upstream.

syzkaller reports for buffer overflow for interface name when starting sync daemons [1]

What we do is that we copy user structure into larger stack buffer but later we search NUL past the stack buffer. The same happens for sched_name when adding/editing virtual server.

We are restricted by IP_VS_SCHEDNAME_MAXLEN and IP_VS_IFNAME_MAXLEN being used as size in include/uapi/linux/ip_vs.h, so they include the space for NUL.

As using strlcpy is wrong for unsafe source, replace it with strscpy and add checks to return EINVAL if source string is not NUL-terminated. The incomplete strlcpy fix comes from 2.6.13.

For the netlink interface reduce the len parameter for IPVS_DAEMON_ATTR_MCAST_IFN and IPVS_SVC_ATTR_SCHED_NAME, so that we get proper EINVAL.

[1]
kernel BUG at lib/string.c:1052!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)

Modules linked in:
CPU: 1 PID: 373 Comm: syz-executor936 Not tainted 4.17.0-rc4+ #45
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:fortify_panic+0x13/0x20 lib/string.c:1051
RSP: 0018:ffff8801c976f800 EFLAGS: 00010282
RAX: 0000000000000022 RBX: 0000000000000040 RCX: 0000000000000000
RDX: 0000000000000022 RSI: ffffffff8160f6f1 RDI: ffffed00392edef6
RBP: ffff8801c976f800 R08: ffff8801cf4c62c0 R09: ffffed003b5e4fb0
R10: ffffed003b5e4fb0 R11: ffff8801daf27d87 R12: ffff8801c976fa20
R13: ffff8801c976fae4 R14: ffff8801c976fae0 R15: 000000000000048b
FS:  00007fd99f75e700(0000) GS:ffff8801daf00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200001c0 CR3: 00000001d6843000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  strlen include/linux/string.h:270 [inline]
  strlcpy include/linux/string.h:293 [inline]
  do_ip_vs_set_ctl+0x31c/0x1d00 net/netfilter/ipvs/ip_vs_ctl.c:2388
  nf_sockopt net/netfilter/nf_sockopt.c:106 [inline]
  nf_setsockopt+0x7d/0xd0 net/netfilter/nf_sockopt.c:115
  ip_setsockopt+0xd8/0xf0 net/ipv4/ip_sockglue.c:1253
  udp_setsockopt+0x62/0xa0 net/ipv4/udp.c:2487
  ipv6_setsockopt+0x149/0x170 net/ipv6/ipv6_sockglue.c:917
  tcp_setsockopt+0x93/0xe0 net/ipv4/tcp.c:3057
  sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:3046
  __sys_setsockopt+0x1bd/0x390 net/socket.c:1903
  __do_sys_setsockopt net/socket.c:1914 [inline]
  __se_sys_setsockopt net/socket.c:1911 [inline]
  __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1911
  do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447369
RSP: 002b:00007fd99f75dda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000006e39e4 RCX: 0000000000447369
RDX: 000000000000048b RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000018 R09: 0000000000000000
R10: 00000000200001c0 R11: 0000000000000246 R12: 00000000006e39e0
R13: 75a1ff93f0896195 R14: 6f745f3168746576 R15: 0000000000000001
Code: 08 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b 48 89 df e8 d2 8f 48 fa eb
de 55 48 89 fe 48 c7 c7 60 65 64 88 48 89 e5 e8 91 dd f3 f9 <0f> 0b 90 90
90 90 90 90 90 90 90 90 90 55 48 89 e5 41 57 41 56
RIP: fortify_panic+0x13/0x20 lib/string.c:1051 RSP: ffff8801c976f800
Reported-and-tested-by [email protected]
Fixes e4ff67513096 ("ipvs: add sync_maxlen parameter for the sync daemon")
Fixes 4da62fc70d7c ("[IPVS]: Fix for overflows")

[bwh: Backported to 3.16: Interface name is copied in start_sync_thread(),
not do_ip_vs_set_ctl()]

---

net/netfilter/ipvs/ip_vs_ctl.c +11 -4
@@ -2417,12 +2417,19 @@ do_ip_vs_set_ctl(struct sock *sk, int cm
 		}
 	}
 
+	if ((cmd == IP_VS_SO_SET_ADD || cmd == IP_VS_SO_SET_EDIT) &&
+	    strnlen(usvc.sched_name, IP_VS_SCHEDNAME_MAXLEN) ==
+	    IP_VS_SCHEDNAME_MAXLEN) {
+		ret = -EINVAL;
+		goto out_unlock;
+	}
+
 	/* Check for valid protocol: TCP or UDP or SCTP, even for fwmark!=0 */
 	if (usvc.protocol != IPPROTO_TCP && usvc.protocol != IPPROTO_UDP &&
 	    usvc.protocol != IPPROTO_SCTP) {
-		pr_err("set_ctl: invalid protocol: %d %pI4:%d %s\n",
+		pr_err("set_ctl: invalid protocol: %d %pI4:%d\n",
 		       usvc.protocol, &usvc.addr.ip,
-		       ntohs(usvc.port), usvc.sched_name);
+		       ntohs(usvc.port));
 		ret = -EFAULT;
 		goto out_unlock;
 	}
@@ -2845,7 +2852,7 @@ static const struct nla_policy ip_vs_cmd
 static const struct nla_policy ip_vs_daemon_policy[IPVS_DAEMON_ATTR_MAX + 1] = {
 	[IPVS_DAEMON_ATTR_STATE]	= { .type = NLA_U32 },
 	[IPVS_DAEMON_ATTR_MCAST_IFN]	= { .type = NLA_NUL_STRING,
-					    .len = IP_VS_IFNAME_MAXLEN },
+					    .len = IP_VS_IFNAME_MAXLEN - 1 },
 	[IPVS_DAEMON_ATTR_SYNC_ID]	= { .type = NLA_U32 },
 };
 
@@ -2858,7 +2865,7 @@ static const struct nla_policy ip_vs_svc
 	[IPVS_SVC_ATTR_PORT]		= { .type = NLA_U16 },
 	[IPVS_SVC_ATTR_FWMARK]		= { .type = NLA_U32 },
 	[IPVS_SVC_ATTR_SCHED_NAME]	= { .type = NLA_NUL_STRING,
-					    .len = IP_VS_SCHEDNAME_MAXLEN },
+					    .len = IP_VS_SCHEDNAME_MAXLEN - 1 },
 	[IPVS_SVC_ATTR_PE_NAME]		= { .type = NLA_NUL_STRING,
 					    .len = IP_VS_PENAME_MAXLEN },
 	[IPVS_SVC_ATTR_FLAGS]		= { .type = NLA_BINARY,
net/netfilter/ipvs/ip_vs_sync.c +6 -4
@@ -1738,8 +1738,9 @@ int start_sync_thread(struct net *net, i
 		if (ipvs->ms)
 			return -EEXIST;
 
-		strlcpy(ipvs->master_mcast_ifn, mcast_ifn,
-			sizeof(ipvs->master_mcast_ifn));
+		if (strscpy(ipvs->master_mcast_ifn, mcast_ifn,
+			    sizeof(ipvs->master_mcast_ifn)) <= 0)
+			return -EINVAL;
 		ipvs->master_syncid = syncid;
 		name = "ipvs-m:%d:%d";
 		threadfn = sync_thread_master;
@@ -1747,8 +1748,9 @@ int start_sync_thread(struct net *net, i
 		if (ipvs->backup_threads)
 			return -EEXIST;
 
-		strlcpy(ipvs->backup_mcast_ifn, mcast_ifn,
-			sizeof(ipvs->backup_mcast_ifn));
+		if (strscpy(ipvs->backup_mcast_ifn, mcast_ifn,
+			    sizeof(ipvs->backup_mcast_ifn)) <= 0)
+			return -EINVAL;
 		ipvs->backup_syncid = syncid;
 		name = "ipvs-b:%d:%d";
 		threadfn = sync_thread_backup;
#351 lore raw

PATCH 344/366 net/mlx4: Fix irq-unsafe spinlock usage

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Jack Morgenstein <[email protected]>

commit d546b67cda015fb92bfee93d5dc0ceadb91deaee upstream.

spin_lock/unlock was used instead of spin_un/lock_irq in a procedure used in process space, on a spinlock which can be grabbed in an interrupt.

This caused the stack trace below to be displayed (on kernel 4.17.0-rc1 compiled with Lock Debugging enabled):

[  154.661474] WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
[  154.668909] 4.17.0-rc1-rdma_rc_mlx+ #3 Tainted: G          I
[  154.675856] -----------------------------------------------------
[  154.682706] modprobe/10159 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[  154.690254] 00000000f3b0e495 (&(&qp_table->lock)->rlock){+.+.}, at: mlx4_qp_remove+0x20/0x50 [mlx4_core]
[  154.700927]
and this task is already holding:
[  154.707461] 0000000094373b5d (&(&cq->lock)->rlock/1){....}, at: destroy_qp_common+0x111/0x560 [mlx4_ib]
[  154.718028] which would create a new lock dependency:
[  154.723705]  (&(&cq->lock)->rlock/1){....} -> (&(&qp_table->lock)->rlock){+.+.}
[  154.731922]
but this new dependency connects a SOFTIRQ-irq-safe lock:
[  154.740798]  (&(&cq->lock)->rlock){..-.}
[  154.740800]
... which became SOFTIRQ-irq-safe at:
[  154.752163]   _raw_spin_lock_irqsave+0x3e/0x50
[  154.757163]   mlx4_ib_poll_cq+0x36/0x900 [mlx4_ib]
[  154.762554]   ipoib_tx_poll+0x4a/0xf0 [ib_ipoib]
...
to a SOFTIRQ-irq-unsafe lock:
[  154.815603]  (&(&qp_table->lock)->rlock){+.+.}
[  154.815604]
... which became SOFTIRQ-irq-unsafe at:
[  154.827718] ...
[  154.827720]   _raw_spin_lock+0x35/0x50
[  154.833912]   mlx4_qp_lookup+0x1e/0x50 [mlx4_core]
[  154.839302]   mlx4_flow_attach+0x3f/0x3d0 [mlx4_core]

Since mlx4_qp_lookup() is called only in process space, we can simply replace the spin_un/lock calls with spin_un/lock_irq calls.

Fixes 6dc06c08bef1 ("net/mlx4: Fix the check in attaching steering rules")
---
 drivers/net/ethernet/mellanox/mlx4/qp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx4/qp.c +2 -2
@@ -363,11 +363,11 @@ struct mlx4_qp *mlx4_qp_lookup(struct ml
 	struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table;
 	struct mlx4_qp *qp;
 
-	spin_lock(&qp_table->lock);
+	spin_lock_irq(&qp_table->lock);
 
 	qp = __mlx4_qp_lookup(dev, qpn);
 
-	spin_unlock(&qp_table->lock);
+	spin_unlock_irq(&qp_table->lock);
 	return qp;
 }
 
#352 lore raw

PATCH 345/366 fix io_destroy()/aio_complete() race

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Al Viro <[email protected]>

commit 4faa99965e027cc057c5145ce45fa772caa04e8d upstream.

If io_destroy() gets to cancelling everything that can be cancelled and gets to kiocb_cancel() calling the function driver has left in ->ki_cancel, it becomes vulnerable to a race with IO completion. At that point req is already taken off the list and aio_complete() does *NOT* spin until we (in free_ioctx_users()) releases ->ctx_lock. As the result, it proceeds to kiocb_free(), freing req just it gets passed to ->ki_cancel().

Fix is simple - remove from the list after the call of kiocb_cancel(). All instances of ->ki_cancel() already have to cope with the being called with iocb still on list - that's what happens in io_cancel(2).

Fixes 0460fef2a921 "aio: use cancellation list lazily"
[bwh: Backported to 3.16: adjust context]
---
 fs/aio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/aio.c +1 -2
@@ -565,9 +565,8 @@ static void free_ioctx_users(struct perc
 	while (!list_empty(&ctx->active_reqs)) {
 		req = list_first_entry(&ctx->active_reqs,
 				       struct kiocb, ki_list);
-
-		list_del_init(&req->ki_list);
 		kiocb_cancel(req);
+		list_del_init(&req->ki_list);
 	}
 
 	spin_unlock_irq(&ctx->ctx_lock);
#353 lore raw

PATCH 346/366 MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: "Maciej W. Rozycki" <[email protected]>

commit c7e814628df65f424fe197dde73bfc67e4a244d7 upstream.

Use 64-bit accesses for 64-bit floating-point general registers with PTRACE_PEEKUSR, removing the truncation of their upper halves in the FR=1 mode, caused by commit bbd426f542cb ("MIPS: Simplify FP context access"), which inadvertently switched them to using 32-bit accesses.

The PTRACE_POKEUSR side is fine as it's never been broken and continues using 64-bit accesses.

Fixes bbd426f542cb ("MIPS: Simplify FP context access")
Cc Ralf Baechle <[email protected]>

Patchwork: https://patchwork.linux-mips.org/patch/19334/

---
 arch/mips/kernel/ptrace.c   | 2 +-
 arch/mips/kernel/ptrace32.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/kernel/ptrace.c +1 -1
@@ -752,7 +752,7 @@ long arch_ptrace(struct task_struct *chi
 				break;
 			}
 #endif
-			tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
+			tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
 			break;
 		case PC:
 			tmp = regs->cp0_epc;
arch/mips/kernel/ptrace32.c +1 -1
@@ -107,7 +107,7 @@ long compat_arch_ptrace(struct task_stru
 						addr & 1);
 				break;
 			}
-			tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
+			tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
 			break;
 		case PC:
 			tmp = regs->cp0_epc;
#354 lore raw

PATCH 347/366 ahci: Add PCI ID for Cannon Lake PCH-LP AHCI

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Mika Westerberg <[email protected]>

commit 4544e403eb25552aed7f0ee181a7a506b8800403 upstream.

This one should be using the default LPM policy for mobile chipsets so add the PCI ID to the driver list of supported revices.

[bwh: Backported to 3.16: Use board_ahci as we don't have board_ahci_mobile]
---
 drivers/ata/ahci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ata/ahci.c +1 -0
@@ -316,6 +316,7 @@ static const struct pci_device_id ahci_p
 	{ PCI_VDEVICE(INTEL, 0x9c07), board_ahci }, /* Lynx Point-LP RAID */
 	{ PCI_VDEVICE(INTEL, 0x9c0e), board_ahci }, /* Lynx Point-LP RAID */
 	{ PCI_VDEVICE(INTEL, 0x9c0f), board_ahci }, /* Lynx Point-LP RAID */
+	{ PCI_VDEVICE(INTEL, 0x9dd3), board_ahci }, /* Cannon Lake PCH-LP AHCI */
 	{ PCI_VDEVICE(INTEL, 0x1f22), board_ahci }, /* Avoton AHCI */
 	{ PCI_VDEVICE(INTEL, 0x1f23), board_ahci }, /* Avoton AHCI */
 	{ PCI_VDEVICE(INTEL, 0x1f24), board_ahci }, /* Avoton RAID */
#355 lore raw

PATCH 348/366 KVM: x86: Update cpuid properly when CR4.OSXAVE or CR4.PKE is changed

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Wei Huang <[email protected]>

commit c4d2188206bafa177ea58e9a25b952baa0bf7712 upstream.

The CPUID bits of OSXSAVE (function=0x1) and OSPKE (func=0x7, leaf=0x0) allows user apps to detect if OS has set CR4.OSXSAVE or CR4.PKE. KVM is supposed to update these CPUID bits when CR4 is updated. Current KVM code doesn't handle some special cases when updates come from emulator. Here is one example:

Step 1: guest boots
Step 2: guest OS enables XSAVE ==> CR4.OSXSAVE=1 and CPUID.OSXSAVE=1 Step 3: guest hot reboot ==> QEMU reset CR4 to 0, but CPUID.OSXAVE==1 Step 4: guest os checks CPUID.OSXAVE, detects 1, then executes xgetbv

Step 4 above will cause an #UD and guest crash because guest OS hasn't turned on OSXAVE yet. This patch solves the problem by comparing the the old_cr4 with cr4. If the related bits have been changed, kvm_update_cpuid() needs to be called.

[bwh: Backported to 3.16: PKE is not supported]
---
 arch/x86/kvm/x86.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/kvm/x86.c +4 -1
@@ -6668,6 +6668,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct
 {
 	struct msr_data apic_base_msr;
 	int mmu_reset_needed = 0;
+	int cpuid_update_needed = 0;
 	int pending_vec, max_bits, idx;
 	struct desc_ptr dt;
 
@@ -6702,8 +6703,10 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct
 	vcpu->arch.cr0 = sregs->cr0;
 
 	mmu_reset_needed |= kvm_read_cr4(vcpu) != sregs->cr4;
+	cpuid_update_needed |= ((kvm_read_cr4(vcpu) ^ sregs->cr4) &
+				X86_CR4_OSXSAVE);
 	kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
-	if (sregs->cr4 & X86_CR4_OSXSAVE)
+	if (cpuid_update_needed)
 		kvm_update_cpuid(vcpu);
 
 	idx = srcu_read_lock(&vcpu->kvm->srcu);
#356 lore raw

PATCH 349/366 ppp: fix device unregistration upon netns deletion

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Guillaume Nault <[email protected]>

commit 8cb775bc0a34dc596837e7da03fd22c747be618b upstream.

PPP devices may get automatically unregistered when their network namespace is getting removed. This happens if the ppp control plane daemon (e.g. pppd) exits while it is the last user of this namespace.

This leads to several races:

* ppp_exit_net() may destroy the per namespace idr (pn->units_idr) before all file descriptors were released. Successive ppp_release() calls may then cleanup PPP devices with ppp_shutdown_interface() and try to use the already destroyed idr.

* Automatic device unregistration may also happen before the ppp_release() call for that device gets executed. Once called on the file owning the device, ppp_release() will then clean it up and try to unregister it a second time.

To fix these issues, operations defined in ppp_shutdown_interface() are moved to the PPP device's ndo_uninit() callback. This allows PPP devices to be properly cleaned up by unregister_netdev() and friends. So checking for ppp->owner is now an accurate test to decide if a PPP device should be unregistered.

Setting ppp->owner is done in ppp_create_interface(), before device registration, in order to avoid unprotected modification of this field.

Finally, ppp_exit_net() now starts by unregistering all remaining PPP devices to ensure that none will get unregistered after the call to idr_destroy().

---
 drivers/net/ppp/ppp_generic.c | 78 +++++++++++++++++++----------------
 1 file changed, 42 insertions(+), 36 deletions(-)
drivers/net/ppp/ppp_generic.c +42 -36
@@ -269,9 +269,9 @@ static void ppp_ccp_peek(struct ppp *ppp
 static void ppp_ccp_closed(struct ppp *ppp);
 static struct compressor *find_compressor(int type);
 static void ppp_get_stats(struct ppp *ppp, struct ppp_stats *st);
-static struct ppp *ppp_create_interface(struct net *net, int unit, int *retp);
+static struct ppp *ppp_create_interface(struct net *net, int unit,
+					struct file *file, int *retp);
 static void init_ppp_file(struct ppp_file *pf, int kind);
-static void ppp_shutdown_interface(struct ppp *ppp);
 static void ppp_destroy_interface(struct ppp *ppp);
 static struct ppp *ppp_find_unit(struct ppp_net *pn, int unit);
 static struct channel *ppp_find_channel(struct ppp_net *pn, int unit);
@@ -392,8 +392,10 @@ static int ppp_release(struct inode *unu
 		file->private_data = NULL;
 		if (pf->kind == INTERFACE) {
 			ppp = PF_TO_PPP(pf);
+			rtnl_lock();
 			if (file == ppp->owner)
-				ppp_shutdown_interface(ppp);
+				unregister_netdevice(ppp->dev);
+			rtnl_unlock();
 		}
 		if (atomic_dec_and_test(&pf->refcnt)) {
 			switch (pf->kind) {
@@ -595,8 +597,10 @@ static long ppp_ioctl(struct file *file,
 		err = -EINVAL;
 		if (pf->kind == INTERFACE) {
 			ppp = PF_TO_PPP(pf);
+			rtnl_lock();
 			if (file == ppp->owner)
-				ppp_shutdown_interface(ppp);
+				unregister_netdevice(ppp->dev);
+			rtnl_unlock();
 		}
 		if (atomic_long_read(&file->f_count) < 2) {
 			ppp_release(NULL, file);
@@ -833,11 +837,10 @@ static int ppp_unattached_ioctl(struct n
 		/* Create a new ppp unit */
 		if (get_user(unit, p))
 			break;
-		ppp = ppp_create_interface(net, unit, &err);
+		ppp = ppp_create_interface(net, unit, file, &err);
 		if (!ppp)
 			break;
 		file->private_data = &ppp->file;
-		ppp->owner = file;
 		err = -EFAULT;
 		if (put_user(ppp->file.index, p))
 			break;
@@ -911,6 +914,16 @@ static __net_init int ppp_init_net(struc
 static __net_exit void ppp_exit_net(struct net *net)
 {
 	struct ppp_net *pn = net_generic(net, ppp_net_id);
+	struct ppp *ppp;
+	LIST_HEAD(list);
+	int id;
+
+	rtnl_lock();
+	idr_for_each_entry(&pn->units_idr, ppp, id)
+		unregister_netdevice_queue(ppp->dev, &list);
+
+	unregister_netdevice_many(&list);
+	rtnl_unlock();
 
 	idr_destroy(&pn->units_idr);
 }
@@ -1083,8 +1096,28 @@ static int ppp_dev_init(struct net_devic
 	return 0;
 }
 
+static void ppp_dev_uninit(struct net_device *dev)
+{
+	struct ppp *ppp = netdev_priv(dev);
+	struct ppp_net *pn = ppp_pernet(ppp->ppp_net);
+
+	ppp_lock(ppp);
+	ppp->closing = 1;
+	ppp_unlock(ppp);
+
+	mutex_lock(&pn->all_ppp_mutex);
+	unit_put(&pn->units_idr, ppp->file.index);
+	mutex_unlock(&pn->all_ppp_mutex);
+
+	ppp->owner = NULL;
+
+	ppp->file.dead = 1;
+	wake_up_interruptible(&ppp->file.rwait);
+}
+
 static const struct net_device_ops ppp_netdev_ops = {
 	.ndo_init	 = ppp_dev_init,
+	.ndo_uninit      = ppp_dev_uninit,
 	.ndo_start_xmit  = ppp_start_xmit,
 	.ndo_do_ioctl    = ppp_net_ioctl,
 	.ndo_get_stats64 = ppp_get_stats64,
@@ -2662,8 +2695,8 @@ ppp_get_stats(struct ppp *ppp, struct pp
  * or if there is already a unit with the requested number.
  * unit == -1 means allocate a new number.
  */
-static struct ppp *
-ppp_create_interface(struct net *net, int unit, int *retp)
+static struct ppp *ppp_create_interface(struct net *net, int unit,
+					struct file *file, int *retp)
 {
 	struct ppp *ppp;
 	struct ppp_net *pn;
@@ -2682,6 +2715,7 @@ ppp_create_interface(struct net *net, in
 	ppp->mru = PPP_MRU;
 	init_ppp_file(&ppp->file, INTERFACE);
 	ppp->file.hdrlen = PPP_HDRLEN - 2;	/* don't count proto bytes */
+	ppp->owner = file;
 	for (i = 0; i < NUM_NP; ++i)
 		ppp->npmode[i] = NPMODE_PASS;
 	INIT_LIST_HEAD(&ppp->channels);
@@ -2770,34 +2804,6 @@ init_ppp_file(struct ppp_file *pf, int k
 }
 
 /*
- * Take down a ppp interface unit - called when the owning file
- * (the one that created the unit) is closed or detached.
- */
-static void ppp_shutdown_interface(struct ppp *ppp)
-{
-	struct ppp_net *pn;
-
-	pn = ppp_pernet(ppp->ppp_net);
-	mutex_lock(&pn->all_ppp_mutex);
-
-	/* This will call dev_close() for us. */
-	ppp_lock(ppp);
-	if (!ppp->closing) {
-		ppp->closing = 1;
-		ppp_unlock(ppp);
-		unregister_netdev(ppp->dev);
-		unit_put(&pn->units_idr, ppp->file.index);
-	} else
-		ppp_unlock(ppp);
-
-	ppp->file.dead = 1;
-	ppp->owner = NULL;
-	wake_up_interruptible(&ppp->file.rwait);
-
-	mutex_unlock(&pn->all_ppp_mutex);
-}
-
-/*
  * Free the memory used by a ppp unit.  This is only called once
  * there are no channels connected to the unit and no file structs
  * that reference the unit.
#357 lore raw

PATCH 350/366 ppp: fix lockdep splat in ppp_dev_uninit()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Guillaume Nault <[email protected]>

commit 58a89ecaca53736aa465170530acea4f8be34ab4 upstream.

ppp_dev_uninit() locks all_ppp_mutex while under rtnl mutex protection. ppp_create_interface() must then lock these mutexes in that same order to avoid possible deadlock.

[  120.880011] ======================================================
[  120.880011] [ INFO: possible circular locking dependency detected ]
[  120.880011] 4.2.0 #1 Not tainted
[  120.880011] -------------------------------------------------------
[  120.880011] ppp-apitest/15827 is trying to acquire lock:
[  120.880011]  (&pn->all_ppp_mutex){+.+.+.}, at: [<ffffffffa0145f56>] ppp_dev_uninit+0x64/0xb0 [ppp_generic]
[  120.880011]
[  120.880011] but task is already holding lock:
[  120.880011]  (rtnl_mutex){+.+.+.}, at: [<ffffffff812e4255>] rtnl_lock+0x12/0x14
[  120.880011]
[  120.880011] which lock already depends on the new lock.
[  120.880011]
[  120.880011]
[  120.880011] the existing dependency chain (in reverse order) is:
[  120.880011]
[  120.880011] -> #1 (rtnl_mutex){+.+.+.}:
[  120.880011]        [<ffffffff81073a6f>] lock_acquire+0xcf/0x10e
[  120.880011]        [<ffffffff813ab18a>] mutex_lock_nested+0x56/0x341
[  120.880011]        [<ffffffff812e4255>] rtnl_lock+0x12/0x14
[  120.880011]        [<ffffffff812d9d94>] register_netdev+0x11/0x27
[  120.880011]        [<ffffffffa0147b17>] ppp_ioctl+0x289/0xc98 [ppp_generic]
[  120.880011]        [<ffffffff8113b367>] do_vfs_ioctl+0x4ea/0x532
[  120.880011]        [<ffffffff8113b3fd>] SyS_ioctl+0x4e/0x7d
[  120.880011]        [<ffffffff813ad7d7>] entry_SYSCALL_64_fastpath+0x12/0x6f
[  120.880011]
[  120.880011] -> #0 (&pn->all_ppp_mutex){+.+.+.}:
[  120.880011]        [<ffffffff8107334e>] __lock_acquire+0xb07/0xe76
[  120.880011]        [<ffffffff81073a6f>] lock_acquire+0xcf/0x10e
[  120.880011]        [<ffffffff813ab18a>] mutex_lock_nested+0x56/0x341
[  120.880011]        [<ffffffffa0145f56>] ppp_dev_uninit+0x64/0xb0 [ppp_generic]
[  120.880011]        [<ffffffff812d5263>] rollback_registered_many+0x19e/0x252
[  120.880011]        [<ffffffff812d5381>] rollback_registered+0x29/0x38
[  120.880011]        [<ffffffff812d53fa>] unregister_netdevice_queue+0x6a/0x77
[  120.880011]        [<ffffffffa0146a94>] ppp_release+0x42/0x79 [ppp_generic]
[  120.880011]        [<ffffffff8112d9f6>] __fput+0xec/0x192
[  120.880011]        [<ffffffff8112dacc>] ____fput+0x9/0xb
[  120.880011]        [<ffffffff8105447a>] task_work_run+0x66/0x80
[  120.880011]        [<ffffffff81001801>] prepare_exit_to_usermode+0x8c/0xa7
[  120.880011]        [<ffffffff81001900>] syscall_return_slowpath+0xe4/0x104
[  120.880011]        [<ffffffff813ad931>] int_ret_from_sys_call+0x25/0x9f
[  120.880011]
[  120.880011] other info that might help us debug this:
[  120.880011]
[  120.880011]  Possible unsafe locking scenario:
[  120.880011]
[  120.880011]        CPU0                    CPU1
[  120.880011]        ----                    ----
[  120.880011]   lock(rtnl_mutex);
[  120.880011]                                lock(&pn->all_ppp_mutex);
[  120.880011]                                lock(rtnl_mutex);
[  120.880011]   lock(&pn->all_ppp_mutex);
[  120.880011]
[  120.880011]  *** DEADLOCK ***
Fixes 8cb775bc0a34 ("ppp: fix device unregistration upon netns deletion")
---
 drivers/net/ppp/ppp_generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ppp/ppp_generic.c +3 -1
@@ -2736,6 +2736,7 @@ static struct ppp *ppp_create_interface(
 	 */
 	dev_net_set(dev, net);
 
+	rtnl_lock();
 	mutex_lock(&pn->all_ppp_mutex);
 
 	if (unit < 0) {
@@ -2766,7 +2767,7 @@ static struct ppp *ppp_create_interface(
 	ppp->file.index = unit;
 	sprintf(dev->name, "ppp%d", unit);
 
-	ret = register_netdev(dev);
+	ret = register_netdevice(dev);
 	if (ret != 0) {
 		unit_put(&pn->units_idr, unit);
 		netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
@@ -2778,6 +2779,7 @@ static struct ppp *ppp_create_interface(
 
 	atomic_inc(&ppp_unit_count);
 	mutex_unlock(&pn->all_ppp_mutex);
+	rtnl_unlock();
 
 	*retp = 0;
 	return ppp;
#358 lore raw

PATCH 351/366 ppp: fix race in ppp device destruction

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Guillaume Nault <[email protected]>

commit 6151b8b37b119e8e3a8401b080d532520c95faf4 upstream.

ppp_release() tries to ensure that netdevices are unregistered before decrementing the unit refcount and running ppp_destroy_interface().

This is all fine as long as the the device is unregistered by ppp_release(): the unregister_netdevice() call, followed by rtnl_unlock(), guarantee that the unregistration process completes before rtnl_unlock() returns.

However, the device may be unregistered by other means (like ppp_nl_dellink()). If this happens right before ppp_release() calling rtnl_lock(), then ppp_release() has to wait for the concurrent unregistration code to release the lock.
But rtnl_unlock() releases the lock before completing the device unregistration process. This allows ppp_release() to proceed and eventually call ppp_destroy_interface() before the unregistration process completes. Calling free_netdev() on this partially unregistered device will BUG():

 ------------[ cut here ]------------
 kernel BUG at net/core/dev.c:8141!
 invalid opcode: 0000 [#1] SMP

 CPU: 1 PID: 1557 Comm: pppd Not tainted 4.14.0-rc2+ #4
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1.fc26 04/01/2014

 Call Trace:
  ppp_destroy_interface+0xd8/0xe0 [ppp_generic]
  ppp_disconnect_channel+0xda/0x110 [ppp_generic]
  ppp_unregister_channel+0x5e/0x110 [ppp_generic]
  pppox_unbind_sock+0x23/0x30 [pppox]
  pppoe_connect+0x130/0x440 [pppoe]
  SYSC_connect+0x98/0x110
  ? do_fcntl+0x2c0/0x5d0
  SyS_connect+0xe/0x10
  entry_SYSCALL_64_fastpath+0x1a/0xa5

 RIP: free_netdev+0x107/0x110 RSP: ffffc28a40573d88
 ---[ end trace ed294ff0cc40eeff ]---

We could set the ->needs_free_netdev flag on PPP devices and move the ppp_destroy_interface() logic in the ->priv_destructor() callback. But that'd be quite intrusive as we'd first need to unlink from the other channels and units that depend on the device (the ones that used the PPPIOCCONNECT and PPPIOCATTACH ioctls).

Instead, we can just let the netdevice hold a reference on its ppp_file. This reference is dropped in ->priv_destructor(), at the very end of the unregistration process, so that neither ppp_release() nor ppp_disconnect_channel() can call ppp_destroy_interface() in the interim.

Fixes 8cb775bc0a34 ("ppp: fix device unregistration upon netns deletion")

[bwh: Backported to 3.16: Set net_device::destructor instead of
priv_destructor, and call ppp_dev_priv_destructor() if register_netdevice() fails after call ppp_dev_init().]

---
 drivers/net/ppp/ppp_generic.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/net/ppp/ppp_generic.c +26 -0
@@ -1092,7 +1092,17 @@ ppp_get_stats64(struct net_device *dev,
 static struct lock_class_key ppp_tx_busylock;
 static int ppp_dev_init(struct net_device *dev)
 {
+	struct ppp *ppp;
+
 	dev->qdisc_tx_busylock = &ppp_tx_busylock;
+
+	ppp = netdev_priv(dev);
+	/* Let the netdevice take a reference on the ppp file. This ensures
+	 * that ppp_destroy_interface() won't run before the device gets
+	 * unregistered.
+	 */
+	atomic_inc(&ppp->file.refcnt);
+
 	return 0;
 }
 
@@ -1115,6 +1125,15 @@ static void ppp_dev_uninit(struct net_de
 	wake_up_interruptible(&ppp->file.rwait);
 }
 
+static void ppp_dev_priv_destructor(struct net_device *dev)
+{
+	struct ppp *ppp;
+
+	ppp = netdev_priv(dev);
+	if (atomic_dec_and_test(&ppp->file.refcnt))
+		ppp_destroy_interface(ppp);
+}
+
 static const struct net_device_ops ppp_netdev_ops = {
 	.ndo_init	 = ppp_dev_init,
 	.ndo_uninit      = ppp_dev_uninit,
@@ -1134,6 +1153,7 @@ static void ppp_setup(struct net_device
 	dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
 	dev->features |= NETIF_F_NETNS_LOCAL;
 	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
+	dev->destructor = ppp_dev_priv_destructor;
 }
 
 /*
@@ -2769,6 +2789,12 @@ static struct ppp *ppp_create_interface(
 
 	ret = register_netdevice(dev);
 	if (ret != 0) {
+		/* register_netdevice() may have called ppp_dev_init()
+		 * but will not have called our destructor, so do that
+		 * now.
+		 */
+		if (dev->qdisc_tx_busylock)
+			ppp_dev_priv_destructor(dev);
 		unit_put(&pn->units_idr, unit);
 		netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
 			   dev->name, ret);
#359 lore raw

PATCH 352/366 ppp: Fix null pointer dereference on registration failure

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Ben Hutchings <[email protected]>

register_netdevice() will call the device's ndo_uninit operation if registration fails after it calls the ndo_init operation. However ppp_dev_uninit() uses ppp->ppp_net which is currently not set until after register_netdevice() returns.

This was fixed upstream as part of commit 6d934c70db6e "ppp: add rtnetlink device creation support".

---

drivers/net/ppp/ppp_generic.c +1 -2
@@ -2732,6 +2732,7 @@ static struct ppp *ppp_create_interface(
 
 	ppp = netdev_priv(dev);
 	ppp->dev = dev;
+	ppp->ppp_net = net;
 	ppp->mru = PPP_MRU;
 	init_ppp_file(&ppp->file, INTERFACE);
 	ppp->file.hdrlen = PPP_HDRLEN - 2;	/* don't count proto bytes */
@@ -2801,8 +2802,6 @@ static struct ppp *ppp_create_interface(
 		goto out2;
 	}
 
-	ppp->ppp_net = net;
-
 	atomic_inc(&ppp_unit_count);
 	mutex_unlock(&pn->all_ppp_mutex);
 	rtnl_unlock();
#360 lore raw

PATCH 353/366 ppp: unlock all_ppp_mutex before registering device

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Guillaume Nault <[email protected]>

commit 0171c41835591e9aa2e384b703ef9a6ae367c610 upstream.

ppp_dev_uninit(), which is the .ndo_uninit() handler of PPP devices, needs to lock pn->all_ppp_mutex. Therefore we mustn't call register_netdevice() with pn->all_ppp_mutex already locked, or we'd deadlock in case register_netdevice() fails and calls .ndo_uninit().

Fortunately, we can unlock pn->all_ppp_mutex before calling register_netdevice(). This lock protects pn->units_idr, which isn't used in the device registration process.

However, keeping pn->all_ppp_mutex locked during device registration did ensure that no device in transient state would be published in pn->units_idr. In practice, unlocking it before calling register_netdevice() doesn't change this property: ppp_unit_register() is called with 'ppp_mutex' locked and all searches done in pn->units_idr hold this lock too.

Fixes 8cb775bc0a34 ("ppp: fix device unregistration upon netns deletion")
Reported-and-tested-by [email protected]
[bwh: Backported to 3.16: adjust context]
---
 drivers/net/ppp/ppp_generic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ppp/ppp_generic.c +3 -1
@@ -2788,6 +2788,8 @@ static struct ppp *ppp_create_interface(
 	ppp->file.index = unit;
 	sprintf(dev->name, "ppp%d", unit);
 
+	mutex_unlock(&pn->all_ppp_mutex);
+
 	ret = register_netdevice(dev);
 	if (ret != 0) {
 		/* register_netdevice() may have called ppp_dev_init()
@@ -2796,6 +2798,7 @@ static struct ppp *ppp_create_interface(
 		 */
 		if (dev->qdisc_tx_busylock)
 			ppp_dev_priv_destructor(dev);
+		mutex_lock(&pn->all_ppp_mutex);
 		unit_put(&pn->units_idr, unit);
 		netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
 			   dev->name, ret);
@@ -2803,7 +2806,6 @@ static struct ppp *ppp_create_interface(
 	}
 
 	atomic_inc(&ppp_unit_count);
-	mutex_unlock(&pn->all_ppp_mutex);
 	rtnl_unlock();
 
 	*retp = 0;
#361 lore raw

PATCH 354/366 ppp: remove the PPPIOCDETACH ioctl

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Eric Biggers <[email protected]>

commit af8d3c7c001ae7df1ed2b2715f058113efc86187 upstream.

The PPPIOCDETACH ioctl effectively tries to "close" the given ppp file before f_count has reached 0, which is fundamentally a bad idea. It does check 'f_count < 2', which excludes concurrent operations on the file since they would only be possible with a shared fd table, in which case each fdget() would take a file reference. However, it fails to account for the fact that even with 'f_count == 1' the file can still be linked into epoll instances. As reported by syzbot, this can trivially be used to cause a use-after-free.

Yet, the only known user of PPPIOCDETACH is pppd versions older than ppp-2.4.2, which was released almost 15 years ago (November 2003). Also, PPPIOCDETACH apparently stopped working reliably at around the same time, when the f_count check was added to the kernel, e.g. see
https://lkml.org/lkml/2002/12/31/83. Also, the current 'f_count < 2' check makes PPPIOCDETACH only work in single-threaded applications; it always fails if called from a multithreaded application.

All pppd versions released in the last 15 years just close() the file descriptor instead.

Therefore, instead of hacking around this bug by exporting epoll internals to modules, and probably missing other related bugs, just remove the PPPIOCDETACH ioctl and see if anyone actually notices. Leave a stub in place that prints a one-time warning and returns EINVAL.

---
 Documentation/networking/ppp_generic.txt |  6 ------
 drivers/net/ppp/ppp_generic.c            | 27 +++++-------------------
 include/uapi/linux/ppp-ioctl.h           |  2 +-
 3 files changed, 6 insertions(+), 29 deletions(-)
Documentation/networking/ppp_generic.txt +0 -6
@@ -300,12 +300,6 @@ unattached instance are:
 The ioctl calls available on an instance of /dev/ppp attached to a
 channel are:
 
-* PPPIOCDETACH detaches the instance from the channel.  This ioctl is
-  deprecated since the same effect can be achieved by closing the
-  instance.  In order to prevent possible races this ioctl will fail
-  with an EINVAL error if more than one file descriptor refers to this
-  instance (i.e. as a result of dup(), dup2() or fork()).
-
 * PPPIOCCONNECT connects this channel to a PPP interface.  The
   argument should point to an int containing the interface unit
   number.  It will return an EINVAL error if the channel is already
drivers/net/ppp/ppp_generic.c +5 -22
@@ -584,30 +584,13 @@ static long ppp_ioctl(struct file *file,
 
 	if (cmd == PPPIOCDETACH) {
 		/*
-		 * We have to be careful here... if the file descriptor
-		 * has been dup'd, we could have another process in the
-		 * middle of a poll using the same file *, so we had
-		 * better not free the interface data structures -
-		 * instead we fail the ioctl.  Even in this case, we
-		 * shut down the interface if we are the owner of it.
-		 * Actually, we should get rid of PPPIOCDETACH, userland
-		 * (i.e. pppd) could achieve the same effect by closing
-		 * this fd and reopening /dev/ppp.
+		 * PPPIOCDETACH is no longer supported as it was heavily broken,
+		 * and is only known to have been used by pppd older than
+		 * ppp-2.4.2 (released November 2003).
 		 */
+		pr_warn_once("%s (%d) used obsolete PPPIOCDETACH ioctl\n",
+			     current->comm, current->pid);
 		err = -EINVAL;
-		if (pf->kind == INTERFACE) {
-			ppp = PF_TO_PPP(pf);
-			rtnl_lock();
-			if (file == ppp->owner)
-				unregister_netdevice(ppp->dev);
-			rtnl_unlock();
-		}
-		if (atomic_long_read(&file->f_count) < 2) {
-			ppp_release(NULL, file);
-			err = 0;
-		} else
-			pr_warn("PPPIOCDETACH file->f_count=%ld\n",
-				atomic_long_read(&file->f_count));
 		goto out;
 	}
 
include/uapi/linux/ppp-ioctl.h +1 -1
@@ -105,7 +105,7 @@ struct pppol2tp_ioc_stats {
 #define PPPIOCGIDLE	_IOR('t', 63, struct ppp_idle) /* get idle time */
 #define PPPIOCNEWUNIT	_IOWR('t', 62, int)	/* create new ppp unit */
 #define PPPIOCATTACH	_IOW('t', 61, int)	/* attach to ppp unit */
-#define PPPIOCDETACH	_IOW('t', 60, int)	/* detach from ppp unit/chan */
+#define PPPIOCDETACH	_IOW('t', 60, int)	/* obsolete, do not use */
 #define PPPIOCSMRRU	_IOW('t', 59, int)	/* set multilink MRU */
 #define PPPIOCCONNECT	_IOW('t', 58, int)	/* connect channel to unit */
 #define PPPIOCDISCONN	_IO('t', 57)		/* disconnect channel */
#362 lore raw

PATCH 355/366 enic: set DMA mask to 47 bit

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Govindarajulu Varadarajan <[email protected]>

commit 322eaa06d55ebc1402a4a8d140945cff536638b4 upstream.

In commit 624dbf55a359b ("driver/net: enic: Try DMA 64 first, then failover to DMA") DMA mask was changed from 40 bits to 64 bits. Hardware actually supports only 47 bits.

Fixes 624dbf55a359b ("driver/net: enic: Try DMA 64 first, then failover to DMA")
---
 drivers/net/ethernet/cisco/enic/enic_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/cisco/enic/enic_main.c +4 -4
@@ -2198,11 +2198,11 @@ static int enic_probe(struct pci_dev *pd
 	pci_set_master(pdev);
 
 	/* Query PCI controller on system for DMA addressing
-	 * limitation for the device.  Try 64-bit first, and
+	 * limitation for the device.  Try 47-bit first, and
 	 * fail to 32-bit.
 	 */
 
-	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
+	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(47));
 	if (err) {
 		err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
 		if (err) {
@@ -2216,10 +2216,10 @@ static int enic_probe(struct pci_dev *pd
 			goto err_out_release_regions;
 		}
 	} else {
-		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(47));
 		if (err) {
 			dev_err(dev, "Unable to obtain %u-bit DMA "
-				"for consistent allocations, aborting\n", 64);
+				"for consistent allocations, aborting\n", 47);
 			goto err_out_release_regions;
 		}
 		using_dac = 1;
#363 lore raw

PATCH 356/366 Revert "ipc/shm: Fix shmat mmap nil-page protection"

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Davidlohr Bueso <[email protected]>

commit a73ab244f0dad8fffb3291b905f73e2d3eaa7c00 upstream.

Patch series "ipc/shm: shmat() fixes around nil-page".

These patches fix two issues reported[1] a while back by Joe and Andrea around how shmat(2) behaves with nil-page.

The first reverts a commit that it was incorrectly thought that mapping nil-page (address=0) was a no no with MAP_FIXED. This is not the case, with the exception of SHM_REMAP; which is address in the second patch.

I chose two patches because it is easier to backport and it explicitly reverts bogus behaviour. Both patches ought to be in -stable and ltp testcases need updated (the added testcase around the cve can be modified to just test for SHM_RND|SHM_REMAP).

[1] lkml.kernel.org/r/20180430172152.nfa564pvgpk3ut7p@linux-n805

This patch (of 2):

Commit 95e91b831f87 ("ipc/shm: Fix shmat mmap nil-page protection") worked on the idea that we should not be mapping as root addr=0 and MAP_FIXED. However, it was reported that this scenario is in fact valid, thus making the patch both bogus and breaks userspace as well.

For example X11's libint10.so relies on shmat(1, SHM_RND) for lowmem initialization[1].

[1] https://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/os-support/linux/int10/linux.c#n347

---
 ipc/shm.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
ipc/shm.c +2 -7
@@ -1112,13 +1112,8 @@ long do_shmat(int shmid, char __user *sh
 		goto out;
 	else if ((addr = (ulong)shmaddr)) {
 		if (addr & (shmlba - 1)) {
-			/*
-			 * Round down to the nearest multiple of shmlba.
-			 * For sane do_mmap_pgoff() parameters, avoid
-			 * round downs that trigger nil-page and MAP_FIXED.
-			 */
-			if ((shmflg & SHM_RND) && addr >= shmlba)
-				addr &= ~(shmlba - 1);
+			if (shmflg & SHM_RND)
+				addr &= ~(shmlba - 1);  /* round down */
 			else
 #ifndef __ARCH_FORCE_SHMLBA
 				if (addr & ~PAGE_MASK)
#364 lore raw

PATCH 357/366 ipc/shm: fix shmat() nil address after round-down when remapping

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Davidlohr Bueso <[email protected]>

commit 8f89c007b6dec16a1793cb88de88fcc02117bbbc upstream.

shmat()'s SHM_REMAP option forbids passing a nil address for; this is in fact the very first thing we check for. Andrea reported that for SHM_RND|SHM_REMAP cases we can end up bypassing the initial addr check, but we need to check again if the address was rounded down to nil. As of this patch, such cases will return -EINVAL.

---
 ipc/shm.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
ipc/shm.c +10 -2
@@ -1112,9 +1112,17 @@ long do_shmat(int shmid, char __user *sh
 		goto out;
 	else if ((addr = (ulong)shmaddr)) {
 		if (addr & (shmlba - 1)) {
-			if (shmflg & SHM_RND)
+			if (shmflg & SHM_RND) {
 				addr &= ~(shmlba - 1);  /* round down */
-			else
+
+				/*
+				 * Ensure that the round-down is non-nil
+				 * when remapping. This can happen for
+				 * cases when addr < shmlba.
+				 */
+				if (!addr && (shmflg & SHM_REMAP))
+					goto out;
+			} else
 #ifndef __ARCH_FORCE_SHMLBA
 				if (addr & ~PAGE_MASK)
 #endif
#365 lore raw

PATCH 358/366 kernel/sys.c: fix potential Spectre v1 issue

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: "Gustavo A. R. Silva" <[email protected]>

commit 23d6aef74da86a33fa6bb75f79565e0a16ee97c2 upstream.

`resource' can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

kernel/sys.c:1474 __do_compat_sys_old_getrlimit() warn: potential spectre issue 'get_current()->signal->rlim' (local cap) kernel/sys.c:1455 __do_sys_old_getrlimit() warn: potential spectre issue 'get_current()->signal->rlim' (local cap)

Fix this by sanitizing *resource* before using it to index current->signal->rlim

Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

[bwh: Backported to 3.16:
- Drop changes to compat implementation, which is a wrapper for the regular implementation here
- Adjust context]

---

kernel/sys.c +4 -0
@@ -63,6 +63,9 @@
 #include <asm/io.h>
 #include <asm/unistd.h>
 
+/* Hardening for Spectre-v1 */
+#include <linux/nospec.h>
+
 #ifndef SET_UNALIGN_CTL
 # define SET_UNALIGN_CTL(a,b)	(-EINVAL)
 #endif
@@ -1294,6 +1297,7 @@ SYSCALL_DEFINE2(old_getrlimit, unsigned
 	if (resource >= RLIM_NLIMITS)
 		return -EINVAL;
 
+	resource = array_index_nospec(resource, RLIM_NLIMITS);
 	task_lock(current->group_leader);
 	x = current->signal->rlim[resource];
 	task_unlock(current->group_leader);
#366 lore raw

PATCH 359/366 tracing: Fix crash when freeing instances with event triggers

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: "Steven Rostedt (VMware)" <[email protected]>

commit 86b389ff22bd6ad8fd3cb98e41cd271886c6d023 upstream.

If a instance has an event trigger enabled when it is freed, it could cause an access of free memory. Here's the case that crashes:

 # cd /sys/kernel/tracing
 # mkdir instances/foo
 # echo snapshot > instances/foo/events/initcall/initcall_start/trigger
 # rmdir instances/foo

Would produce:

 general protection fault: 0000 [#1] PREEMPT SMP PTI
 Modules linked in: tun bridge ...
 CPU: 5 PID: 6203 Comm: rmdir Tainted: G        W         4.17.0-rc4-test+ #933
 Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03 07/14/2016
 RIP: 0010:clear_event_triggers+0x3b/0x70
 RSP: 0018:ffffc90003783de0 EFLAGS: 00010286
 RAX: 0000000000000000 RBX: 6b6b6b6b6b6b6b2b RCX: 0000000000000000
 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8800c7130ba0
 RBP: ffffc90003783e00 R08: ffff8801131993f8 R09: 0000000100230016
 R10: ffffc90003783d80 R11: 0000000000000000 R12: ffff8800c7130ba0
 R13: ffff8800c7130bd8 R14: ffff8800cc093768 R15: 00000000ffffff9c
 FS:  00007f6f4aa86700(0000) GS:ffff88011eb40000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007f6f4a5aed60 CR3: 00000000cd552001 CR4: 00000000001606e0
 Call Trace:
  event_trace_del_tracer+0x2a/0xc5
  instance_rmdir+0x15c/0x200
  tracefs_syscall_rmdir+0x52/0x90
  vfs_rmdir+0xdb/0x160
  do_rmdir+0x16d/0x1c0
  __x64_sys_rmdir+0x17/0x20
  do_syscall_64+0x55/0x1a0
  entry_SYSCALL_64_after_hwframe+0x49/0xbe

This was due to the call the clears out the triggers when an instance is being deleted not removing the trigger from the link list.

Fixes 85f2b08268c01 ("tracing: Add basic event trigger framework")
---
 kernel/trace/trace_events_trigger.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/trace/trace_events_trigger.c +3 -2
@@ -469,9 +469,10 @@ clear_event_triggers(struct trace_array
 	struct ftrace_event_file *file;
 
 	list_for_each_entry(file, &tr->events, list) {
-		struct event_trigger_data *data;
-		list_for_each_entry_rcu(data, &file->triggers, list) {
+		struct event_trigger_data *data, *n;
+		list_for_each_entry_safe(data, n, &file->triggers, list) {
 			trace_event_trigger_enable_disable(file, 0);
+			list_del_rcu(&data->list);
 			if (data->ops->free)
 				data->ops->free(data->ops, data);
 		}
#367 lore raw

PATCH 360/366 drm/i915: Disable LVDS on Radiant P845

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Ondrej Zary <[email protected]>

commit b3fb22733ae61050f8d10a1d6a8af176c5c5db1a upstream.

Radiant P845 does not have LVDS, only VGA.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105468

---
 drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_lvds.c +8 -0
@@ -739,6 +739,14 @@ static const struct dmi_system_id intel_
 			DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"),
 		},
 	},
+	{
+		.callback = intel_no_lvds_dmi_callback,
+		.ident = "Radiant P845",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Radiant Systems Inc"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "P845"),
+		},
+	},
 
 	{ }	/* terminating entry */
 };
#368 lore raw

PATCH 361/366 selinux: KASAN: slab-out-of-bounds in xattr_getsecurity

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Sachin Grover <[email protected]>

commit efe3de79e0b52ca281ef6691480c8c68c82a4657 upstream.

Call trace:
 [<ffffff9203a8d7a8>] dump_backtrace+0x0/0x428
 [<ffffff9203a8dbf8>] show_stack+0x28/0x38
 [<ffffff920409bfb8>] dump_stack+0xd4/0x124
 [<ffffff9203d187e8>] print_address_description+0x68/0x258
 [<ffffff9203d18c00>] kasan_report.part.2+0x228/0x2f0
 [<ffffff9203d1927c>] kasan_report+0x5c/0x70
 [<ffffff9203d1776c>] check_memory_region+0x12c/0x1c0
 [<ffffff9203d17cdc>] memcpy+0x34/0x68
 [<ffffff9203d75348>] xattr_getsecurity+0xe0/0x160
 [<ffffff9203d75490>] vfs_getxattr+0xc8/0x120
 [<ffffff9203d75d68>] getxattr+0x100/0x2c8
 [<ffffff9203d76fb4>] SyS_fgetxattr+0x64/0xa0
 [<ffffff9203a83f70>] el0_svc_naked+0x24/0x28

If user get root access and calls security.selinux setxattr() with an embedded NUL on a file and then if some process performs a getxattr() on that file with a length greater than the actual length of the string, it would result in a panic.

To fix this, add the actual length of the string to the security context instead of the length passed by the userspace process.

---
 security/selinux/ss/services.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/ss/services.c +1 -1
@@ -1270,7 +1270,7 @@ static int security_context_to_sid_core(
 				      scontext_len, &context, def_sid);
 	if (rc == -EINVAL && force) {
 		context.str = str;
-		context.len = scontext_len;
+		context.len = strlen(str) + 1;
 		str = NULL;
 	} else if (rc)
 		goto out_unlock;
#369 lore raw

PATCH 362/366 net: ethernet: ti: cpdma: correct error handling for chan create

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Ivan Khoronzhuk <[email protected]>

commit 8a83c5d7969b8433584e3cf658a8d76c4dc37f4d upstream.

It's not correct to return NULL when that is actually an error and function returns errors in any other wrong case. In the same time, the cpsw driver and davinci emac doesn't check error case while creating channel and it can miss actual error. Also remove WARNs replacing them on dev_err msgs.

[bwh: Backported to 3.16:
- Channel pointers are stored in different fields
- Adjust context]

---
 drivers/net/ethernet/ti/cpsw.c          | 12 +++++++++---
 drivers/net/ethernet/ti/davinci_cpdma.c |  2 +-
 drivers/net/ethernet/ti/davinci_emac.c  | 11 +++++++++--
 3 files changed, 19 insertions(+), 6 deletions(-)
drivers/net/ethernet/ti/cpsw.c +9 -4
@@ -2216,12 +2216,17 @@ static int cpsw_probe(struct platform_de
 
 	priv->txch = cpdma_chan_create(priv->dma, tx_chan_num(0),
 				       cpsw_tx_handler);
+	if (IS_ERR(priv->txch)) {
+		dev_err(priv->dev, "error initializing tx dma channel\n");
+		ret = PTR_ERR(priv->txch);
+		goto clean_dma_ret;
+	}
+
 	priv->rxch = cpdma_chan_create(priv->dma, rx_chan_num(0),
 				       cpsw_rx_handler);
-
-	if (WARN_ON(!priv->txch || !priv->rxch)) {
-		dev_err(priv->dev, "error initializing dma channels\n");
-		ret = -ENOMEM;
+	if (IS_ERR(priv->rxch)) {
+		dev_err(priv->dev, "error initializing rx dma channel\n");
+		ret = PTR_ERR(priv->rxch);
 		goto clean_dma_ret;
 	}
 
drivers/net/ethernet/ti/davinci_cpdma.c +1 -1
@@ -503,7 +503,7 @@ struct cpdma_chan *cpdma_chan_create(str
 	unsigned long flags;
 
 	if (__chan_linear(chan_num) >= ctlr->num_chan)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	chan = devm_kzalloc(ctlr->dev, sizeof(*chan), GFP_KERNEL);
 	if (!chan)
drivers/net/ethernet/ti/davinci_emac.c +9 -2
@@ -1951,10 +1951,17 @@ static int davinci_emac_probe(struct pla
 
 	priv->txchan = cpdma_chan_create(priv->dma, tx_chan_num(EMAC_DEF_TX_CH),
 				       emac_tx_handler);
+	if (IS_ERR(priv->txchan)) {
+		dev_err(&pdev->dev, "error initializing tx dma channel\n");
+		rc = PTR_ERR(priv->txchan);
+		goto no_cpdma_chan;
+	}
+
 	priv->rxchan = cpdma_chan_create(priv->dma, rx_chan_num(EMAC_DEF_RX_CH),
 				       emac_rx_handler);
-	if (WARN_ON(!priv->txchan || !priv->rxchan)) {
-		rc = -ENOMEM;
+	if (IS_ERR(priv->rxchan)) {
+		dev_err(&pdev->dev, "error initializing rx dma channel\n");
+		rc = PTR_ERR(priv->rxchan);
 		goto no_cpdma_chan;
 	}
 
#370 lore raw

PATCH 363/366 net: davinci_emac: Fix runtime pm calls for davinci_emac

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Tony Lindgren <[email protected]>

commit b5133e7a988b2cf8e1cd2b23231f36aff35ceffc upstream.

Commit 3ba97381343b ("net: ethernet: davinci_emac: add pm_runtime support") added support for runtime PM, but it causes issues on omap3 related devices that actually gate the clocks:

Unhandled fault: external abort on non-linefetch (0x1008)
...
[<c04160f0>] (emac_dev_getnetstats) from [<c04d6a3c>] (dev_get_stats+0x78/0xc8) [<c04d6a3c>] (dev_get_stats) from [<c04e9ccc>] (rtnl_fill_ifinfo+0x3b8/0x938) [<c04e9ccc>] (rtnl_fill_ifinfo) from [<c04eade4>] (rtmsg_ifinfo+0x68/0xd8) [<c04eade4>] (rtmsg_ifinfo) from [<c04dd35c>] (register_netdevice+0x3a0/0x4ec) [<c04dd35c>] (register_netdevice) from [<c04dd4bc>] (register_netdev+0x14/0x24) [<c04dd4bc>] (register_netdev) from [<c041755c>] (davinci_emac_probe+0x408/0x5c8) [<c041755c>] (davinci_emac_probe) from [<c0396d78>] (platform_drv_probe+0x48/0xa4)

Let's fix it by moving the pm_runtime_get() call earlier, and also add it to the emac_dev_getnetstats(). Also note that we want to use pm_runtime_get_sync() as we don't want to have deferred_resume happen. And let's also check the return value for pm_runtime_get_sync() as noted by Felipe Balbi <[email protected]>.

---
 drivers/net/ethernet/ti/davinci_emac.c | 33 ++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)
drivers/net/ethernet/ti/davinci_emac.c +29 -4
@@ -1537,7 +1537,13 @@ static int emac_dev_open(struct net_devi
 	int i = 0;
 	struct emac_priv *priv = netdev_priv(ndev);
 
-	pm_runtime_get(&priv->pdev->dev);
+	ret = pm_runtime_get_sync(&priv->pdev->dev);
+	if (ret < 0) {
+		pm_runtime_put_noidle(&priv->pdev->dev);
+		dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
+			__func__, ret);
+		return ret;
+	}
 
 	netif_carrier_off(ndev);
 	for (cnt = 0; cnt < ETH_ALEN; cnt++)
@@ -1724,6 +1730,15 @@ static struct net_device_stats *emac_dev
 	struct emac_priv *priv = netdev_priv(ndev);
 	u32 mac_control;
 	u32 stats_clear_mask;
+	int err;
+
+	err = pm_runtime_get_sync(&priv->pdev->dev);
+	if (err < 0) {
+		pm_runtime_put_noidle(&priv->pdev->dev);
+		dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n",
+			__func__, err);
+		return &ndev->stats;
+	}
 
 	/* update emac hardware stats and reset the registers*/
 
@@ -1766,6 +1781,8 @@ static struct net_device_stats *emac_dev
 	ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
 	emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
 
+	pm_runtime_put(&priv->pdev->dev);
+
 	return &ndev->stats;
 }
 
@@ -1985,12 +2002,22 @@ static int davinci_emac_probe(struct pla
 	ndev->ethtool_ops = &ethtool_ops;
 	netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT);
 
+	pm_runtime_enable(&pdev->dev);
+	rc = pm_runtime_get_sync(&pdev->dev);
+	if (rc < 0) {
+		pm_runtime_put_noidle(&pdev->dev);
+		dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n",
+			__func__, rc);
+		goto no_cpdma_chan;
+	}
+
 	/* register the network device */
 	SET_NETDEV_DEV(ndev, &pdev->dev);
 	rc = register_netdev(ndev);
 	if (rc) {
 		dev_err(&pdev->dev, "error in register_netdev\n");
 		rc = -ENODEV;
+		pm_runtime_put(&pdev->dev);
 		goto no_cpdma_chan;
 	}
 
@@ -2000,9 +2027,7 @@ static int davinci_emac_probe(struct pla
 			   "(regs: %p, irq: %d)\n",
 			   (void *)priv->emac_base_phys, ndev->irq);
 	}
-
-	pm_runtime_enable(&pdev->dev);
-	pm_runtime_resume(&pdev->dev);
+	pm_runtime_put(&pdev->dev);
 
 	return 0;
 
#371 lore raw

PATCH 364/366 net: ethernet: davinci_emac: fix error handling in probe()

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Dan Carpenter <[email protected]>

commit 8005b09d99fac78e6f5fb9da30b5ae94840af03b upstream.

The current error handling code has an issue where it does:

	if (priv->txchan)
		cpdma_chan_destroy(priv->txchan);

The problem is that ->txchan is either valid or an error pointer (which would lead to an Oops). I've changed it to use multiple error labels so that the test can be removed.

Also there were some missing calls to netif_napi_del().

Fixes 3ef0fdb2342c ("net: davinci_emac: switch to new cpdma layer")
---
 drivers/net/ethernet/ti/davinci_emac.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/net/ethernet/ti/davinci_emac.c +12 -10
@@ -1971,7 +1971,7 @@ static int davinci_emac_probe(struct pla
 	if (IS_ERR(priv->txchan)) {
 		dev_err(&pdev->dev, "error initializing tx dma channel\n");
 		rc = PTR_ERR(priv->txchan);
-		goto no_cpdma_chan;
+		goto err_free_dma;
 	}
 
 	priv->rxchan = cpdma_chan_create(priv->dma, rx_chan_num(EMAC_DEF_RX_CH),
@@ -1979,14 +1979,14 @@ static int davinci_emac_probe(struct pla
 	if (IS_ERR(priv->rxchan)) {
 		dev_err(&pdev->dev, "error initializing rx dma channel\n");
 		rc = PTR_ERR(priv->rxchan);
-		goto no_cpdma_chan;
+		goto err_free_txchan;
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "error getting irq res\n");
 		rc = -ENOENT;
-		goto no_cpdma_chan;
+		goto err_free_rxchan;
 	}
 	ndev->irq = res->start;
 
@@ -2008,7 +2008,7 @@ static int davinci_emac_probe(struct pla
 		pm_runtime_put_noidle(&pdev->dev);
 		dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n",
 			__func__, rc);
-		goto no_cpdma_chan;
+		goto err_napi_del;
 	}
 
 	/* register the network device */
@@ -2018,7 +2018,7 @@ static int davinci_emac_probe(struct pla
 		dev_err(&pdev->dev, "error in register_netdev\n");
 		rc = -ENODEV;
 		pm_runtime_put(&pdev->dev);
-		goto no_cpdma_chan;
+		goto err_napi_del;
 	}
 
 
@@ -2031,11 +2031,13 @@ static int davinci_emac_probe(struct pla
 
 	return 0;
 
-no_cpdma_chan:
-	if (priv->txchan)
-		cpdma_chan_destroy(priv->txchan);
-	if (priv->rxchan)
-		cpdma_chan_destroy(priv->rxchan);
+err_napi_del:
+	netif_napi_del(&priv->napi);
+err_free_rxchan:
+	cpdma_chan_destroy(priv->rxchan);
+err_free_txchan:
+	cpdma_chan_destroy(priv->txchan);
+err_free_dma:
 	cpdma_ctlr_destroy(priv->dma);
 no_pdata:
 	free_netdev(ndev);
#372 lore raw

PATCH 365/366 ip_tunnel: restore binding to ifaces with a large mtu

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Nicolas Dichtel <[email protected]>

commit 82612de1c98e610d194e34178bde3cca7dedce41 upstream.

After commit f6cc9c054e77, the following conf is broken (note that the default loopback mtu is 65536, ie IP_MAX_MTU + 1):

$ ip tunnel add gre1 mode gre local 10.125.0.1 remote 10.125.0.2 dev lo
add tunnel "gre0" failed: Invalid argument
$ ip l a type dummy
$ ip l s dummy1 up
$ ip l s dummy1 mtu 65535
$ ip tunnel add gre1 mode gre local 10.125.0.1 remote 10.125.0.2 dev dummy1
add tunnel "gre0" failed: Invalid argument

dev_set_mtu() doesn't allow to set a mtu which is too large. First, let's cap the mtu returned by ip_tunnel_bind_dev(). Second, remove the magic value 0xFFF8 and use IP_MAX_MTU instead.
0xFFF8 seems to be there for ages, I don't know why this value was used.

With a recent kernel, it's also possible to set a mtu > IP_MAX_MTU:

$ ip l s dummy1 mtu 66000
After that patch, it's also possible to bind an ip tunnel on that kind of
interface.

[bwh: Backported to 3.16:
- Drop change in ip_tunnel_create()
- Adjust context]

---

net/ipv4/ip_tunnel.c +3 -3
@@ -387,7 +387,7 @@ static int ip_tunnel_bind_dev(struct net
 
 	if (tdev) {
 		hlen = tdev->hard_header_len + tdev->needed_headroom;
-		mtu = tdev->mtu;
+		mtu = min(tdev->mtu, IP_MAX_MTU);
 	}
 	dev->iflink = tunnel->parms.link;
 
@@ -851,7 +851,7 @@ int ip_tunnel_change_mtu(struct net_devi
 	int t_hlen = tunnel->hlen + sizeof(struct iphdr);
 
 	if (new_mtu < 68 ||
-	    new_mtu > 0xFFF8 - dev->hard_header_len - t_hlen)
+	    new_mtu > IP_MAX_MTU - dev->hard_header_len - t_hlen)
 		return -EINVAL;
 	dev->mtu = new_mtu;
 	return 0;
@@ -979,7 +979,7 @@ int ip_tunnel_newlink(struct net_device
 
 	mtu = ip_tunnel_bind_dev(dev);
 	if (tb[IFLA_MTU]) {
-		unsigned int max = 0xfff8 - dev->hard_header_len - nt->hlen;
+		unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen;
 
 		mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU,
 			    (unsigned int)(max - sizeof(struct iphdr)));
#373 lore raw

PATCH 366/366 give up on gcc ilog2() constant optimizations

In reply to Ben Hutchings

3.16.60-rc1 review patch. If anyone has any objections, please let me know.

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

From: Linus Torvalds <[email protected]>

commit 474c90156c8dcc2fa815e6716cc9394d7930cb9c upstream.

gcc-7 has an "optimization" pass that completely screws up, and generates the code expansion for the (impossible) case of calling ilog2() with a zero constant, even when the code gcc compiles does not actually have a zero constant.

And we try to generate a compile-time error for anybody doing ilog2() on a constant where that doesn't make sense (be it zero or negative). So now gcc7 will fail the build due to our sanity checking, because it created that constant-zero case that didn't actually exist in the source code.

There's a whole long discussion on the kernel mailing about how to work around this gcc bug. The gcc people themselevs have discussed their "feature" in

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785

but it's all water under the bridge, because while it looked at one point like it would be solved by the time gcc7 was released, that was not to be.

So now we have to deal with this compiler braindamage.

And the only simple approach seems to be to just delete the code that tries to warn about bad uses of ilog2().

So now "ilog2()" will just return 0 not just for the value 1, but for any non-positive value too.

It's not like I can recall anybody having ever actually tried to use this function on any invalid value, but maybe the sanity check just meant that such code never made it out in public.

Cc John Stultz <[email protected]>,
Cc Thomas Gleixner <[email protected]>
Cc Ard Biesheuvel <[email protected]>
[bwh: Backported to 3.16: There's only one log2.h file]

---

include/linux/log2.h +2 -11
@@ -16,12 +16,6 @@
 #include <linux/bitops.h>
 
 /*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
-/*
  * non-constant log of base 2 calculators
  * - the arch may override these in asm/bitops.h if they can be implemented
  *   more efficiently than using fls() and fls64()
@@ -85,7 +79,7 @@ unsigned long __rounddown_pow_of_two(uns
 #define ilog2(n)				\
 (						\
 	__builtin_constant_p(n) ? (		\
-		(n) < 1 ? ____ilog2_NaN() :	\
+		(n) < 2 ? 0 :			\
 		(n) & (1ULL << 63) ? 63 :	\
 		(n) & (1ULL << 62) ? 62 :	\
 		(n) & (1ULL << 61) ? 61 :	\
@@ -148,10 +142,7 @@ unsigned long __rounddown_pow_of_two(uns
 		(n) & (1ULL <<  4) ?  4 :	\
 		(n) & (1ULL <<  3) ?  3 :	\
 		(n) & (1ULL <<  2) ?  2 :	\
-		(n) & (1ULL <<  1) ?  1 :	\
-		(n) & (1ULL <<  0) ?  0 :	\
-		____ilog2_NaN()			\
-				   ) :		\
+		1 ) :				\
 	(sizeof(n) <= 4) ?			\
 	__ilog2_u32(n) :			\
 	__ilog2_u64(n)				\
#374 lore raw
In reply to Ben Hutchings
Quoted 8 lines · Ben Hutchings

This is the start of the stable review cycle for the 3.16.60 release. There are 366 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Fri Oct 19 17:00:00 UTC 2018. Anything received after that time might be too late.

Build results:

	total: 138 pass: 138 fail: 0
Qemu test results:
	total: 217 pass: 217 fail: 0

Details are available at https://kerneltests.org/builders/.

Guenter