[linux] 04/05: Update to 4.7-rc2

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Jun 10 13:47:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 906f7b1351eeee0591132abda835bffe2a6f29fe
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Thu Jun 9 01:55:39 2016 +0100

    Update to 4.7-rc2
    
    [rt] Disable until it is updated for 4.7 or later
---
 debian/changelog                                   |   6 +-
 debian/config/defines                              |   2 +-
 ...fix-leak-in-events-via-snd_timer_user_cca.patch |  28 ----
 ...fix-leak-in-events-via-snd_timer_user_tin.patch |  28 ----
 ...imer-fix-leak-in-sndrv_timer_ioctl_params.patch |  28 ----
 ...emove-redundant-log-messages-from-drivers.patch |  73 ++++-----
 .../all/kbuild-use-nostdinc-in-compile-tests.patch |  12 +-
 .../all/power-cpupower-fix-manpages-NAME.patch     |  62 --------
 ...-use-msleep_interruptible-in-polling-loop.patch |  30 ----
 ...-nl-sock-before-parsing-nested-attributes.patch |  36 -----
 ...d-remove-bpf-run-time-check-at-build-time.patch |   6 +-
 ...usb-usbfs-fix-potential-infoleak-in-devio.patch |  36 -----
 ...ulation-for-unaligned-LSDXC1-instructions.patch |  33 ----
 ...le-preemption-during-prctl-PR_SET_FP_MODE.patch |  42 -----
 ...CPUs-to-lose-FP-context-during-mode-switc.patch | 101 ------------
 .../powerpc-fix-sstep-compile-on-powerpcspe.patch  |  48 ------
 ...ore-complete-state-update-on-apicv-on-off.patch | 101 ------------
 debian/patches/debian/gitignore.patch              |   6 +-
 debian/patches/debian/kernelvariables.patch        |   6 +-
 debian/patches/debian/version.patch                |  18 +--
 .../features/all/aufs4/aufs4-standalone.patch      | 112 +++++---------
 .../all/grsecurity/grkernsec_perf_harden.patch     |  10 +-
 ...e-acpi-table-override-if-securelevel-is-s.patch |  23 ++-
 ...rkwood-add-kirkwood-ds112.dtb-to-Makefile.patch |  28 ----
 ...kwood-add-kirkwood-nsa320.dtb-to-Makefile.patch |  26 ----
 ...s-orion5x-add-device-tree-for-kurobox-pro.patch | 171 ---------------------
 ...Add-Octeon-III-CN7xxx-interface-detection.patch |  89 -----------
 ...eon-detect-and-fix-byte-swapped-initramfs.patch |  83 ----------
 .../x86-make-x32-syscall-support-conditional.patch |   6 +-
 debian/patches/series                              |  17 --
 30 files changed, 128 insertions(+), 1139 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4fd8b71..0827757 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
-linux (4.6.1-2) UNRELEASED; urgency=medium
+linux (4.7~rc2-1~exp1) UNRELEASED; urgency=medium
 
+  * New upstream release candidate
+
+  [ Ben Hutchings ]
   * bug script: Put binary package name and version in the info file so
     linux-signed can easily replace them
   * Move merge_packages function from debian/bin/gencontrol.py to
@@ -7,6 +10,7 @@ linux (4.6.1-2) UNRELEASED; urgency=medium
   * udeb: Drop packages for modules that will later be signed
   * linux-image: Add '-unsigned' suffix to packages with modules that will
     later be signed
+  * [rt] Disable until it is updated for 4.7 or later
 
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 07 Jun 2016 19:37:55 +0100
 
diff --git a/debian/config/defines b/debian/config/defines
index b914300..a872e4c 100644
--- a/debian/config/defines
+++ b/debian/config/defines
@@ -46,7 +46,7 @@ featuresets:
 signed-modules: true
 
 [featureset-rt_base]
-enabled: true
+enabled: false
 
 [description]
 part-long-up: This kernel is not suitable for SMP (multi-processor,
diff --git a/debian/patches/bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_cca.patch b/debian/patches/bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_cca.patch
deleted file mode 100644
index 7881d70..0000000
--- a/debian/patches/bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_cca.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Kangjie Lu <kangjielu at gmail.com>
-Date: Tue, 3 May 2016 16:44:20 -0400
-Subject: [1/2] ALSA: timer: Fix leak in events via snd_timer_user_ccallback
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Origin: https://git.kernel.org/linus/9a47e9cff994f37f7f0dbd9ae23740d0f64f9fe6
-
-The stack object “r1” has a total size of 32 bytes. Its field
-“event” and “val” both contain 4 bytes padding. These 8 bytes
-padding bytes are sent to user without being initialized.
-
-Signed-off-by: Kangjie Lu <kjlu at gatech.edu>
-Signed-off-by: Takashi Iwai <tiwai at suse.de>
----
- sound/core/timer.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/sound/core/timer.c
-+++ b/sound/core/timer.c
-@@ -1247,6 +1247,7 @@ static void snd_timer_user_ccallback(str
- 		tu->tstamp = *tstamp;
- 	if ((tu->filter & (1 << event)) == 0 || !tu->tread)
- 		return;
-+	memset(&r1, 0, sizeof(r1));
- 	r1.event = event;
- 	r1.tstamp = *tstamp;
- 	r1.val = resolution;
diff --git a/debian/patches/bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_tin.patch b/debian/patches/bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_tin.patch
deleted file mode 100644
index cf9da77..0000000
--- a/debian/patches/bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_tin.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Kangjie Lu <kangjielu at gmail.com>
-Date: Tue, 3 May 2016 16:44:32 -0400
-Subject: [2/2] ALSA: timer: Fix leak in events via snd_timer_user_tinterrupt
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Origin: https://git.kernel.org/linus/e4ec8cc8039a7063e24204299b462bd1383184a5
-
-The stack object “r1” has a total size of 32 bytes. Its field
-“event” and “val” both contain 4 bytes padding. These 8 bytes
-padding bytes are sent to user without being initialized.
-
-Signed-off-by: Kangjie Lu <kjlu at gatech.edu>
-Signed-off-by: Takashi Iwai <tiwai at suse.de>
----
- sound/core/timer.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/sound/core/timer.c
-+++ b/sound/core/timer.c
-@@ -1290,6 +1290,7 @@ static void snd_timer_user_tinterrupt(st
- 	}
- 	if ((tu->filter & (1 << SNDRV_TIMER_EVENT_RESOLUTION)) &&
- 	    tu->last_resolution != resolution) {
-+		memset(&r1, 0, sizeof(r1));
- 		r1.event = SNDRV_TIMER_EVENT_RESOLUTION;
- 		r1.tstamp = tstamp;
- 		r1.val = resolution;
diff --git a/debian/patches/bugfix/all/alsa-timer-fix-leak-in-sndrv_timer_ioctl_params.patch b/debian/patches/bugfix/all/alsa-timer-fix-leak-in-sndrv_timer_ioctl_params.patch
deleted file mode 100644
index c67d2f7..0000000
--- a/debian/patches/bugfix/all/alsa-timer-fix-leak-in-sndrv_timer_ioctl_params.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Kangjie Lu <kangjielu at gmail.com>
-Date: Tue, 3 May 2016 16:44:07 -0400
-Subject: ALSA: timer: Fix leak in SNDRV_TIMER_IOCTL_PARAMS
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Origin: https://git.kernel.org/linus/cec8f96e49d9be372fdb0c3836dcf31ec71e457e
-
-The stack object “tread” has a total size of 32 bytes. Its field
-“event” and “val” both contain 4 bytes padding. These 8 bytes
-padding bytes are sent to user without being initialized.
-
-Signed-off-by: Kangjie Lu <kjlu at gatech.edu>
-Signed-off-by: Takashi Iwai <tiwai at suse.de>
----
- sound/core/timer.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/sound/core/timer.c
-+++ b/sound/core/timer.c
-@@ -1755,6 +1755,7 @@ static int snd_timer_user_params(struct
- 	if (tu->timeri->flags & SNDRV_TIMER_IFLG_EARLY_EVENT) {
- 		if (tu->tread) {
- 			struct snd_timer_tread tread;
-+			memset(&tread, 0, sizeof(tread));
- 			tread.event = SNDRV_TIMER_EVENT_EARLY;
- 			tread.tstamp.tv_sec = 0;
- 			tread.tstamp.tv_nsec = 0;
diff --git a/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch b/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
index 1c7602f..47dbce3 100644
--- a/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
+++ b/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
@@ -96,7 +96,7 @@ upstream submission.
      fw_size = firmware->size / sizeof(u32);
 --- a/drivers/bluetooth/ath3k.c
 +++ b/drivers/bluetooth/ath3k.c
-@@ -416,10 +416,8 @@ static int ath3k_load_patch(struct usb_d
+@@ -420,10 +420,8 @@ static int ath3k_load_patch(struct usb_d
  		 le32_to_cpu(fw_version.rom_version));
  
  	ret = request_firmware(&firmware, filename, &udev->dev);
@@ -108,7 +108,7 @@ upstream submission.
  
  	pt_rom_version = get_unaligned_le32(firmware->data +
  					    firmware->size - 8);
-@@ -479,10 +477,8 @@ static int ath3k_load_syscfg(struct usb_
+@@ -483,10 +481,8 @@ static int ath3k_load_syscfg(struct usb_
  		le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
  
  	ret = request_firmware(&firmware, filename, &udev->dev);
@@ -168,7 +168,7 @@ upstream submission.
  
 --- a/drivers/bluetooth/btmrvl_sdio.c
 +++ b/drivers/bluetooth/btmrvl_sdio.c
-@@ -390,8 +390,6 @@ static int btmrvl_sdio_download_helper(s
+@@ -452,8 +452,6 @@ static int btmrvl_sdio_download_helper(s
  	ret = request_firmware(&fw_helper, card->helper,
  						&card->func->dev);
  	if ((ret < 0) || !fw_helper) {
@@ -177,7 +177,7 @@ upstream submission.
  		ret = -ENOENT;
  		goto done;
  	}
-@@ -490,8 +488,6 @@ static int btmrvl_sdio_download_fw_w_hel
+@@ -552,8 +550,6 @@ static int btmrvl_sdio_download_fw_w_hel
  	ret = request_firmware(&fw_firmware, card->firmware,
  							&card->func->dev);
  	if ((ret < 0) || !fw_firmware) {
@@ -233,7 +233,7 @@ upstream submission.
  	where = 0;
 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
 +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
-@@ -1755,10 +1755,8 @@ gf100_gr_ctor_fw(struct gf100_gr *gr, co
+@@ -1740,10 +1740,8 @@ gf100_gr_ctor_fw(struct gf100_gr *gr, co
  	int ret;
  
  	ret = nvkm_firmware_get(device, fwname, &fw);
@@ -275,7 +275,7 @@ upstream submission.
  		release_firmware(rdev->me_fw);
 --- a/drivers/gpu/drm/radeon/r100.c
 +++ b/drivers/gpu/drm/radeon/r100.c
-@@ -1039,10 +1039,7 @@ static int r100_cp_init_microcode(struct
+@@ -1041,10 +1041,7 @@ static int r100_cp_init_microcode(struct
  	}
  
  	err = request_firmware(&rdev->me_fw, fw_name, rdev->dev);
@@ -289,7 +289,7 @@ upstream submission.
  		       rdev->me_fw->size, fw_name);
 --- a/drivers/gpu/drm/radeon/r600.c
 +++ b/drivers/gpu/drm/radeon/r600.c
-@@ -2592,10 +2592,6 @@ int r600_init_microcode(struct radeon_de
+@@ -2599,10 +2599,6 @@ int r600_init_microcode(struct radeon_de
  
  out:
  	if (err) {
@@ -898,22 +898,18 @@ upstream submission.
  	}
 --- a/drivers/media/usb/cx231xx/cx231xx-417.c
 +++ b/drivers/media/usb/cx231xx/cx231xx-417.c
-@@ -995,14 +995,8 @@ static int cx231xx_load_firmware(struct
- 	retval = request_firmware(&firmware, CX231xx_FIRM_IMAGE_NAME,
+@@ -999,11 +999,6 @@ static int cx231xx_load_firmware(struct
  				  dev->dev);
  
--	if (retval != 0) {
+ 	if (retval != 0) {
 -		dev_err(dev->dev,
 -			"ERROR: Hotplug firmware request failed (%s).\n",
 -			CX231xx_FIRM_IMAGE_NAME);
 -		dev_err(dev->dev,
 -			"Please fix your hotplug setup, the board will not work without firmware loaded!\n");
-+	if (retval != 0)
- 		return -1;
--	}
- 
- 	if (firmware->size != CX231xx_FIRM_IMAGE_SIZE) {
- 		dev_err(dev->dev,
+ 		vfree(p_current_fw);
+ 		vfree(p_buffer);
+ 		return retval;
 --- a/drivers/media/pci/cx23885/cx23885-417.c
 +++ b/drivers/media/pci/cx23885/cx23885-417.c
 @@ -931,14 +931,8 @@ static int cx23885_load_firmware(struct
@@ -1079,7 +1075,7 @@ upstream submission.
  			__func__, fw->size);
 --- a/drivers/misc/ti-st/st_kim.c
 +++ b/drivers/misc/ti-st/st_kim.c
-@@ -303,11 +303,8 @@ static long download_firmware(struct kim
+@@ -302,11 +302,8 @@ static long download_firmware(struct kim
  	    request_firmware(&kim_gdata->fw_entry, bts_scr_name,
  			     &kim_gdata->kim_pdev->dev);
  	if (unlikely((err != 0) || (kim_gdata->fw_entry->data == NULL) ||
@@ -1189,7 +1185,7 @@ upstream submission.
  	if (bp->mips_firmware->size < sizeof(*mips_fw) ||
 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
 +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
-@@ -13467,11 +13467,8 @@ static int bnx2x_init_firmware(struct bn
+@@ -13466,11 +13466,8 @@ static int bnx2x_init_firmware(struct bn
  	BNX2X_DEV_INFO("Loading %s\n", fw_file_name);
  
  	rc = request_firmware(&bp->firmware, fw_file_name, &bp->pdev->dev);
@@ -1233,7 +1229,7 @@ upstream submission.
  	*bfi_image_size = fw->size/sizeof(u32);
 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
 +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
-@@ -1036,12 +1036,8 @@ int t3_get_edc_fw(struct cphy *phy, int
+@@ -1037,12 +1037,8 @@ int t3_get_edc_fw(struct cphy *phy, int
  	fw_name = get_edc_fw_name(edc_idx);
  	if (fw_name)
  		ret = request_firmware(&fw, fw_name, &adapter->pdev->dev);
@@ -1247,7 +1243,7 @@ upstream submission.
  
  	/* check size, take checksum in account */
  	if (fw->size > size + 4) {
-@@ -1078,11 +1074,8 @@ static int upgrade_fw(struct adapter *ad
+@@ -1079,11 +1075,8 @@ static int upgrade_fw(struct adapter *ad
  	struct device *dev = &adap->pdev->dev;
  
  	ret = request_firmware(&fw, FW_FNAME, dev);
@@ -1260,7 +1256,7 @@ upstream submission.
  	ret = t3_load_fw(adap, fw->data, fw->size);
  	release_firmware(fw);
  
-@@ -1127,11 +1120,8 @@ static int update_tpsram(struct adapter
+@@ -1128,11 +1121,8 @@ static int update_tpsram(struct adapter
  	snprintf(buf, sizeof(buf), TPSRAM_NAME, rev);
  
  	ret = request_firmware(&tpsram, buf, dev);
@@ -1537,21 +1533,18 @@ upstream submission.
  			else
 --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
 +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
-@@ -1219,13 +1219,8 @@ static void iwl_req_fw_callback(const st
- 	if (!pieces)
- 		return;
+@@ -224,10 +224,8 @@ static int iwl_request_firmware(struct i
+ 		sprintf(tag, "%d", drv->fw_index);
+ 	}
  
--	if (!ucode_raw) {
--		if (drv->fw_index <= api_ok)
--			IWL_ERR(drv,
--				"request for firmware file '%s' failed.\n",
--				drv->firmware_name);
-+	if (!ucode_raw)
- 		goto try_again;
+-	if (drv->fw_index < drv->cfg->ucode_api_min) {
+-		IWL_ERR(drv, "no suitable firmware found!\n");
++	if (drv->fw_index < drv->cfg->ucode_api_min)
+ 		return -ENOENT;
 -	}
  
- 	IWL_DEBUG_INFO(drv, "Loaded firmware file '%s' (%zd bytes).\n",
- 		       drv->firmware_name, ucode_raw->size);
+ 	snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode",
+ 		 name_pre, tag);
 --- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c
 +++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
 @@ -824,8 +824,6 @@ static int if_usb_prog_firmware(struct i
@@ -2082,7 +2075,7 @@ upstream submission.
  				RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
 --- a/drivers/staging/rtl8712/hal_init.c
 +++ b/drivers/staging/rtl8712/hal_init.c
-@@ -71,8 +71,6 @@ int rtl871x_load_fw(struct _adapter *pad
+@@ -67,8 +67,6 @@ int rtl871x_load_fw(struct _adapter *pad
  	dev_info(dev, "r8712u: Loading firmware from \"%s\"\n", firmware_file);
  	rc = request_firmware_nowait(THIS_MODULE, 1, firmware_file, dev,
  				     GFP_KERNEL, padapter, rtl871x_load_fw_cb);
@@ -2137,7 +2130,7 @@ upstream submission.
  	if (!buffer)
 --- a/drivers/tty/cyclades.c
 +++ b/drivers/tty/cyclades.c
-@@ -3507,10 +3507,8 @@ static int cyz_load_fw(struct pci_dev *p
+@@ -3499,10 +3499,8 @@ static int cyz_load_fw(struct pci_dev *p
  	int retval;
  
  	retval = request_firmware(&fw, "cyzfirm.bin", &pdev->dev);
@@ -2374,10 +2367,10 @@ upstream submission.
  
 --- a/drivers/usb/serial/ti_usb_3410_5052.c
 +++ b/drivers/usb/serial/ti_usb_3410_5052.c
-@@ -1487,10 +1487,8 @@ static int ti_download_firmware(struct t
- 		}
- 		status = request_firmware(&fw_p, buf, &dev->dev);
+@@ -1536,10 +1536,8 @@ static int ti_download_firmware(struct t
  	}
+ 
+ check_firmware:
 -	if (status) {
 -		dev_err(&dev->dev, "%s - firmware not found\n", __func__);
 +	if (status)
@@ -2477,7 +2470,7 @@ upstream submission.
  		snd_printk(KERN_INFO "sscape: MIDI firmware loaded %zu KBs\n",
 --- a/sound/isa/wavefront/wavefront_synth.c
 +++ b/sound/isa/wavefront/wavefront_synth.c
-@@ -1947,10 +1947,8 @@ wavefront_download_firmware (snd_wavefro
+@@ -1956,10 +1956,8 @@ wavefront_download_firmware (snd_wavefro
  	const struct firmware *firmware;
  
  	err = request_firmware(&firmware, path, dev->card->dev);
@@ -2533,7 +2526,7 @@ upstream submission.
  			   filename, emu->firmware->size);
 --- a/sound/pci/hda/hda_intel.c
 +++ b/sound/pci/hda/hda_intel.c
-@@ -1829,10 +1829,8 @@ static void azx_firmware_cb(const struct
+@@ -1781,10 +1781,8 @@ static void azx_firmware_cb(const struct
  	struct azx *chip = card->private_data;
  	struct pci_dev *pci = chip->pci;
  
diff --git a/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch b/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
index cc12dd6..608d883 100644
--- a/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
+++ b/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
@@ -15,7 +15,7 @@ the kernel.
 
 --- a/scripts/Kbuild.include
 +++ b/scripts/Kbuild.include
-@@ -111,12 +111,12 @@ as-instr = $(call try-run,\
+@@ -112,12 +112,12 @@ as-instr = $(call try-run,\
  # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
  
  cc-option = $(call try-run,\
@@ -30,7 +30,7 @@ the kernel.
  
  # cc-option-align
  # Prefix align with either -falign or -malign
-@@ -126,18 +126,19 @@ cc-option-align = $(subst -functions=0,,
+@@ -127,18 +127,19 @@ cc-option-align = $(subst -functions=0,,
  # cc-disable-warning
  # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
  cc-disable-warning = $(call try-run,\
@@ -53,7 +53,7 @@ the kernel.
  
  # cc-ifversion
  # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
-@@ -151,7 +152,7 @@ cc-ldoption = $(call try-run,\
+@@ -152,7 +153,7 @@ cc-ldoption = $(call try-run,\
  # ld-option
  # Usage: LDFLAGS += $(call ld-option, -X)
  ld-option = $(call try-run,\
@@ -64,8 +64,8 @@ the kernel.
  # Usage: KBUILD_ARFLAGS := $(call ar-option,D)
 --- a/Makefile
 +++ b/Makefile
-@@ -614,6 +614,8 @@ else
- KBUILD_CFLAGS	+= -O2
+@@ -630,6 +630,8 @@ KBUILD_CFLAGS   += -O2
+ endif
  endif
  
 +NOSTDINC_FLAGS += -nostdinc
@@ -73,7 +73,7 @@ the kernel.
  # Tell gcc to never replace conditional load with a non-conditional one
  KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
  
-@@ -744,7 +746,7 @@ KBUILD_CFLAGS += $(call cc-option, -fno-
+@@ -769,7 +771,7 @@ KBUILD_CFLAGS += $(call cc-option, -fno-
  endif
  
  # arch Makefile may override CC so keep this after arch Makefile is included
diff --git a/debian/patches/bugfix/all/power-cpupower-fix-manpages-NAME.patch b/debian/patches/bugfix/all/power-cpupower-fix-manpages-NAME.patch
deleted file mode 100644
index ee9534a..0000000
--- a/debian/patches/bugfix/all/power-cpupower-fix-manpages-NAME.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: Mattia Dongili <malattia at linux.it>
-Date: Fri, 19 Feb 2016 07:46:32 -0800
-Subject: Fix cpupower manpages "NAME" section
-Forwarded: http://article.gmane.org/gmane.linux.power-management.general/73191
-
-The token before "-" should be the program name, no spaces allowed.
-See man(7) and lexgrog(1).
-
-Signed-off-by: Mattia Dongili <malattia at linux.it>
----
-diff --git a/tools/power/cpupower/man/cpupower-frequency-info.1 b/tools/power/cpupower/man/cpupower-frequency-info.1
-index 9c85a38..6aa8d23 100644
---- a/tools/power/cpupower/man/cpupower-frequency-info.1
-+++ b/tools/power/cpupower/man/cpupower-frequency-info.1
-@@ -1,7 +1,7 @@
- .TH "CPUPOWER\-FREQUENCY\-INFO" "1" "0.1" "" "cpupower Manual"
- .SH "NAME"
- .LP 
--cpupower frequency\-info \- Utility to retrieve cpufreq kernel information
-+cpupower\-frequency\-info \- Utility to retrieve cpufreq kernel information
- .SH "SYNTAX"
- .LP 
- cpupower [ \-c cpulist ] frequency\-info [\fIoptions\fP]
-diff --git a/tools/power/cpupower/man/cpupower-frequency-set.1 b/tools/power/cpupower/man/cpupower-frequency-set.1
-index 3eacc8d..b505702 100644
---- a/tools/power/cpupower/man/cpupower-frequency-set.1
-+++ b/tools/power/cpupower/man/cpupower-frequency-set.1
-@@ -1,7 +1,7 @@
- .TH "CPUPOWER\-FREQUENCY\-SET" "1" "0.1" "" "cpupower Manual"
- .SH "NAME"
- .LP 
--cpupower frequency\-set \- A small tool which allows to modify cpufreq settings.
-+cpupower\-frequency\-set \- A small tool which allows to modify cpufreq settings.
- .SH "SYNTAX"
- .LP 
- cpupower [ \-c cpu ] frequency\-set [\fIoptions\fP]
-diff --git a/tools/power/cpupower/man/cpupower-idle-info.1 b/tools/power/cpupower/man/cpupower-idle-info.1
-index 7b3646a..80a1311 100644
---- a/tools/power/cpupower/man/cpupower-idle-info.1
-+++ b/tools/power/cpupower/man/cpupower-idle-info.1
-@@ -1,7 +1,7 @@
- .TH "CPUPOWER-IDLE-INFO" "1" "0.1" "" "cpupower Manual"
- .SH "NAME"
- .LP
--cpupower idle\-info \- Utility to retrieve cpu idle kernel information
-+cpupower\-idle\-info \- Utility to retrieve cpu idle kernel information
- .SH "SYNTAX"
- .LP
- cpupower [ \-c cpulist ] idle\-info [\fIoptions\fP]
-diff --git a/tools/power/cpupower/man/cpupower-idle-set.1 b/tools/power/cpupower/man/cpupower-idle-set.1
-index 580c4e3..21916cf 100644
---- a/tools/power/cpupower/man/cpupower-idle-set.1
-+++ b/tools/power/cpupower/man/cpupower-idle-set.1
-@@ -1,7 +1,7 @@
- .TH "CPUPOWER-IDLE-SET" "1" "0.1" "" "cpupower Manual"
- .SH "NAME"
- .LP
--cpupower idle\-set \- Utility to set cpu idle state specific kernel options
-+cpupower\-idle\-set \- Utility to set cpu idle state specific kernel options
- .SH "SYNTAX"
- .LP
- cpupower [ \-c cpulist ] idle\-info [\fIoptions\fP]
diff --git a/debian/patches/bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch b/debian/patches/bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch
deleted file mode 100644
index 64a86aa..0000000
--- a/debian/patches/bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Ben Hutchings <ben at decadent.org.uk>
-Date: Mon, 28 Sep 2015 01:34:21 +0100
-Subject: rtsx_usb_ms: Use msleep_interruptible() in polling loop
-Bug-Debian: https://bugs.debian.org/765717
-Forwarded: http://mid.gmane.org/1443400461.2517.22.camel@decadent.org.uk
-
-rtsx_usb_ms creates a task that mostly sleeps, but tasks in
-uninterruptible sleep still contribute to the load average (for
-bug-compatibility with Unix).  A load average of ~1 on a system that
-should be idle is somewhat alarming.
-
-Change the sleep to be interruptible, but still ignore signals.
-
-A better fix might be to replace this loop with a delayed work item.
-
-References: https://bugs.debian.org/765717
-Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
----
---- a/drivers/memstick/host/rtsx_usb_ms.c
-+++ b/drivers/memstick/host/rtsx_usb_ms.c
-@@ -706,7 +706,8 @@ poll_again:
- 		if (host->eject)
- 			break;
- 
--		msleep(1000);
-+		if (msleep_interruptible(1000))
-+			flush_signals(current);
- 	}
- 
- 	complete(&host->detect_ms_exit);
diff --git a/debian/patches/bugfix/all/tipc-check-nl-sock-before-parsing-nested-attributes.patch b/debian/patches/bugfix/all/tipc-check-nl-sock-before-parsing-nested-attributes.patch
deleted file mode 100644
index 934147d..0000000
--- a/debian/patches/bugfix/all/tipc-check-nl-sock-before-parsing-nested-attributes.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Richard Alpe <richard.alpe at ericsson.com>
-Date: Mon, 16 May 2016 11:14:54 +0200
-Subject: tipc: check nl sock before parsing nested attributes
-Origin: https://git.kernel.org/linus/45e093ae2830cd1264677d47ff9a95a71f5d9f9c
-
-Make sure the socket for which the user is listing publication exists
-before parsing the socket netlink attributes.
-
-Prior to this patch a call without any socket caused a NULL pointer
-dereference in tipc_nl_publ_dump().
-
-Tested-and-reported-by: Baozeng Ding <sploving1 at gmail.com>
-Signed-off-by: Richard Alpe <richard.alpe at ericsson.com>
-Acked-by: Jon Maloy <jon.maloy at ericsson.cm>
-Signed-off-by: David S. Miller <davem at davemloft.net>
----
- net/tipc/socket.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/net/tipc/socket.c b/net/tipc/socket.c
-index 1262889..3b7a799 100644
---- a/net/tipc/socket.c
-+++ b/net/tipc/socket.c
-@@ -2853,6 +2853,9 @@ int tipc_nl_publ_dump(struct sk_buff *skb, struct netlink_callback *cb)
- 		if (err)
- 			return err;
- 
-+		if (!attrs[TIPC_NLA_SOCK])
-+			return -EINVAL;
-+
- 		err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX,
- 				       attrs[TIPC_NLA_SOCK],
- 				       tipc_nl_sock_policy);
--- 
-2.8.1
-
diff --git a/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch b/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
index c09e9e1..9d07fbc 100644
--- a/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
+++ b/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
@@ -21,14 +21,14 @@ Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
  #  error __NR_bpf not defined. libbpf does not support your arch.
  # endif
  #endif
-@@ -28,9 +29,5 @@ int main(void)
+@@ -27,9 +28,5 @@ int main(void)
+ 	attr.log_level = 0;
  	attr.kern_version = 0;
  
- 	attr = attr;
 -	/*
 -	 * Test existence of __NR_bpf and BPF_PROG_LOAD.
 -	 * This call should fail if we run the testcase.
 -	 */
--	return syscall(__NR_bpf, BPF_PROG_LOAD, attr, sizeof(attr));
+-	return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
 +	return 0;
  }
diff --git a/debian/patches/bugfix/all/usb-usbfs-fix-potential-infoleak-in-devio.patch b/debian/patches/bugfix/all/usb-usbfs-fix-potential-infoleak-in-devio.patch
deleted file mode 100644
index dee56c6..0000000
--- a/debian/patches/bugfix/all/usb-usbfs-fix-potential-infoleak-in-devio.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Kangjie Lu <kangjielu at gmail.com>
-Date: Tue, 3 May 2016 16:32:16 -0400
-Subject: USB: usbfs: fix potential infoleak in devio
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Origin: https://git.kernel.org/linus/681fef8380eb818c0b845fca5d2ab1dcbab114ee
-
-The stack object “ci” has a total size of 8 bytes. Its last 3 bytes
-are padding bytes which are not initialized and leaked to userland
-via “copy_to_user”.
-
-Signed-off-by: Kangjie Lu <kjlu at gatech.edu>
-Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
----
- drivers/usb/core/devio.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
---- a/drivers/usb/core/devio.c
-+++ b/drivers/usb/core/devio.c
-@@ -1186,10 +1186,11 @@ static int proc_getdriver(struct usb_dev
- 
- static int proc_connectinfo(struct usb_dev_state *ps, void __user *arg)
- {
--	struct usbdevfs_connectinfo ci = {
--		.devnum = ps->dev->devnum,
--		.slow = ps->dev->speed == USB_SPEED_LOW
--	};
-+	struct usbdevfs_connectinfo ci;
-+
-+	memset(&ci, 0, sizeof(ci));
-+	ci.devnum = ps->dev->devnum;
-+	ci.slow = ps->dev->speed == USB_SPEED_LOW;
- 
- 	if (copy_to_user(arg, &ci, sizeof(ci)))
- 		return -EFAULT;
diff --git a/debian/patches/bugfix/mips/MIPS-Allow-emulation-for-unaligned-LSDXC1-instructions.patch b/debian/patches/bugfix/mips/MIPS-Allow-emulation-for-unaligned-LSDXC1-instructions.patch
deleted file mode 100644
index fe17c02..0000000
--- a/debian/patches/bugfix/mips/MIPS-Allow-emulation-for-unaligned-LSDXC1-instructions.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Paul Burton <paul.burton at imgtec.com>
-Date: Thu, 21 Apr 2016 12:25:38 +0100
-Subject: MIPS: Allow emulation for unaligned [LS]DXC1 instructions
-Origin: https://git.kernel.org/linus/e70ac023f9515c70cf2b291a294f0f250df29847
-
-If an address error exception occurs for a LDXC1 or SDXC1 instruction,
-within the cop1x opcode space, allow it to be passed through to the FPU
-emulator rather than resulting in a SIGILL. This causes LDXC1 & SDXC1 to
-be handled in a manner consistent with the more common LDC1 & SDC1
-instructions.
-
-Signed-off-by: Paul Burton <paul.burton at imgtec.com>
-Cc: Aurelien Jarno <aurelien at aurel32.net>
----
- arch/mips/kernel/unaligned.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
-index 5c62065..28b3af7 100644
---- a/arch/mips/kernel/unaligned.c
-+++ b/arch/mips/kernel/unaligned.c
-@@ -1191,6 +1191,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 	case ldc1_op:
- 	case swc1_op:
- 	case sdc1_op:
-+	case cop1x_op:
- 		die_if_kernel("Unaligned FP access in kernel code", regs);
- 		BUG_ON(!used_math());
- 
--- 
-2.8.0
-
-
diff --git a/debian/patches/bugfix/mips/MIPS-Disable-preemption-during-prctl-PR_SET_FP_MODE.patch b/debian/patches/bugfix/mips/MIPS-Disable-preemption-during-prctl-PR_SET_FP_MODE.patch
deleted file mode 100644
index ec9086f..0000000
--- a/debian/patches/bugfix/mips/MIPS-Disable-preemption-during-prctl-PR_SET_FP_MODE.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Paul Burton <paul.burton at imgtec.com>
-Date: Thu, 21 Apr 2016 12:43:57 +0100
-Subject: [1/2] MIPS: Disable preemption during prctl(PR_SET_FP_MODE, ...)
-Origin: https://git.kernel.org/linus/bd239f1e1429e7781096bf3884bdb1b2b1bb4f28
-
-Whilst a PR_SET_FP_MODE prctl is performed there are decisions made
-based upon whether the task is executing on the current CPU. This may
-change if we're preempted, so disable preemption to avoid such changes
-for the lifetime of the mode switch.
-
-Signed-off-by: Paul Burton <paul.burton at imgtec.com>
-Fixes: 9791554b45a2 ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS")
-Cc: stable <stable at vger.kernel.org> # v4.0+
----
- arch/mips/kernel/process.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index 92880ce..ce55ea0 100644
---- a/arch/mips/kernel/process.c
-+++ b/arch/mips/kernel/process.c
-@@ -601,6 +601,9 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
- 	if (!(value & PR_FP_MODE_FR) && cpu_has_fpu && cpu_has_mips_r6)
- 		return -EOPNOTSUPP;
- 
-+	/* Proceed with the mode switch */
-+	preempt_disable();
-+
- 	/* Save FP & vector context, then disable FPU & MSA */
- 	if (task->signal == current->signal)
- 		lose_fpu(1);
-@@ -659,6 +662,7 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
- 
- 	/* Allow threads to use FP again */
- 	atomic_set(&task->mm->context.fp_mode_switching, 0);
-+	preempt_enable();
- 
- 	return 0;
- }
--- 
-2.8.1
-
diff --git a/debian/patches/bugfix/mips/MIPS-Force-CPUs-to-lose-FP-context-during-mode-switc.patch b/debian/patches/bugfix/mips/MIPS-Force-CPUs-to-lose-FP-context-during-mode-switc.patch
deleted file mode 100644
index 301e2e0..0000000
--- a/debian/patches/bugfix/mips/MIPS-Force-CPUs-to-lose-FP-context-during-mode-switc.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From: Paul Burton <paul.burton at imgtec.com>
-Date: Thu, 21 Apr 2016 12:43:58 +0100
-Subject: [2/2] MIPS: Force CPUs to lose FP context during mode switches
-Origin: https://git.kernel.org/linus/6b8322576e9d325b65c54fbef64e4e8690ad70ce
-
-Commit 9791554b45a2 ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options
-for MIPS") added support for the PR_SET_FP_MODE prctl, which allows a
-userland program to modify its FP mode at runtime. This is most notably
-required if dynamic linking leads to the FP mode requirement changing at
-runtime from that indicated in the initial executable's ELF header. In
-order to avoid overhead in the general FP context restore code, it aimed
-to have threads in the process become unable to enable the FPU during a
-mode switch & have the thread calling the prctl syscall wait for all
-other threads in the process to be context switched at least once. Once
-that happens we can know that no thread in the process whose mode will
-be switched has live FP context, and it's safe to perform the mode
-switch. However in the (rare) case of modeswitches occurring in
-multithreaded programs this can lead to indeterminate delays for the
-thread invoking the prctl syscall, and the code monitoring for those
-context switches was woefully inadequate for all but the simplest cases.
-
-Fix this by broadcasting an IPI if other CPUs may have live FP context
-for an affected thread, with a handler causing those CPUs to relinquish
-their FPU ownership. Threads will then be allowed to continue running
-but will stall on the wait_on_atomic_t in enable_restore_fp_context if
-they attempt to use FP again whilst the mode switch is still in
-progress. The end result is less fragile poking at scheduler context
-switch counts & a more expedient completion of the mode switch.
-
-Signed-off-by: Paul Burton <paul.burton at imgtec.com>
-Fixes: 9791554b45a2 ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for MIPS")
-Cc: stable <stable at vger.kernel.org> # v4.0+
----
- arch/mips/kernel/process.c | 40 +++++++++++++++++-----------------------
- 1 file changed, 17 insertions(+), 23 deletions(-)
-
-diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
-index ce55ea0..e1b36a4 100644
---- a/arch/mips/kernel/process.c
-+++ b/arch/mips/kernel/process.c
-@@ -580,11 +580,19 @@ int mips_get_process_fp_mode(struct task_struct *task)
- 	return value;
- }
- 
-+static void prepare_for_fp_mode_switch(void *info)
-+{
-+	struct mm_struct *mm = info;
-+
-+	if (current->mm == mm)
-+		lose_fpu(1);
-+}
-+
- int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
- {
- 	const unsigned int known_bits = PR_FP_MODE_FR | PR_FP_MODE_FRE;
--	unsigned long switch_count;
- 	struct task_struct *t;
-+	int max_users;
- 
- 	/* Check the value is valid */
- 	if (value & ~known_bits)
-@@ -613,31 +621,17 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
- 	smp_mb__after_atomic();
- 
- 	/*
--	 * If there are multiple online CPUs then wait until all threads whose
--	 * FP mode is about to change have been context switched. This approach
--	 * allows us to only worry about whether an FP mode switch is in
--	 * progress when FP is first used in a tasks time slice. Pretty much all
--	 * of the mode switch overhead can thus be confined to cases where mode
--	 * switches are actually occurring. That is, to here. However for the
--	 * thread performing the mode switch it may take a while...
-+	 * If there are multiple online CPUs then force any which are running
-+	 * threads in this process to lose their FPU context, which they can't
-+	 * regain until fp_mode_switching is cleared later.
- 	 */
- 	if (num_online_cpus() > 1) {
--		spin_lock_irq(&task->sighand->siglock);
--
--		for_each_thread(task, t) {
--			if (t == current)
--				continue;
--
--			switch_count = t->nvcsw + t->nivcsw;
--
--			do {
--				spin_unlock_irq(&task->sighand->siglock);
--				cond_resched();
--				spin_lock_irq(&task->sighand->siglock);
--			} while ((t->nvcsw + t->nivcsw) == switch_count);
--		}
-+		/* No need to send an IPI for the local CPU */
-+		max_users = (task->mm == current->mm) ? 1 : 0;
- 
--		spin_unlock_irq(&task->sighand->siglock);
-+		if (atomic_read(&current->mm->mm_users) > max_users)
-+			smp_call_function(prepare_for_fp_mode_switch,
-+					  (void *)current->mm, 1);
- 	}
- 
- 	/*
diff --git a/debian/patches/bugfix/powerpc/powerpc-fix-sstep-compile-on-powerpcspe.patch b/debian/patches/bugfix/powerpc/powerpc-fix-sstep-compile-on-powerpcspe.patch
deleted file mode 100644
index 460db40..0000000
--- a/debian/patches/bugfix/powerpc/powerpc-fix-sstep-compile-on-powerpcspe.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: "Lennart Sorensen" <lsorense at csclub.uwaterloo.ca>
-Subject: powerpc: Fix sstep compile on powerpcspe
-Date: Thu, 5 May 2016 16:44:44 -0400
-Forwarded: http://news.gmane.org/gmane.linux.ports.ppc.embedded/95502
-Bug-Debian: https://bugs.debian.org/823526
-
-Commit be96f63375a14ee8e690856ac77e579c75bd0bae introduced ldarx and stdcx
-into the instructions in sstep.c, which are not accepted by the assembler
-on powerpcspe, but does seem to be accepted by the normal powerpc assembler
-even in 32 bit mode.
-
-Wrap these two instructions in a __powerpc64__ check like it is everywhere
-else in the file.
-
-Fixes: be96f63375a1 ("powerpc: Split out instruction analysis part of emulate_step()")
-Signed-off-by: Len Sorensen <lsorense at csclub.uwaterloo.ca>
----
- arch/powerpc/lib/sstep.c |    4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
-index dc885b3..6d34310 100644
---- a/arch/powerpc/lib/sstep.c
-+++ b/arch/powerpc/lib/sstep.c
-@@ -1818,9 +1818,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
- 		case 4:
- 			__get_user_asmx(val, op.ea, err, "lwarx");
- 			break;
-+#ifdef __powerpc64__
- 		case 8:
- 			__get_user_asmx(val, op.ea, err, "ldarx");
- 			break;
-+#endif
- 		default:
- 			return 0;
- 		}
-@@ -1841,9 +1843,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
- 		case 4:
- 			__put_user_asmx(op.val, op.ea, err, "stwcx.", cr);
- 			break;
-+#ifdef __powerpc64__
- 		case 8:
- 			__put_user_asmx(op.val, op.ea, err, "stdcx.", cr);
- 			break;
-+#endif
- 		default:
- 			return 0;
- 		}
diff --git a/debian/patches/bugfix/x86/kvm-vmx-more-complete-state-update-on-apicv-on-off.patch b/debian/patches/bugfix/x86/kvm-vmx-more-complete-state-update-on-apicv-on-off.patch
deleted file mode 100644
index ca5e6ad..0000000
--- a/debian/patches/bugfix/x86/kvm-vmx-more-complete-state-update-on-apicv-on-off.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From: Roman Kagan <rkagan at virtuozzo.com>
-Subject: kvm:vmx: more complete state update on APICv on/off
-Date: Wed, 18 May 2016 17:48:20 +0300
-Origin: http://article.gmane.org/gmane.comp.emulators.kvm.devel/152191
-
-The function to update APICv on/off state (in particular, to deactivate
-it when enabling Hyper-V SynIC), used to be incomplete: it didn't adjust
-APICv-related fields among secondary processor-based VM-execution
-controls.
-
-As a result, Windows 2012 guests would get stuck when SynIC-based
-auto-EOI interrupt intersected with e.g. an IPI in the guest.
-
-In addition, the MSR intercept bitmap wasn't updated to correspond to
-whether "virtualize x2APIC mode" was enabled.  This path used not to be
-triggered, since Windows didn't use x2APIC but rather their own
-synthetic APIC access MSRs; however it represented a security risk
-because the guest running in a SynIC-enabled VM could switch to x2APIC
-and thus obtain direct access to host APIC MSRs (thanks to Yang Zhang
-<yang.zhang.wz at gmail.com> for spotting this).
-
-The patch fixes those omissions.
-
-Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
-Cc: Steve Rutherford <srutherford at google.com>
-Cc: Yang Zhang <yang.zhang.wz at gmail.com>
----
- arch/x86/kvm/vmx.c | 48 ++++++++++++++++++++++++++++++------------------
- 1 file changed, 30 insertions(+), 18 deletions(-)
-
---- a/arch/x86/kvm/vmx.c
-+++ b/arch/x86/kvm/vmx.c
-@@ -2397,7 +2397,9 @@ static void vmx_set_msr_bitmap(struct kv
- 
- 	if (is_guest_mode(vcpu))
- 		msr_bitmap = vmx_msr_bitmap_nested;
--	else if (vcpu->arch.apic_base & X2APIC_ENABLE) {
-+	else if (cpu_has_secondary_exec_ctrls() &&
-+		 (vmcs_read32(SECONDARY_VM_EXEC_CONTROL) &
-+		  SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)) {
- 		if (is_long_mode(vcpu))
- 			msr_bitmap = vmx_msr_bitmap_longmode_x2apic;
- 		else
-@@ -4758,6 +4760,19 @@ static void vmx_refresh_apicv_exec_ctrl(
- 	struct vcpu_vmx *vmx = to_vmx(vcpu);
- 
- 	vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_ctrl(vmx));
-+	if (cpu_has_secondary_exec_ctrls()) {
-+		if (kvm_vcpu_apicv_active(vcpu))
-+			vmcs_set_bits(SECONDARY_VM_EXEC_CONTROL,
-+				      SECONDARY_EXEC_APIC_REGISTER_VIRT |
-+				      SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY);
-+		else
-+			vmcs_clear_bits(SECONDARY_VM_EXEC_CONTROL,
-+					SECONDARY_EXEC_APIC_REGISTER_VIRT |
-+					SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY);
-+	}
-+
-+	if (cpu_has_vmx_msr_bitmap())
-+		vmx_set_msr_bitmap(vcpu);
- }
- 
- static u32 vmx_exec_control(struct vcpu_vmx *vmx)
-@@ -6313,23 +6328,20 @@ static __init int hardware_setup(void)
- 
- 	set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */
- 
--	if (enable_apicv) {
--		for (msr = 0x800; msr <= 0x8ff; msr++)
--			vmx_disable_intercept_msr_read_x2apic(msr);
--
--		/* According SDM, in x2apic mode, the whole id reg is used.
--		 * But in KVM, it only use the highest eight bits. Need to
--		 * intercept it */
--		vmx_enable_intercept_msr_read_x2apic(0x802);
--		/* TMCCT */
--		vmx_enable_intercept_msr_read_x2apic(0x839);
--		/* TPR */
--		vmx_disable_intercept_msr_write_x2apic(0x808);
--		/* EOI */
--		vmx_disable_intercept_msr_write_x2apic(0x80b);
--		/* SELF-IPI */
--		vmx_disable_intercept_msr_write_x2apic(0x83f);
--	}
-+	for (msr = 0x800; msr <= 0x8ff; msr++)
-+		vmx_disable_intercept_msr_read_x2apic(msr);
-+
-+	/* According SDM, in x2apic mode, the whole id reg is used.  But in
-+	 * KVM, it only use the highest eight bits. Need to intercept it */
-+	vmx_enable_intercept_msr_read_x2apic(0x802);
-+	/* TMCCT */
-+	vmx_enable_intercept_msr_read_x2apic(0x839);
-+	/* TPR */
-+	vmx_disable_intercept_msr_write_x2apic(0x808);
-+	/* EOI */
-+	vmx_disable_intercept_msr_write_x2apic(0x80b);
-+	/* SELF-IPI */
-+	vmx_disable_intercept_msr_write_x2apic(0x83f);
- 
- 	if (enable_ept) {
- 		kvm_mmu_set_mask_ptes(0ull,
diff --git a/debian/patches/debian/gitignore.patch b/debian/patches/debian/gitignore.patch
index eb71348..e67d5c3 100644
--- a/debian/patches/debian/gitignore.patch
+++ b/debian/patches/debian/gitignore.patch
@@ -7,7 +7,7 @@ Forwarded: not-needed
 
 --- a/.gitignore
 +++ b/.gitignore
-@@ -50,22 +50,11 @@ Module.symvers
+@@ -52,22 +52,11 @@ Module.symvers
  /Module.markers
  
  #
@@ -21,7 +21,7 @@ Forwarded: not-needed
  /tar-install/
  
  #
--# git files that we don't want to ignore even it they are dot-files
+-# git files that we don't want to ignore even if they are dot-files
 -#
 -!.gitignore
 -!.mailmap
@@ -30,7 +30,7 @@ Forwarded: not-needed
  # Generated include files
  #
  include/config
-@@ -106,3 +95,10 @@ all.config
+@@ -112,3 +101,10 @@ all.config
  
  # Kdevelop4
  *.kdev4
diff --git a/debian/patches/debian/kernelvariables.patch b/debian/patches/debian/kernelvariables.patch
index 1b6ee17..02612fc 100644
--- a/debian/patches/debian/kernelvariables.patch
+++ b/debian/patches/debian/kernelvariables.patch
@@ -14,7 +14,7 @@ use of $(ARCH) needs to be moved after this.
 
 --- a/Makefile
 +++ b/Makefile
-@@ -251,42 +251,6 @@ SUBARCH := $(shell uname -m | sed -e s/i
+@@ -255,42 +255,6 @@ SUBARCH := $(shell uname -m | sed -e s/i
  ARCH		?= $(SUBARCH)
  CROSS_COMPILE	?= $(CONFIG_CROSS_COMPILE:"%"=%)
  
@@ -57,8 +57,8 @@ use of $(ARCH) needs to be moved after this.
  KCONFIG_CONFIG	?= .config
  export KCONFIG_CONFIG
  
-@@ -367,6 +331,44 @@ AFLAGS_KERNEL	=
- CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage
+@@ -371,6 +335,44 @@ AFLAGS_KERNEL	=
+ CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
  CFLAGS_KCOV	= -fsanitize-coverage=trace-pc
  
 +-include $(obj)/.kernelvariables
diff --git a/debian/patches/debian/version.patch b/debian/patches/debian/version.patch
index 8311a6f..313451c 100644
--- a/debian/patches/debian/version.patch
+++ b/debian/patches/debian/version.patch
@@ -9,16 +9,16 @@ are set.
 
 --- a/Makefile
 +++ b/Makefile
-@@ -984,7 +984,7 @@ endif
+@@ -1019,7 +1019,7 @@ endif
  prepare2: prepare3 outputmakefile asm-generic
  
  prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
 -                   include/config/auto.conf
 +                   include/config/auto.conf include/generated/package.h
  	$(cmd_crmodverdir)
- 
- archprepare: archheaders archscripts prepare1 scripts_basic
-@@ -1016,6 +1016,16 @@ define filechk_version.h
+ 	$(Q)test -e include/generated/autoksyms.h || \
+ 	    touch   include/generated/autoksyms.h
+@@ -1068,6 +1068,16 @@ define filechk_version.h
  	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
  endef
  
@@ -35,7 +35,7 @@ are set.
  $(version_h): $(srctree)/Makefile FORCE
  	$(call filechk,version.h)
  	$(Q)rm -f $(old_version_h)
-@@ -1023,6 +1033,9 @@ $(version_h): $(srctree)/Makefile FORCE
+@@ -1075,6 +1085,9 @@ $(version_h): $(srctree)/Makefile FORCE
  include/generated/utsrelease.h: include/config/kernel.release FORCE
  	$(call filechk,utsrelease.h)
  
@@ -91,15 +91,15 @@ are set.
  	       regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
 --- a/arch/powerpc/kernel/process.c
 +++ b/arch/powerpc/kernel/process.c
-@@ -38,6 +38,7 @@
- #include <linux/random.h>
+@@ -39,6 +39,7 @@
  #include <linux/hw_breakpoint.h>
  #include <linux/uaccess.h>
+ #include <linux/elf-randomize.h>
 +#include <generated/package.h>
  
  #include <asm/pgtable.h>
  #include <asm/io.h>
-@@ -1150,8 +1151,9 @@ void show_regs(struct pt_regs * regs)
+@@ -1286,8 +1287,9 @@ void show_regs(struct pt_regs * regs)
  
  	printk("NIP: "REG" LR: "REG" CTR: "REG"\n",
  	       regs->nip, regs->link, regs->ctr);
@@ -121,7 +121,7 @@ are set.
  
  #include <asm/uaccess.h>
  #include <asm-generic/sections.h>
-@@ -3168,11 +3169,12 @@ void __init dump_stack_set_arch_desc(con
+@@ -3153,11 +3154,12 @@ void __init dump_stack_set_arch_desc(con
   */
  void dump_stack_print_info(const char *log_lvl)
  {
diff --git a/debian/patches/features/all/aufs4/aufs4-standalone.patch b/debian/patches/features/all/aufs4/aufs4-standalone.patch
index 6acb334..3588aa4 100644
--- a/debian/patches/features/all/aufs4/aufs4-standalone.patch
+++ b/debian/patches/features/all/aufs4/aufs4-standalone.patch
@@ -8,11 +8,9 @@ Patch headers added by debian/patches/features/all/aufs4/gen-patch
 
 aufs4.6 standalone patch
 
-diff --git a/fs/dcache.c b/fs/dcache.c
-index 4de75b2..0dd0237 100644
 --- a/fs/dcache.c
 +++ b/fs/dcache.c
-@@ -1261,6 +1261,7 @@ rename_retry:
+@@ -1274,6 +1274,7 @@ rename_retry:
  	seq = 1;
  	goto again;
  }
@@ -20,11 +18,9 @@ index 4de75b2..0dd0237 100644
  
  /*
   * Search for at least 1 mount point in the dentry's subdirs.
-diff --git a/fs/exec.c b/fs/exec.c
-index c4010b8..c2b225f 100644
 --- a/fs/exec.c
 +++ b/fs/exec.c
-@@ -104,6 +104,7 @@ bool path_noexec(const struct path *path)
+@@ -104,6 +104,7 @@ bool path_noexec(const struct path *path
  	return (path->mnt->mnt_flags & MNT_NOEXEC) ||
  	       (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
  }
@@ -32,11 +28,9 @@ index c4010b8..c2b225f 100644
  
  #ifdef CONFIG_USELIB
  /*
-diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 6f42279..04fd33c 100644
 --- a/fs/fcntl.c
 +++ b/fs/fcntl.c
-@@ -82,6 +82,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
+@@ -82,6 +82,7 @@ int setfl(int fd, struct file * filp, un
   out:
  	return error;
  }
@@ -44,8 +38,6 @@ index 6f42279..04fd33c 100644
  
  static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
                       int force)
-diff --git a/fs/file_table.c b/fs/file_table.c
-index ad17e05..ae9f267 100644
 --- a/fs/file_table.c
 +++ b/fs/file_table.c
 @@ -147,6 +147,7 @@ over:
@@ -80,11 +72,9 @@ index ad17e05..ae9f267 100644
  
  void __init files_init(void)
  { 
-diff --git a/fs/namespace.c b/fs/namespace.c
-index 4fb1691..97654d2 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
-@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
+@@ -463,6 +463,7 @@ void __mnt_drop_write(struct vfsmount *m
  	mnt_dec_writers(real_mount(mnt));
  	preempt_enable();
  }
@@ -92,7 +82,7 @@ index 4fb1691..97654d2 100644
  
  /**
   * mnt_drop_write - give up write access to a mount
-@@ -1811,6 +1812,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
+@@ -1811,6 +1812,7 @@ int iterate_mounts(int (*f)(struct vfsmo
  	}
  	return 0;
  }
@@ -100,8 +90,6 @@ index 4fb1691..97654d2 100644
  
  static void cleanup_group_ids(struct mount *mnt, struct mount *end)
  {
-diff --git a/fs/notify/group.c b/fs/notify/group.c
-index d16b62c..53e45b6 100644
 --- a/fs/notify/group.c
 +++ b/fs/notify/group.c
 @@ -22,6 +22,7 @@
@@ -112,7 +100,7 @@ index d16b62c..53e45b6 100644
  
  #include <linux/fsnotify_backend.h>
  #include "fsnotify.h"
-@@ -72,6 +73,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
+@@ -81,6 +82,7 @@ void fsnotify_get_group(struct fsnotify_
  {
  	atomic_inc(&group->refcnt);
  }
@@ -120,7 +108,7 @@ index d16b62c..53e45b6 100644
  
  /*
   * Drop a reference to a group.  Free it if it's through.
-@@ -81,6 +83,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
+@@ -90,6 +92,7 @@ void fsnotify_put_group(struct fsnotify_
  	if (atomic_dec_and_test(&group->refcnt))
  		fsnotify_final_destroy_group(group);
  }
@@ -128,7 +116,7 @@ index d16b62c..53e45b6 100644
  
  /*
   * Create a new fsnotify_group and hold a reference for the group returned.
-@@ -109,6 +112,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
+@@ -118,6 +121,7 @@ struct fsnotify_group *fsnotify_alloc_gr
  
  	return group;
  }
@@ -136,11 +124,9 @@ index d16b62c..53e45b6 100644
  
  int fsnotify_fasync(int fd, struct file *file, int on)
  {
-diff --git a/fs/notify/mark.c b/fs/notify/mark.c
-index 7115c5d..ac2bd69 100644
 --- a/fs/notify/mark.c
 +++ b/fs/notify/mark.c
-@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
+@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_m
  		mark->free_mark(mark);
  	}
  }
@@ -148,7 +134,7 @@ index 7115c5d..ac2bd69 100644
  
  /* Calculate mask of events for a list of marks */
  u32 fsnotify_recalc_mask(struct hlist_head *head)
-@@ -213,6 +214,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
+@@ -230,6 +231,7 @@ void fsnotify_destroy_mark(struct fsnoti
  	mutex_unlock(&group->mark_mutex);
  	fsnotify_free_mark(mark);
  }
@@ -156,7 +142,7 @@ index 7115c5d..ac2bd69 100644
  
  void fsnotify_destroy_marks(struct hlist_head *head, spinlock_t *lock)
  {
-@@ -398,6 +400,7 @@ err:
+@@ -415,6 +417,7 @@ err:
  
  	return ret;
  }
@@ -164,25 +150,23 @@ index 7115c5d..ac2bd69 100644
  
  int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
  		      struct inode *inode, struct vfsmount *mnt, int allow_dups)
-@@ -498,6 +501,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
- 	atomic_set(&mark->refcnt, 1);
- 	mark->free_mark = free_mark;
+@@ -521,6 +524,7 @@ void fsnotify_duplicate_mark(struct fsno
+ 	new->mask = old->mask;
+ 	new->free_mark = old->free_mark;
  }
 +EXPORT_SYMBOL_GPL(fsnotify_init_mark);
  
- static void fsnotify_mark_destroy(struct work_struct *work)
- {
-diff --git a/fs/open.c b/fs/open.c
-index 081d3d6..b4359e4 100644
+ /*
+  * Nothing fancy, just initialize lists and locks and counters.
 --- a/fs/open.c
 +++ b/fs/open.c
-@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
+@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, l
  	inode_unlock(dentry->d_inode);
  	return ret;
  }
 +EXPORT_SYMBOL_GPL(do_truncate);
  
- long vfs_truncate(struct path *path, loff_t length)
+ long vfs_truncate(const struct path *path, loff_t length)
  {
 @@ -678,6 +679,7 @@ int open_check_o_direct(struct file *f)
  	}
@@ -192,11 +176,9 @@ index 081d3d6..b4359e4 100644
  
  static int do_dentry_open(struct file *f,
  			  struct inode *inode,
-diff --git a/fs/read_write.c b/fs/read_write.c
-index 0ebcdc5..0a43d7b 100644
 --- a/fs/read_write.c
 +++ b/fs/read_write.c
-@@ -544,6 +544,7 @@ vfs_readf_t vfs_readf(struct file *file)
+@@ -525,6 +525,7 @@ vfs_readf_t vfs_readf(struct file *file)
  		return new_sync_read;
  	return ERR_PTR(-ENOSYS);
  }
@@ -204,7 +186,7 @@ index 0ebcdc5..0a43d7b 100644
  
  vfs_writef_t vfs_writef(struct file *file)
  {
-@@ -555,6 +556,7 @@ vfs_writef_t vfs_writef(struct file *file)
+@@ -536,6 +537,7 @@ vfs_writef_t vfs_writef(struct file *fil
  		return new_sync_write;
  	return ERR_PTR(-ENOSYS);
  }
@@ -212,11 +194,9 @@ index 0ebcdc5..0a43d7b 100644
  
  ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
  {
-diff --git a/fs/splice.c b/fs/splice.c
-index 9326c2a..0606690 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
-@@ -1124,6 +1124,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -1124,6 +1124,7 @@ long do_splice_from(struct pipe_inode_in
  
  	return splice_write(pipe, out, ppos, len, flags);
  }
@@ -224,7 +204,7 @@ index 9326c2a..0606690 100644
  
  /*
   * Attempt to initiate a splice from a file to a pipe.
-@@ -1153,6 +1154,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
+@@ -1153,6 +1154,7 @@ long do_splice_to(struct file *in, loff_
  
  	return splice_read(in, ppos, pipe, len, flags);
  }
@@ -232,11 +212,9 @@ index 9326c2a..0606690 100644
  
  /**
   * splice_direct_to_actor - splices data directly between two non-pipes
-diff --git a/fs/xattr.c b/fs/xattr.c
-index 4861322..c4bb039 100644
 --- a/fs/xattr.c
 +++ b/fs/xattr.c
-@@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
+@@ -207,6 +207,7 @@ vfs_getxattr_alloc(struct dentry *dentry
  	*xattr_value = value;
  	return error;
  }
@@ -244,8 +222,6 @@ index 4861322..c4bb039 100644
  
  ssize_t
  vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size)
-diff --git a/kernel/task_work.c b/kernel/task_work.c
-index 53fa971..bce3211 100644
 --- a/kernel/task_work.c
 +++ b/kernel/task_work.c
 @@ -118,3 +118,4 @@ void task_work_run(void)
@@ -253,8 +229,6 @@ index 53fa971..bce3211 100644
  	}
  }
 +EXPORT_SYMBOL_GPL(task_work_run);
-diff --git a/security/commoncap.c b/security/commoncap.c
-index 48071ed..50a1a40 100644
 --- a/security/commoncap.c
 +++ b/security/commoncap.c
 @@ -1058,12 +1058,14 @@ int cap_mmap_addr(unsigned long addr)
@@ -272,8 +246,6 @@ index 48071ed..50a1a40 100644
  
  #ifdef CONFIG_SECURITY
  
-diff --git a/security/device_cgroup.c b/security/device_cgroup.c
-index 03c1652..f88c84b 100644
 --- a/security/device_cgroup.c
 +++ b/security/device_cgroup.c
 @@ -7,6 +7,7 @@
@@ -284,7 +256,7 @@ index 03c1652..f88c84b 100644
  #include <linux/list.h>
  #include <linux/uaccess.h>
  #include <linux/seq_file.h>
-@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct inode *inode, int mask)
+@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct
  	return __devcgroup_check_permission(type, imajor(inode), iminor(inode),
  			access);
  }
@@ -292,59 +264,57 @@ index 03c1652..f88c84b 100644
  
  int devcgroup_inode_mknod(int mode, dev_t dev)
  {
-diff --git a/security/security.c b/security/security.c
-index 3644b03..593879b 100644
 --- a/security/security.c
 +++ b/security/security.c
-@@ -433,6 +433,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
+@@ -434,6 +434,7 @@ int security_path_rmdir(const struct pat
  		return 0;
  	return call_int_hook(path_rmdir, 0, dir, dentry);
  }
 +EXPORT_SYMBOL_GPL(security_path_rmdir);
  
- int security_path_unlink(struct path *dir, struct dentry *dentry)
+ int security_path_unlink(const struct path *dir, struct dentry *dentry)
  {
-@@ -449,6 +450,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
+@@ -450,6 +451,7 @@ int security_path_symlink(const struct p
  		return 0;
  	return call_int_hook(path_symlink, 0, dir, dentry, old_name);
  }
 +EXPORT_SYMBOL_GPL(security_path_symlink);
  
- int security_path_link(struct dentry *old_dentry, struct path *new_dir,
+ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
  		       struct dentry *new_dentry)
-@@ -457,6 +459,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
+@@ -458,6 +460,7 @@ int security_path_link(struct dentry *ol
  		return 0;
  	return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
  }
 +EXPORT_SYMBOL_GPL(security_path_link);
  
- int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
- 			 struct path *new_dir, struct dentry *new_dentry,
-@@ -484,6 +487,7 @@ int security_path_truncate(struct path *path)
+ int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
+ 			 const struct path *new_dir, struct dentry *new_dentry,
+@@ -485,6 +488,7 @@ int security_path_truncate(const struct
  		return 0;
  	return call_int_hook(path_truncate, 0, path);
  }
 +EXPORT_SYMBOL_GPL(security_path_truncate);
  
- int security_path_chmod(struct path *path, umode_t mode)
+ int security_path_chmod(const struct path *path, umode_t mode)
  {
-@@ -491,6 +495,7 @@ int security_path_chmod(struct path *path, umode_t mode)
+@@ -492,6 +496,7 @@ int security_path_chmod(const struct pat
  		return 0;
  	return call_int_hook(path_chmod, 0, path, mode);
  }
 +EXPORT_SYMBOL_GPL(security_path_chmod);
  
- int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
+ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
  {
-@@ -498,6 +503,7 @@ int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
+@@ -499,6 +504,7 @@ int security_path_chown(const struct pat
  		return 0;
  	return call_int_hook(path_chown, 0, path, uid, gid);
  }
 +EXPORT_SYMBOL_GPL(security_path_chown);
  
- int security_path_chroot(struct path *path)
+ int security_path_chroot(const struct path *path)
  {
-@@ -583,6 +589,7 @@ int security_inode_readlink(struct dentry *dentry)
+@@ -584,6 +590,7 @@ int security_inode_readlink(struct dentr
  		return 0;
  	return call_int_hook(inode_readlink, 0, dentry);
  }
@@ -352,7 +322,7 @@ index 3644b03..593879b 100644
  
  int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
  			       bool rcu)
-@@ -598,6 +605,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -599,6 +606,7 @@ int security_inode_permission(struct ino
  		return 0;
  	return call_int_hook(inode_permission, 0, inode, mask);
  }
@@ -360,7 +330,7 @@ index 3644b03..593879b 100644
  
  int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
  {
-@@ -736,6 +744,7 @@ int security_file_permission(struct file *file, int mask)
+@@ -737,6 +745,7 @@ int security_file_permission(struct file
  
  	return fsnotify_perm(file, mask);
  }
@@ -368,7 +338,7 @@ index 3644b03..593879b 100644
  
  int security_file_alloc(struct file *file)
  {
-@@ -795,6 +804,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
+@@ -796,6 +805,7 @@ int security_mmap_file(struct file *file
  		return ret;
  	return ima_file_mmap(file, prot);
  }
diff --git a/debian/patches/features/all/grsecurity/grkernsec_perf_harden.patch b/debian/patches/features/all/grsecurity/grkernsec_perf_harden.patch
index bd1203b..110d2d4 100644
--- a/debian/patches/features/all/grsecurity/grkernsec_perf_harden.patch
+++ b/debian/patches/features/all/grsecurity/grkernsec_perf_harden.patch
@@ -10,9 +10,9 @@ This standalone version doesn't include making the variable read-only
 ---
 --- a/include/linux/perf_event.h
 +++ b/include/linux/perf_event.h
-@@ -1002,6 +1002,11 @@ extern int perf_cpu_time_max_percent_han
- 		loff_t *ppos);
- 
+@@ -1122,6 +1122,11 @@ extern int perf_cpu_time_max_percent_han
+ int perf_event_max_stack_handler(struct ctl_table *table, int write,
+ 				 void __user *buffer, size_t *lenp, loff_t *ppos);
  
 +static inline bool perf_paranoid_any(void)
 +{
@@ -24,7 +24,7 @@ This standalone version doesn't include making the variable read-only
  	return sysctl_perf_event_paranoid > -1;
 --- a/kernel/events/core.c
 +++ b/kernel/events/core.c
-@@ -350,8 +350,13 @@ static struct srcu_struct pmus_srcu;
+@@ -352,8 +352,13 @@ static struct srcu_struct pmus_srcu;
   *   0 - disallow raw tracepoint access for unpriv
   *   1 - disallow cpu events for unpriv
   *   2 - disallow kernel profiling for unpriv
@@ -38,7 +38,7 @@ This standalone version doesn't include making the variable read-only
  
  /* Minimum for 512 kiB + 1 user control page */
  int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */
-@@ -8345,6 +8350,11 @@ SYSCALL_DEFINE5(perf_event_open,
+@@ -9181,6 +9186,11 @@ SYSCALL_DEFINE5(perf_event_open,
  	if (flags & ~PERF_FLAG_ALL)
  		return -EINVAL;
  
diff --git a/debian/patches/features/all/securelevel/acpi-disable-acpi-table-override-if-securelevel-is-s.patch b/debian/patches/features/all/securelevel/acpi-disable-acpi-table-override-if-securelevel-is-s.patch
index 6313cff..69eade9 100644
--- a/debian/patches/features/all/securelevel/acpi-disable-acpi-table-override-if-securelevel-is-s.patch
+++ b/debian/patches/features/all/securelevel/acpi-disable-acpi-table-override-if-securelevel-is-s.patch
@@ -14,14 +14,15 @@ changes to kernel space. ACPI tables contain code invoked by the kernel, so
 do not allow ACPI tables to be overridden if securelevel is set.
 
 Signed-off-by: Linn Crosetto <linn at hpe.com>
+[bwh: Forward-ported to 4.7: ACPI override code moved to drivers/acpi/tables.c]
 ---
  arch/x86/kernel/setup.c | 12 ++++++------
- drivers/acpi/osl.c      |  6 ++++++
+ drivers/acpi/tables.c   |  6 ++++++
  2 files changed, 12 insertions(+), 6 deletions(-)
 
 --- a/arch/x86/kernel/setup.c
 +++ b/arch/x86/kernel/setup.c
-@@ -1136,6 +1136,12 @@ void __init setup_arch(char **cmdline_p)
+@@ -1145,6 +1145,12 @@ void __init setup_arch(char **cmdline_p)
  	/* Allocate bigger log buffer */
  	setup_log_buf(1);
  
@@ -33,8 +34,8 @@ Signed-off-by: Linn Crosetto <linn at hpe.com>
 +
  	reserve_initrd();
  
- #if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
-@@ -1146,12 +1152,6 @@ void __init setup_arch(char **cmdline_p)
+ 	early_initrd_acpi_init();
+@@ -1153,12 +1159,6 @@ void __init setup_arch(char **cmdline_p)
  
  	io_delay_init();
  
@@ -47,9 +48,17 @@ Signed-off-by: Linn Crosetto <linn at hpe.com>
  	/*
  	 * Parse the ACPI tables for possible boot-time SMP configuration.
  	 */
---- a/drivers/acpi/osl.c
-+++ b/drivers/acpi/osl.c
-@@ -698,6 +698,12 @@ void __init acpi_initrd_override(void *d
+--- a/drivers/acpi/tables.c
++++ b/drivers/acpi/tables.c
+@@ -34,6 +34,7 @@
+ #include <linux/bootmem.h>
+ #include <linux/earlycpio.h>
+ #include <linux/memblock.h>
++#include <linux/security.h>
+ #include "internal.h"
+ 
+ #ifdef CONFIG_ACPI_CUSTOM_DSDT
+@@ -539,6 +540,12 @@ static void __init acpi_table_initrd_ini
  	if (table_nr == 0)
  		return;
  
diff --git a/debian/patches/features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-ds112.dtb-to-Makefile.patch b/debian/patches/features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-ds112.dtb-to-Makefile.patch
deleted file mode 100644
index e673e89..0000000
--- a/debian/patches/features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-ds112.dtb-to-Makefile.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Heinrich Schuchardt <xypron.glpk at gmx.de>
-Date: Mon, 28 Mar 2016 10:03:48 +0200
-Subject: [PATCH 1/2] ARM: dts: kirkwood: add kirkwood-ds112.dtb to Makefile
-Origin: http://git.infradead.org/linux-mvebu.git/commitdiff/fc5c796e12511a7c027b5a4438719dde2f796208
-
-Commit 2d0a7addbd10 ("ARM: Kirkwood: Add support for many Synology
-NAS devices") created the new file kirkwood-ds112.dts but did not
-add it to the Makefile.
-
-Fixes: 2d0a7addbd10 ("ARM: Kirkwood: Add support for many Synology NAS devices")
-Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
-Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
----
- arch/arm/boot/dts/Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index 95c1923..67d5368 100644
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -177,6 +177,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
- 	kirkwood-ds109.dtb \
- 	kirkwood-ds110jv10.dtb \
- 	kirkwood-ds111.dtb \
-+	kirkwood-ds112.dtb \
- 	kirkwood-ds209.dtb \
- 	kirkwood-ds210.dtb \
- 	kirkwood-ds212.dtb \
diff --git a/debian/patches/features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-nsa320.dtb-to-Makefile.patch b/debian/patches/features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-nsa320.dtb-to-Makefile.patch
deleted file mode 100644
index db2f045..0000000
--- a/debian/patches/features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-nsa320.dtb-to-Makefile.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Heinrich Schuchardt <xypron.glpk at gmx.de>
-Date: Mon, 28 Mar 2016 10:38:31 +0200
-Subject: [PATCH 2/2] ARM: dts: kirkwood: add kirkwood-nsa320.dtb to Makefile
-Origin: http://git.infradead.org/linux-mvebu.git/commitdiff/9ec423ed62b8278412400fae6c064edb6ce1bb51
-
-Commit be3d7d023b87 ("ARM: kirkwood: Add DTS file for NSA320")
-created the new file kirkwood-nsa320.dts but did not
-add it to the Makefile.
-
-Fixes: be3d7d023b87 ("ARM: kirkwood: Add DTS file for NSA320")
-Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
-Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
----
- arch/arm/boot/dts/Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -210,6 +210,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
- 	kirkwood-ns2mini.dtb \
- 	kirkwood-nsa310.dtb \
- 	kirkwood-nsa310a.dtb \
-+	kirkwood-nsa320.dtb \
- 	kirkwood-nsa325.dtb \
- 	kirkwood-openblocks_a6.dtb \
- 	kirkwood-openblocks_a7.dtb \
diff --git a/debian/patches/features/arm/device-tree/ARM-dts-orion5x-add-device-tree-for-kurobox-pro.patch b/debian/patches/features/arm/device-tree/ARM-dts-orion5x-add-device-tree-for-kurobox-pro.patch
deleted file mode 100644
index 7651873..0000000
--- a/debian/patches/features/arm/device-tree/ARM-dts-orion5x-add-device-tree-for-kurobox-pro.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From: Roger Shimizu <rogershimizu at gmail.com>
-Date: Wed, 30 Mar 2016 01:11:45 +0900
-Subject: [PATCH] ARM: dts: orion5x: add device tree for kurobox-pro
-Origin: http://git.infradead.org/linux-mvebu.git/commitdiff/452cc94458237d4a26aa1e08f23f57f072368e4e
-
-Add dts file to support Buffalo/Revogear Kurobox-Pro, which is marvell
-orion5x based 3.5" HDD NAS.
-
-It's a quite old product and already discontinued. So there's no
-official website for it. But it was an early product which used marvell
-orion5x 88F5182 chipset, it's popular in the community.
-Some unofficial site:
-  - http://buffalo.nas-central.org/wiki/Category:KuroboxPro
-  - http://nice.kaze.com/KUROPRO_ProductSpecifications.pdf
-
-This device tree is based on the board file:
-  arch/arm/mach-orion5x/kurobox_pro-setup.c
-However, the probing order of NAND and JEDEC-Flash are different from
-the original board file, this results in incompatible minor number
-for a few /dev/mtdX and /dev/mtdblockX devices.
-So I still want to keep the board file for the time being.
-
-Signed-off-by: Roger Shimizu <rogershimizu at gmail.com>
-Reviewed-by: Andrew Lunn <andrew at lunn.ch>
-Signed-off-by: Gregory CLEMENT <gregory.clement at free-electrons.com>
----
- arch/arm/boot/dts/Makefile               |   1 +
- arch/arm/boot/dts/orion5x-kuroboxpro.dts | 127 +++++++++++++++++++++++++++++++
- 2 files changed, 128 insertions(+)
- create mode 100644 arch/arm/boot/dts/orion5x-kuroboxpro.dts
-
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -517,6 +517,7 @@ dtb-$(CONFIG_SOC_DRA7XX) += \
- 	dra7-evm.dtb \
- 	dra72-evm.dtb
- dtb-$(CONFIG_ARCH_ORION5X) += \
-+	orion5x-kuroboxpro.dtb \
- 	orion5x-lacie-d2-network.dtb \
- 	orion5x-lacie-ethernet-disk-mini-v2.dtb \
- 	orion5x-linkstation-lsgl.dtb \
---- /dev/null
-+++ b/arch/arm/boot/dts/orion5x-kuroboxpro.dts
-@@ -0,0 +1,127 @@
-+/*
-+ * Device Tree file for Buffalo/Revogear Kurobox Pro
-+ *
-+ * Copyright (C) 2016
-+ * Roger Shimizu <rogershimizu at gmail.com>
-+ *
-+ * Based on the board file arch/arm/mach-orion5x/kurobox_pro-setup.c
-+ * Copyright (C) Ronen Shitrit <rshitrit at marvell.com>
-+ *
-+ * This file is dual-licensed: you can use it either under the terms
-+ * of the GPL or the X11 license, at your option. Note that this dual
-+ * licensing only applies to this file, and not this project as a
-+ * whole.
-+ *
-+ *  a) This file is free software; you can redistribute it and/or
-+ *     modify it under the terms of the GNU General Public License as
-+ *     published by the Free Software Foundation; either version 2 of the
-+ *     License, or (at your option) any later version.
-+ *
-+ *     This file is distributed in the hope that it will be useful
-+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *     GNU General Public License for more details.
-+ *
-+ * Or, alternatively
-+ *
-+ *  b) Permission is hereby granted, free of charge, to any person
-+ *     obtaining a copy of this software and associated documentation
-+ *     files (the "Software"), to deal in the Software without
-+ *     restriction, including without limitation the rights to use
-+ *     copy, modify, merge, publish, distribute, sublicense, and/or
-+ *     sell copies of the Software, and to permit persons to whom the
-+ *     Software is furnished to do so, subject to the following
-+ *     conditions:
-+ *
-+ *     The above copyright notice and this permission notice shall be
-+ *     included in all copies or substantial portions of the Software.
-+ *
-+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
-+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
-+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-+ *     OTHER DEALINGS IN THE SOFTWARE.
-+ */
-+
-+/dts-v1/;
-+
-+#include "orion5x-linkstation.dtsi"
-+#include <dt-bindings/gpio/gpio.h>
-+
-+/ {
-+	model = "Buffalo/Revogear Kurobox Pro";
-+	compatible = "buffalo,kurobox-pro", "marvell,orion5x-88f5182", "marvell,orion5x";
-+
-+	soc {
-+		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
-+				 <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
-+				 <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x40000>,
-+				 <MBUS_ID(0x01, 0x1e) 0 0xfc000000 0x1000000>;
-+	};
-+
-+	memory { /* 128 MB */
-+		device_type = "memory";
-+		reg = <0x00000000 0x8000000>;
-+	};
-+};
-+
-+&pinctrl {
-+	pmx_power_hdd: pmx-power-hdd {
-+		marvell,pins = "mpp1";
-+		marvell,function = "gpio";
-+	};
-+
-+	pmx_power_usb: pmx-power-usb {
-+		marvell,pins = "mpp9";
-+		marvell,function = "gpio";
-+	};
-+};
-+
-+&devbus_cs0 {
-+	status = "okay";
-+	compatible = "marvell,orion-nand";
-+	reg = <MBUS_ID(0x01, 0x1e) 0 0x400>;
-+	cle = <0>;
-+	ale = <1>;
-+	bank-width = <1>;
-+
-+	partitions {
-+		compatible = "fixed-partitions";
-+		#address-cells = <1>;
-+		#size-cells = <1>;
-+
-+		uImage at 0 { /* 4 MB */
-+			reg = <0 0x400000>;
-+			read-only;
-+		};
-+
-+		rootfs at 400000 { /* 64 MB */
-+			reg = <0x400000 0x4000000>;
-+			read-only;
-+		};
-+
-+		extra at 4400000 { /* 188 MB */
-+			reg = <0x4400000 0xBC00000>;
-+			read-only;
-+		};
-+	};
-+};
-+
-+&hdd_power {
-+	gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
-+};
-+
-+&usb_power {
-+	gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
-+};
-+
-+&sata {
-+	nr-ports = <2>;
-+};
-+
-+&ehci1 {
-+	status = "okay";
-+};
diff --git a/debian/patches/features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch b/debian/patches/features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
deleted file mode 100644
index 360a576..0000000
--- a/debian/patches/features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel at imgtec.com>
-Date: Wed, 3 Feb 2016 18:01:36 +0000
-Subject: MIPS: Octeon: Add Octeon III CN7xxx interface detection
-Origin: https://git.kernel.org/linus/885872b722b73b2026a48bdff4621f289be2b044
-
-Add basic CN7XXX interface detection.
-
-This allows the kernel to boot with ethernet working as it initializes
-the ethernet ports with SGMII instead of defaulting to RGMII routines.
-
-Tested on the utm8 from Rhino Labs with a CN7130.
-
-Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel at imgtec.com>
-Acked-by: David Daney <david.daney at cavium.com>
----
- arch/mips/cavium-octeon/executive/cvmx-helper.c | 43 +++++++++++++++++++++++++
- 1 file changed, 43 insertions(+)
-
-diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c
-index 376701f..ff26d02 100644
---- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
-+++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
-@@ -87,6 +87,8 @@ int cvmx_helper_get_number_of_interfaces(void)
- 		return 9;
- 	if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
- 		return 4;
-+	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
-+		return 5;
- 	else
- 		return 3;
- }
-@@ -260,6 +262,41 @@ static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface)
- }
- 
- /**
-+ * @INTERNAL
-+ * Return interface mode for CN7XXX.
-+ */
-+static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface)
-+{
-+	union cvmx_gmxx_inf_mode mode;
-+
-+	mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
-+
-+	switch (interface) {
-+	case 0:
-+	case 1:
-+		switch (mode.cn68xx.mode) {
-+		case 0:
-+			return CVMX_HELPER_INTERFACE_MODE_DISABLED;
-+		case 1:
-+		case 2:
-+			return CVMX_HELPER_INTERFACE_MODE_SGMII;
-+		case 3:
-+			return CVMX_HELPER_INTERFACE_MODE_XAUI;
-+		default:
-+			return CVMX_HELPER_INTERFACE_MODE_SGMII;
-+		}
-+	case 2:
-+		return CVMX_HELPER_INTERFACE_MODE_NPI;
-+	case 3:
-+		return CVMX_HELPER_INTERFACE_MODE_LOOP;
-+	case 4:
-+		return CVMX_HELPER_INTERFACE_MODE_RGMII;
-+	default:
-+		return CVMX_HELPER_INTERFACE_MODE_DISABLED;
-+	}
-+}
-+
-+/**
-  * Get the operating mode of an interface. Depending on the Octeon
-  * chip and configuration, this function returns an enumeration
-  * of the type of packet I/O supported by an interface.
-@@ -278,6 +315,12 @@ cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface)
- 		return CVMX_HELPER_INTERFACE_MODE_DISABLED;
- 
- 	/*
-+	 * OCTEON III models
-+	 */
-+	if (OCTEON_IS_MODEL(OCTEON_CN7XXX))
-+		return __cvmx_get_mode_cn7xxx(interface);
-+
-+	/*
- 	 * Octeon II models
- 	 */
- 	if (OCTEON_IS_MODEL(OCTEON_CN6XXX) || OCTEON_IS_MODEL(OCTEON_CNF71XX))
--- 
-2.8.0.rc3
-
diff --git a/debian/patches/features/mips/MIPS-Octeon-detect-and-fix-byte-swapped-initramfs.patch b/debian/patches/features/mips/MIPS-Octeon-detect-and-fix-byte-swapped-initramfs.patch
deleted file mode 100644
index 0da45b9..0000000
--- a/debian/patches/features/mips/MIPS-Octeon-detect-and-fix-byte-swapped-initramfs.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From: Aurelien Jarno <aurelien at aurel32.net>
-Date: Wed, 11 May 2016 00:37:42 +0200
-Subject: MIPS: Octeon: detect and fix byte swapped initramfs
-Origin: https://git.kernel.org/linus/8f4703aa4df758def78e9a39cc5d1ff73c3ef51f
-
-Octeon machines support running in little endian mode. U-Boot usually
-runs in big endian-mode. Therefore the initramfs is loaded in big endian
-mode, and the kernel later tries to access it in little endian mode.
-
-This patch fixes that by detecting byte swapped initramfs using either the
-CPIO header or the header from standard compression methods, and
-byte swaps it if needed. It first checks that the header doesn't match
-in the native endianness to avoid false detections. It uses the kernel
-decompress library so that we don't have to maintain the list of magics
-if some decompression methods are added to the kernel.
-
-Cc: Ralf Baechle <ralf at linux-mips.org>
-Acked-by: David Daney <david.daney at cavium.com>
-Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
----
- arch/mips/kernel/setup.c | 32 ++++++++++++++++++++++++++++++++
- 1 file changed, 32 insertions(+)
-
-diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
-index 4f60734..8841d7982 100644
---- a/arch/mips/kernel/setup.c
-+++ b/arch/mips/kernel/setup.c
-@@ -26,6 +26,7 @@
- #include <linux/sizes.h>
- #include <linux/device.h>
- #include <linux/dma-contiguous.h>
-+#include <linux/decompress/generic.h>
- 
- #include <asm/addrspace.h>
- #include <asm/bootinfo.h>
-@@ -250,6 +251,35 @@ disable:
- 	return 0;
- }
- 
-+/* In some conditions (e.g. big endian bootloader with a little endian
-+   kernel), the initrd might appear byte swapped.  Try to detect this and
-+   byte swap it if needed.  */
-+static void __init maybe_bswap_initrd(void)
-+{
-+#if defined(CONFIG_CPU_CAVIUM_OCTEON)
-+	u64 buf;
-+
-+	/* Check for CPIO signature */
-+	if (!memcmp((void *)initrd_start, "070701", 6))
-+		return;
-+
-+	/* Check for compressed initrd */
-+	if (decompress_method((unsigned char *)initrd_start, 8, NULL))
-+		return;
-+
-+	/* Try again with a byte swapped header */
-+	buf = swab64p((u64 *)initrd_start);
-+	if (!memcmp(&buf, "070701", 6) ||
-+	    decompress_method((unsigned char *)(&buf), 8, NULL)) {
-+		unsigned long i;
-+
-+		pr_info("Byteswapped initrd detected\n");
-+		for (i = initrd_start; i < ALIGN(initrd_end, 8); i += 8)
-+			swab64s((u64 *)i);
-+	}
-+#endif
-+}
-+
- static void __init finalize_initrd(void)
- {
- 	unsigned long size = initrd_end - initrd_start;
-@@ -263,6 +293,8 @@ static void __init finalize_initrd(void)
- 		goto disable;
- 	}
- 
-+	maybe_bswap_initrd();
-+
- 	reserve_bootmem(__pa(initrd_start), size, BOOTMEM_DEFAULT);
- 	initrd_below_start_ok = 1;
- 
--- 
-2.8.1
-
diff --git a/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch b/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch
index b615787..755dda3 100644
--- a/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch
+++ b/debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch
@@ -28,7 +28,7 @@ Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
 
 --- a/Documentation/kernel-parameters.txt
 +++ b/Documentation/kernel-parameters.txt
-@@ -3793,6 +3793,10 @@ bytes respectively. Such letter suffixes
+@@ -3877,6 +3877,10 @@ bytes respectively. Such letter suffixes
  
  	switches=	[HW,M68k]
  
@@ -41,7 +41,7 @@ Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
  			on older distributions. When this option is enabled
 --- a/arch/x86/Kconfig
 +++ b/arch/x86/Kconfig
-@@ -2690,6 +2690,14 @@ config X86_X32
+@@ -2665,6 +2665,14 @@ config X86_X32
  	  elf32_x86_64 support enabled to compile a kernel with this
  	  option set.
  
@@ -122,7 +122,7 @@ Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
 +#include <linux/init.h>
  #include <asm/asm-offsets.h>
  #include <asm/syscall.h>
-+#include <asm/alternative.h>
++#include <asm/text-patching.h>
  
  #define __SYSCALL_64_QUAL_(sym) sym
  #define __SYSCALL_64_QUAL_ptregs(sym) ptregs_##sym
diff --git a/debian/patches/series b/debian/patches/series
index 1ce10f9..173290c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -44,28 +44,18 @@ debian/snd-pcsp-disable-autoload.patch
 bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch
 
 # Arch bug fixes
-bugfix/mips/MIPS-Allow-emulation-for-unaligned-LSDXC1-instructions.patch
-bugfix/mips/MIPS-Disable-preemption-during-prctl-PR_SET_FP_MODE.patch
-bugfix/mips/MIPS-Force-CPUs-to-lose-FP-context-during-mode-switc.patch
-bugfix/powerpc/powerpc-fix-sstep-compile-on-powerpcspe.patch
 bugfix/arm/dwc3-exynos-fix-deferred-probing-storm.patch
 
 # Arch features
 features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch
 features/mips/MIPS-Loongson-3-Add-Loongson-LS3A-RS780E-1-way-machi.patch
 features/mips/MIPS-octeon-Add-support-for-the-UBNT-E200-board.patch
-features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
-features/mips/MIPS-Octeon-detect-and-fix-byte-swapped-initramfs.patch
 features/x86/x86-memtest-WARN-if-bad-RAM-found.patch
 features/x86/x86-make-x32-syscall-support-conditional.patch
-features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-ds112.dtb-to-Makefile.patch
-features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-nsa320.dtb-to-Makefile.patch
-features/arm/device-tree/ARM-dts-orion5x-add-device-tree-for-kurobox-pro.patch
 
 # Miscellaneous bug fixes
 bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
 bugfix/all/disable-some-marvell-phys.patch
-bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch
 bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch
 bugfix/all/module-invalidate-signatures-on-force-loaded-modules.patch
 bugfix/all/videobuf2-core-fix-crash-after-fixing-cve-2016-4568.patch
@@ -103,12 +93,6 @@ features/all/securelevel/mtd-disable-slram-and-phram-when-securelevel-is-enabled
 bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
 debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
 bugfix/all/media-videobuf2-v4l2-verify-planes-array-in-buffer-d.patch
-bugfix/all/tipc-check-nl-sock-before-parsing-nested-attributes.patch
-bugfix/x86/kvm-vmx-more-complete-state-update-on-apicv-on-off.patch
-bugfix/all/usb-usbfs-fix-potential-infoleak-in-devio.patch
-bugfix/all/alsa-timer-fix-leak-in-sndrv_timer_ioctl_params.patch
-bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_cca.patch
-bugfix/all/alsa-timer-fix-leak-in-events-via-snd_timer_user_tin.patch
 
 # Tools bug fixes
 bugfix/all/usbip-document-tcp-wrappers.patch
@@ -126,6 +110,5 @@ bugfix/alpha/alpha-uapi-add-support-for-__sane_userspace_types__.patch
 bugfix/x86/revert-perf-tools-x86-build-perf-on-older-user-space.patch
 bugfix/all/lockdep-add-missing-macros.patch
 bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
-bugfix/all/power-cpupower-fix-manpages-NAME.patch
 bugfix/all/tools-lib-traceevent-fix-use-of-uninitialized-variables.patch
 bugfix/all/scripts-fix-x.509-pem-support-in-sign-file.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list