[linux] 03/04: Merge tag 'debian/4.7.8-1'

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Sun Oct 23 03:47:51 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 68bef0cc04b70ef865e38927549164345536d95c
Merge: bc7a3c1 9586076
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sun Oct 23 04:43:12 2016 +0100

    Merge tag 'debian/4.7.8-1'

 debian/changelog                                   | 165 ++++++++
 ...ort-sprintf-buffer-in-proc-keys-show-func.patch |  70 ++++
 .../all/net-add-recursion-limit-to-gro.patch       | 201 ++++++++++
 ...lear-sgid-bit-when-setting-file-permissio.patch | 433 +++++++++++++++++++++
 debian/patches/series                              |   3 +
 5 files changed, 872 insertions(+)

diff --cc debian/changelog
index 3955988,d9e3e7e..918b50e
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,109 -1,168 +1,274 @@@
 +linux (4.8.4-1~exp1) UNRELEASED; urgency=medium
 +
 +  * New upstream release: https://kernelnewbies.org/Linux_4.8
 +  * New upstream stable update:
 +    https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.8.1
 +    https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.8.2
 +    https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.8.3
 +    https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.8.4
 +
 +  [ Ben Hutchings ]
 +  * [amd64] Enable LEGACY_VSYSCALL_NONE instead of LEGACY_VSYSCALL_EMULATE.
 +    This breaks (e)glibc 2.13 and earlier, and can be reverted using the kernel
 +    parameter: vsyscall=emulate
 +  * [arm*] Enable STRICT_DEVMEM
 +  * [arm*,powerpc*,s390x,x86] Enable IO_STRICT_DEVMEM.  This breaks dosemu and
 +    some old graphics drivers, and can be reverted using the kernel parameter:
 +    iomem=relaxed
 +  * [mips*] Enable RANDOMIZE_BASE and RELOCATABLE.
 +  * Enable SLAB_FREELIST_RANDOM
 +  * [arm*,powerpc*,s390x,sparc64,x86] Enable HARDENED_USERCOPY
 +  * security,perf: Replace GRKERNSEC_PERF_HARDEN patch with the version
 +    submitted upstream
 +  * [amd64] Enable RANDOMIZE_MEMORY
 +  * [powerpc*/*64*] Enable OPAL_PRD, MTD, MTD_POWERNV_FLASH as modules
 +    (Closes: #838604, #838605)
 +  * security,printk: Enable SECURITY_DMESG_RESTRICT, preventing non-root users
 +    reading the kernel log by default (sysctl: kernel.dmesg_restrict)
 +  * bug script: Optionally use sudo to read a restricted kernel log, and fall
 +    back to writing a placeholder
 +  * [rt] Update to 4.8-rt1 and re-enable
 +  * aufs: Update support patchest to aufs4.8-20161010 (no functional change)
 +
 +  [ Aurelien Jarno ]
 +  * [arm64] Enable SERIAL_8250_EXTENDED, SERIAL_8250_SHARE_IRQ and
 +    SERIAL_8250_BCM2835AUX, needed for Raspberry Pi 3.
 +
 + -- Ben Hutchings <ben at decadent.org.uk>  Sat, 01 Oct 2016 21:51:33 +0100
 +
 +linux (4.8~rc8-1~exp1) experimental; urgency=medium
 +
 +  * New upstream release candidate
 +
 +  [ Héctor Orón ]
 +  * [arm64] Enable ACPI, ARM64_VA_BITS_48 (Closes: #834505)
 +
 +  [ Ben Hutchings ]
 +  * Fix some new reproducibility issues:
 +    - linux-source: Exclude Python bytecode generated when running Sphinx
 +    - Set -fdebug-prefix-map=... in compiler options for kernel and userland
 +    - linux-headers: Stop including unused arch/*/kernel/asm-offsets.s files
 +  * linux-doc: Exclude Sphinx support code and Makefiles
 +  * [arm64] mm: Limit TASK_SIZE_64 for compatibility
 +  * [armhf] udeb: Replace dwmac-socfpga with dwmac-altr-socfpga in
 +    nic-modules (Closes: #837110, thanks to Vagrant Cascadian)
 +  * [armhf] Enable drivers for ASUS Chromebook C201 (veyron-speedy):
 +    MFD_RK808, POWER_AVS, POWER_RESET_GPIO_RESTART, RTC_DRV_RK808,
 +    ROCKCHIP_PM_DOMAINS as built-in; DRM_PANEL_SIMPLE, ROCKCHIP_ANALOGIX_DP,
 +    ROCKCHIP_DW_MIPI_DSI, I2C_CROS_EC_TUNNEL, KEYBOARD_CROS_EC, OUSE_ELAN_I2C,
 +    MFD_CROS_EC, MFD_CROS_EC_SPI, MFD_RK808, PHY_ROCKCHIP_EMMC, PHY_ROCKCHIP_DP,
 +    BATTERY_SBS, CHARGER_GPIO, REGULATOR_RK808, BACKLIGHT_PWM as modules
 +    (Closes: #836251, thanks to Vagrant Cascadian)
 +  * [armhf] dsa: Enable drivers for Lamobo R1 (aka BPi-R1): B53,
 +    B53_MDIO_DRIVER as modules (Closes: #836231, thanks to Vagrant Cascadian)
 +  * [armhf] media: Enable VIDEO_V4L2_SUBDEV_API and VIDEO_OMAP3 as module
 +
 + -- Ben Hutchings <ben at decadent.org.uk>  Mon, 26 Sep 2016 04:27:06 +0100
 +
 +linux (4.8~rc5-1~exp1) experimental; urgency=medium
 +
 +  * New upstream release candidate
 +
 +  [ Martin Michlmayr ]
 +  * [arm64] Enable more Tegra options: TEGRA_ACONNECT.
 +  * [arm64] Enable more QCOM options: MSM_GCC_8996, MSM_MMCC_8996, QCOM_HIDMA,
 +    QCOM_HIDMA_MGMT, PCIE_QCOM, PINCTRL_MSM8996, QCOM_Q6V5_PIL.
 +  * [arm64] Enable support for BCM2837 (Raspberry Pi 3):
 +    - Enable ARCH_BCM2835, DMA_BCM2835, BCM2835_MBOX, RASPBERRYPI_FIRMWARE,
 +      RASPBERRYPI_POWER
 +    - Enable DRM_VC4, I2C_BCM2835, PWM_BCM2835, SPI_BCM2835, SPI_BCM2835AUX,
 +      BCM2835_WDT, SND_BCM2835_SOC_I2S, MMC_SDHCI_IPROC, HW_RANDOM_BCM2835
 +      as modules
 +  * [arm64] Enable USB_DWC2 and USB_DWC3.
 +  * [arm64] Enable more HISI options: MFD_HI655X_PMIC, REGULATOR_HI655X,
 +    STUB_CLK_HI6220, HI6220_MBOX, COMMON_RESET_HI6220, PHY_HI6220_USB,
 +    HW_RANDOM_HISI, DRM_HISI_KIRIN, INPUT_HISI_POWERKEY, PCI_HISI,
 +    SPI_HISI_SFC, SCSI_HISI_SAS (Closes: #821027).
 +  * [arm64] Enable TI WLAN (WLAN_VENDOR_TI): WL1251, WL12XX, WL18XX
 +  * [arm64] Enable Hisilicon Ethernet devices: HIX5HD2_GMAC, HISI_FEMAC,
 +    HIP04_ETH, HNS_MDIO, HNS, HNS_DSAF, HNS_ENET, MDIO_HISI_FEMAC
 +
 +  [ Ben Hutchings ]
 +  * Update config for 4.8:
 +    - Enable HID_LED as module instead of USB_LED
 +    - Enable BH1780 as module instead of SENSORS_BH1780
 +    - [alpha] Enable RTC_CLASS and RTC_DRV_ALPHA instead of GEN_RTC
 +    - [armhf] Rename omapdrm display config symbols
 +    - [armhf] Enable IIO_ST_ACCEL_3AXIS as module instead of LIS3L02DQ
 +    - [hppa] Enable RTC_CLASS and RTC_DRV_GENERIC instead of GEN_RTC
 +  * liblockdep: Stop trying to build packages, as it failed to build again
 +  * linux-doc: Build and install HTML pages from reStructuredText sources
 +    - Add python-sphinx and python-sphinx-rtd-theme to Build-Depends-Indep
 +    - Install files from both HTML output directories into the package
 +    - Exclude RST sources from the package
 +
 + -- Ben Hutchings <ben at decadent.org.uk>  Wed, 07 Sep 2016 21:52:47 +0100
 +
+ linux (4.7.8-1) unstable; urgency=high
+ 
+   * New upstream stable update:
+     https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.7.7
+     - cpuset: handle race between CPU hotplug and cpuset_hotplug_work
+     - cgroup: fix invalid controller enable rejections with cgroup namespace
+     - scripts/recordmcount.c: account for .softirqentry.text
+     - mm,ksm: fix endless looping in allocating memory when ksm enable
+     - can: dev: fix deadlock reported after bus-off
+     - [x86] init: Fix cr4_init_shadow() on CR4-less machines
+     - drm/udl: fix line iterator in damage handling
+     - drm/nouveau/fifo/nv04: avoid ramht race against cookie insertion
+     - drm/radeon/si/dpm: add workaround for for Jet parts
+     - [armel,armhf] 8616/1: dt: Respect property size when parsing CPUs
+     - [armel,armhf] 8617/1: dma: fix dma_max_pfn()
+     - mwifiex: illegal assignment
+     - i40e: avoid null pointer dereference
+     - pinctrl: Flag strict is a field in struct pinmux_ops
+     - i2c: mux: demux-pinctrl: run properly with multiple instances
+     - rcuperf: Don't treat gp_exp mis-setting as a WARN
+     - [armhf,arm64] drivers/perf: arm_pmu: Fix leak in error path
+     - perf/core: Use this_cpu_ptr() when stopping AUX events
+     - [armhf,arm64] mmc: tegra: Only advertise UHS modes if IO regulator is
+       present
+     - nvmem: Declare nvmem_cell_read() consistently
+     - hwmon: (adt7411) set bit 3 in CFG1 register
+     - sched/cputime: Fix prev steal time accouting during CPU hotplug
+     - iwlwifi: mvm: checksum IPv6 fragmented packet
+     - iwlwifi: mvm: fix txq aggregation bug
+     - iwlwifi: mvm: write the correct internal TXF index
+     - iwlwifi: mvm: unmap the paging memory before freeing it
+     - iwlwifi: pcie: fix access to scratch buffer
+     - iwlwifi: mvm: free RX reorder buffer on restart
+     - iwlwifi: mvm: avoid harmless -Wmaybe-uninialized warning
+     - iwlwifi: mvm: don't use ret when not initialised
+     - [armhf] usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
+     - mac80211: check skb_linearize() return value
+     - i40iw: Protect req_resource_num update
+     - i40iw: Add missing check for interface already open
+     - i40iw: Change mem_resources pointer to a u8
+     - i40iw: Fix double free of allocated_buffer
+     - i40iw: Do not set self-referencing pointer to NULL after kfree
+     - i40iw: Avoid writing to freed memory
+     - i40iw: Add missing NULL check for MPA private data
+     - i40iw: Send last streaming mode message for loopback connections
+     - i40iw: Update hw_iwarp_state
+     - i40iw: Receive notification events correctly
+     - batman-adv: Add missing refcnt for last_candidate
+     - batman-adv: fix elp packet data reservation
+     - [armhf,arm64] irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning
+     - [armhf] 8618/1: decompressor: reset ttbcr fields to use TTBR0 on ARMv7
+     - [arm64] debug: avoid resetting stepping state machine when TIF_SINGLESTEP
+     - [mips*] uprobes: remove incorrect set_orig_insn
+     - [mips*] fix uretprobe implementation
+     - [mips*/*-malta] Fix IOCU disable switch read for MIPS64
+     - [mips*] uprobes: fix use of uninitialised variable
+     - printk: fix parsing of "brl=" option
+     - Bluetooth: split sk_filter in l2cap_sock_recv_cb
+     - tpm: fix byte-order for the value read by tpm2_get_tpm_pt
+     - regulator: pwm: Fix regulator ramp delay for continuous mode
+     - [arm64] regulator: qcom_spmi: Add support for S4 supply on pm8941
+     - [arm64] regulator: qcom_spmi: Add support for get_mode/set_mode on
+       switches
+     - [arm64] regulator: qcom_spmi: Update mvs1/mvs2 switches on pm8941
+     - [arm64] regulator: qcom_smd: Fix voltage ranges for pm8x41
+     - [arm64] regulator: qcom_smd: Fix voltage ranges for pma8084 ftsmps and
+       pldo
+     - [armhf] dts: imx6sx-sabreauto: Fix misspelled property
+     - [armhf] sun5i: Fix typo in trip point temperature
+     - pcmcia: ds: fix suspend/resume
+     - [armhf] hwrng: omap - Fix assumption that runtime_get_sync will always
+       succeed
+     - blk-mq: actually hook up defer list when running requests
+     - pstore: drop file opened reference count
+     - fm10k: fix incorrect index calculation in fm10k_write_reta
+     - iwlmvm: mvm: set correct state in smart-fifo configuration
+     - [armhf,arm64] em28xx-i2c: rt_mutex_trylock() returns zero on failure
+     - gspca: avoid unused variable warnings
+     - ath9k: Fix programming of minCCA power threshold
+     - qla2xxx: Fix BBCR offset
+     - fnic: pci_dma_mapping_error() doesn't return an error code
+     - tracing: Have HIST_TRIGGERS select TRACING
+     - NFS/pnfs: Do not clobber existing pgio_done_cb in nfs4_proc_read_setup
+     - svc: Avoid garbage replies when pc_func() returns rpc_drop_reply
+     - NFS: Don't drop CB requests with invalid principals
+     - pNFS/files: Fix layoutcommit after a commit to DS
+     - pNFS/flexfiles: Fix layoutcommit after a commit to DS
+     - watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function
+     - xprtrdma: Remove FMRs from the unmap list after unmapping
+     - [x86] ASoC: Intel: Skylake: Fix error return code in skl_probe()
+     - brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain
+     - brcmsmac: Free packet if dma_mapping_error() fails in dma_rxfill
+     - brcmsmac: Initialize power in brcms_c_stf_ss_algo_channel_get()
+     - [powerpc*] prom: Fix sub-processor option passed to ibm,
+       client-architecture-support
+     - sysctl: handle error writing UINT_MAX to u32 fields
+     - IB/core: Fix possible memory leak in cma_resolve_iboe_route()
+     - kernel/fork: fix CLONE_CHILD_CLEARTID regression in nscd
+     - SUNRPC: Silence WARN_ON when NFSv4.1 over RDMA is in use
+     - pNFS/flexfiles: Fix layoutstat periodic reporting
+     - lib/test_hash.c: fix warning in preprocessor symbol evaluation
+     - [x86] KVM: nVMX: postpone VMCS changes on MSR_IA32_APICBASE write
+     - ceph: do not modify fi->frag in need_reset_readdir()
+     - IB/ipoib: Fix memory corruption in ipoib cm mode connect flow
+     - ath10k: fix get rx_status from htt context
+     - IB/core: Fix use after free in send_leave function
+     - regmap: rbtree: Avoid overlapping nodes
+     - scsi: ses: use scsi_is_sas_rphy instead of is_sas_attached
+     - IB/ipoib: Don't allow MC joins during light MC flush
+     - IB/mlx4: Fix incorrect MC join state bit-masking on SR-IOV
+     - IB/mlx4: Fix code indentation in QP1 MAD flow
+     - IB/mlx4: Use correct subnet-prefix in QP1 mads under SR-IOV
+     - IB/mlx5: Enable MAD_IFC commands for IB ports only
+     - IB/mlx5: Set source mac address in FTE
+     - batman-adv: remove unused callback from batadv_algo_ops struct
+     - aio: mark AIO pseudo-fs noexec
+     - dm log writes: fix bug with too large bios
+     - usb: misc: legousbtower: Fix NULL pointer deference
+     - [x86] usb: usbip: vudc: fix left shift overflow
+     - Revert "usbtmc: convert to devm_kzalloc"
+     - [x86] ALSA: hda - Adding one more ALC255 pin definition for headset
+       problem
+     - [x86] ALSA: hda - Fix headset mic detection problem for several Dell
+       laptops
+     - [x86] ALSA: hda - Add the top speaker pin config for HP Spectre x360
+     https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.7.8
+     - [powerpc*] pseries: use pci_host_bridge.release_fn() to kfree(phb)
+     - [powerpc*] cxl: use pcibios_free_controller_deferred() when removing
+       vPHBs
+     - timekeeping: Fix __ktime_get_fast_ns() regression
+     - ALSA: ali5451: Fix out-of-bound position reporting
+     - ALSA: usb-audio: Extend DragonFly dB scale quirk to cover other variants
+     - mfd: rtsx_usb: Avoid setting ucr->current_sg.status
+     - [x86] xen: Update topology map for PV VCPUs
+     - [powerpc*] KVM: PPC: Book3s PR: Allow access to unprivileged MMCR2
+       register
+     - [arm64] KVM: arm64: Require in-kernel irqchip for PMU support
+     - [arm64] KVM: arm/arm64: vgic: Don't flush/sync without a working vgic
+     - [powerpc*] KVM: PPC: BookE: Fix a sanity check
+     - [arm64] fix dump_backtrace/unwind_frame with NULL tsk
+     - [x86] boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation
+     - [x86] irq: Prevent force migration of irqs which are not in the vector
+       domain
+     - [x86] apic: Get rid of apic_version[] array
+     - [x86] arch/x86: Handle non enumerated CPU after physical hotplug
+     - [x86] dumpstack: Fix x86_32 kernel_stack_pointer() previous stack access
+     - [armhf] dts: mvebu: armada-390: add missing compatibility string and
+       bracket
+     - [arm64] dts: MSM8064 remove flags from SPMI/MPP IRQs
+     - [arm64] cpuidle: Fix error return code
+     - [x86] tpm: fix a race condition in tpm2_unseal_trusted()
+     - [x86] tpm_crb: fix crb_req_canceled behavior
+ 
+   [ Ben Hutchings ]
+   * net: add recursion limit to GRO (CVE-2016-7039)
+   * posix_acl: Clear SGID bit when setting file permissions (CVE-2016-7097)
+   * scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer() (CVE-2016-7425)
+ 
+   [ Salvatore Bonaccorso ]
+   * KEYS: Fix short sprintf buffer in /proc/keys show function (CVE-2016-7042)
+   * mm: remove gup_flags FOLL_WRITE games from __get_user_pages()
+     (CVE-2016-5195)
+ 
+  -- Salvatore Bonaccorso <carnil at debian.org>  Wed, 19 Oct 2016 17:56:57 +0200
+ 
  linux (4.7.6-1) unstable; urgency=medium
  
    * New upstream stable update:
diff --cc debian/patches/bugfix/all/posix_acl-clear-sgid-bit-when-setting-file-permissio.patch
index 0000000,592625e..3241816
mode 000000,100644..100644
--- a/debian/patches/bugfix/all/posix_acl-clear-sgid-bit-when-setting-file-permissio.patch
+++ b/debian/patches/bugfix/all/posix_acl-clear-sgid-bit-when-setting-file-permissio.patch
@@@ -1,0 -1,402 +1,433 @@@
+ From: Jan Kara <jack at suse.cz>
+ Date: Mon, 19 Sep 2016 17:39:09 +0200
+ Subject: posix_acl: Clear SGID bit when setting file permissions
+ Origin: https://git.kernel.org/linus/073931017b49d9458aa351605b43a7e34598caef
+ 
+ When file permissions are modified via chmod(2) and the user is not in
+ the owning group or capable of CAP_FSETID, the setgid bit is cleared in
+ inode_change_ok().  Setting a POSIX ACL via setxattr(2) sets the file
+ permissions as well as the new ACL, but doesn't clear the setgid bit in
+ a similar way; this allows to bypass the check in chmod(2).  Fix that.
+ 
+ References: CVE-2016-7097
+ Reviewed-by: Christoph Hellwig <hch at lst.de>
+ Reviewed-by: Jeff Layton <jlayton at redhat.com>
+ Signed-off-by: Jan Kara <jack at suse.cz>
+ Signed-off-by: Andreas Gruenbacher <agruenba at redhat.com>
 -[bwh: Backported to 4.7: adjust context]
+ ---
+  fs/9p/acl.c               | 40 +++++++++++++++++-----------------------
+  fs/btrfs/acl.c            |  6 ++----
+  fs/ceph/acl.c             |  6 ++----
+  fs/ext2/acl.c             | 12 ++++--------
+  fs/ext4/acl.c             | 12 ++++--------
+  fs/f2fs/acl.c             |  6 ++----
+  fs/gfs2/acl.c             | 12 +++---------
+  fs/hfsplus/posix_acl.c    |  4 ++--
+  fs/jffs2/acl.c            |  9 ++++-----
+  fs/jfs/acl.c              |  6 ++----
+  fs/ocfs2/acl.c            | 10 ++++------
+  fs/orangefs/acl.c         | 15 +++++----------
+  fs/posix_acl.c            | 31 +++++++++++++++++++++++++++++++
+  fs/reiserfs/xattr_acl.c   |  8 ++------
+  fs/xfs/xfs_acl.c          | 13 ++++---------
+  include/linux/posix_acl.h |  1 +
+  16 files changed, 89 insertions(+), 102 deletions(-)
+ 
++diff --git a/fs/9p/acl.c b/fs/9p/acl.c
++index 5b6a1743ea17..b3c2cc79c20d 100644
+ --- a/fs/9p/acl.c
+ +++ b/fs/9p/acl.c
 -@@ -276,32 +276,26 @@ static int v9fs_xattr_set_acl(const stru
++@@ -276,32 +276,26 @@ static int v9fs_xattr_set_acl(const struct xattr_handler *handler,
+  	switch (handler->flags) {
+  	case ACL_TYPE_ACCESS:
+  		if (acl) {
+ -			umode_t mode = inode->i_mode;
+ -			retval = posix_acl_equiv_mode(acl, &mode);
+ -			if (retval < 0)
+ +			struct iattr iattr;
+ +
+ +			retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl);
+ +			if (retval)
+  				goto err_out;
+ -			else {
+ -				struct iattr iattr;
+ -				if (retval == 0) {
+ -					/*
+ -					 * ACL can be represented
+ -					 * by the mode bits. So don't
+ -					 * update ACL.
+ -					 */
+ -					acl = NULL;
+ -					value = NULL;
+ -					size = 0;
+ -				}
+ -				/* Updte the mode bits */
+ -				iattr.ia_mode = ((mode & S_IALLUGO) |
+ -						 (inode->i_mode & ~S_IALLUGO));
+ -				iattr.ia_valid = ATTR_MODE;
+ -				/* FIXME should we update ctime ?
+ -				 * What is the following setxattr update the
+ -				 * mode ?
+ +			if (!acl) {
+ +				/*
+ +				 * ACL can be represented
+ +				 * by the mode bits. So don't
+ +				 * update ACL.
+  				 */
+ -				v9fs_vfs_setattr_dotl(dentry, &iattr);
+ +				value = NULL;
+ +				size = 0;
+  			}
+ +			iattr.ia_valid = ATTR_MODE;
+ +			/* FIXME should we update ctime ?
+ +			 * What is the following setxattr update the
+ +			 * mode ?
+ +			 */
+ +			v9fs_vfs_setattr_dotl(dentry, &iattr);
+  		}
+  		break;
+  	case ACL_TYPE_DEFAULT:
++diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
++index 53bb7af4e5f0..247b8dfaf6e5 100644
+ --- a/fs/btrfs/acl.c
+ +++ b/fs/btrfs/acl.c
 -@@ -80,11 +80,9 @@ static int __btrfs_set_acl(struct btrfs_
++@@ -79,11 +79,9 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans,
+  	case ACL_TYPE_ACCESS:
+  		name = XATTR_NAME_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			ret = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -			if (ret < 0)
+ +			ret = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +			if (ret)
+  				return ret;
+ -			if (ret == 0)
+ -				acl = NULL;
+  		}
+  		ret = 0;
+  		break;
++diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c
++index 4f67227f69a5..d0b6b342dff9 100644
+ --- a/fs/ceph/acl.c
+ +++ b/fs/ceph/acl.c
 -@@ -95,11 +95,9 @@ int ceph_set_acl(struct inode *inode, st
++@@ -95,11 +95,9 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  	case ACL_TYPE_ACCESS:
+  		name = XATTR_NAME_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			ret = posix_acl_equiv_mode(acl, &new_mode);
+ -			if (ret < 0)
+ +			ret = posix_acl_update_mode(inode, &new_mode, &acl);
+ +			if (ret)
+  				goto out;
+ -			if (ret == 0)
+ -				acl = NULL;
+  		}
+  		break;
+  	case ACL_TYPE_DEFAULT:
++diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
++index 42f1d1814083..e725aa0890e0 100644
+ --- a/fs/ext2/acl.c
+ +++ b/fs/ext2/acl.c
 -@@ -190,15 +190,11 @@ ext2_set_acl(struct inode *inode, struct
++@@ -190,15 +190,11 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  		case ACL_TYPE_ACCESS:
+  			name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
+  			if (acl) {
+ -				error = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -				if (error < 0)
+ +				error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +				if (error)
+  					return error;
+ -				else {
+ -					inode->i_ctime = CURRENT_TIME_SEC;
+ -					mark_inode_dirty(inode);
+ -					if (error == 0)
+ -						acl = NULL;
+ -				}
+ +				inode->i_ctime = CURRENT_TIME_SEC;
+ +				mark_inode_dirty(inode);
+  			}
+  			break;
+  
++diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
++index c6601a476c02..dfa519979038 100644
+ --- a/fs/ext4/acl.c
+ +++ b/fs/ext4/acl.c
 -@@ -193,15 +193,11 @@ __ext4_set_acl(handle_t *handle, struct
++@@ -193,15 +193,11 @@ __ext4_set_acl(handle_t *handle, struct inode *inode, int type,
+  	case ACL_TYPE_ACCESS:
+  		name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			error = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -			if (error < 0)
+ +			error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +			if (error)
+  				return error;
+ -			else {
+ -				inode->i_ctime = ext4_current_time(inode);
+ -				ext4_mark_inode_dirty(handle, inode);
+ -				if (error == 0)
+ -					acl = NULL;
+ -			}
+ +			inode->i_ctime = ext4_current_time(inode);
+ +			ext4_mark_inode_dirty(handle, inode);
+  		}
+  		break;
+  
++diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
++index 4dcc9e28dc5c..31344247ce89 100644
+ --- a/fs/f2fs/acl.c
+ +++ b/fs/f2fs/acl.c
 -@@ -211,12 +211,10 @@ static int __f2fs_set_acl(struct inode *
++@@ -210,12 +210,10 @@ static int __f2fs_set_acl(struct inode *inode, int type,
+  	case ACL_TYPE_ACCESS:
+  		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			error = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -			if (error < 0)
+ +			error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +			if (error)
+  				return error;
 - 			set_acl_inode(fi, inode->i_mode);
++ 			set_acl_inode(inode, inode->i_mode);
+ -			if (error == 0)
+ -				acl = NULL;
+  		}
+  		break;
+  
++diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
++index 363ba9e9d8d0..2524807ee070 100644
+ --- a/fs/gfs2/acl.c
+ +++ b/fs/gfs2/acl.c
 -@@ -92,17 +92,11 @@ int __gfs2_set_acl(struct inode *inode,
++@@ -92,17 +92,11 @@ int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  	if (type == ACL_TYPE_ACCESS) {
+  		umode_t mode = inode->i_mode;
+  
+ -		error = posix_acl_equiv_mode(acl, &mode);
+ -		if (error < 0)
+ +		error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +		if (error)
+  			return error;
+ -
+ -		if (error == 0)
+ -			acl = NULL;
+ -
+ -		if (mode != inode->i_mode) {
+ -			inode->i_mode = mode;
+ +		if (mode != inode->i_mode)
+  			mark_inode_dirty(inode);
+ -		}
+  	}
+  
+  	if (acl) {
++diff --git a/fs/hfsplus/posix_acl.c b/fs/hfsplus/posix_acl.c
++index ab7ea2506b4d..9b92058a1240 100644
+ --- a/fs/hfsplus/posix_acl.c
+ +++ b/fs/hfsplus/posix_acl.c
 -@@ -65,8 +65,8 @@ int hfsplus_set_posix_acl(struct inode *
++@@ -65,8 +65,8 @@ int hfsplus_set_posix_acl(struct inode *inode, struct posix_acl *acl,
+  	case ACL_TYPE_ACCESS:
+  		xattr_name = XATTR_NAME_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			err = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -			if (err < 0)
+ +			err = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +			if (err)
+  				return err;
+  		}
+  		err = 0;
++diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
++index bc2693d56298..2a0f2a1044c1 100644
+ --- a/fs/jffs2/acl.c
+ +++ b/fs/jffs2/acl.c
 -@@ -233,9 +233,10 @@ int jffs2_set_acl(struct inode *inode, s
++@@ -233,9 +233,10 @@ int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  	case ACL_TYPE_ACCESS:
+  		xprefix = JFFS2_XPREFIX_ACL_ACCESS;
+  		if (acl) {
+ -			umode_t mode = inode->i_mode;
+ -			rc = posix_acl_equiv_mode(acl, &mode);
+ -			if (rc < 0)
+ +			umode_t mode;
+ +
+ +			rc = posix_acl_update_mode(inode, &mode, &acl);
+ +			if (rc)
+  				return rc;
+  			if (inode->i_mode != mode) {
+  				struct iattr attr;
 -@@ -247,8 +248,6 @@ int jffs2_set_acl(struct inode *inode, s
++@@ -247,8 +248,6 @@ int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  				if (rc < 0)
+  					return rc;
+  			}
+ -			if (rc == 0)
+ -				acl = NULL;
+  		}
+  		break;
+  	case ACL_TYPE_DEFAULT:
++diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
++index 21fa92ba2c19..3a1e1554a4e3 100644
+ --- a/fs/jfs/acl.c
+ +++ b/fs/jfs/acl.c
 -@@ -78,13 +78,11 @@ static int __jfs_set_acl(tid_t tid, stru
++@@ -78,13 +78,11 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
+  	case ACL_TYPE_ACCESS:
+  		ea_name = XATTR_NAME_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			rc = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -			if (rc < 0)
+ +			rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +			if (rc)
+  				return rc;
+  			inode->i_ctime = CURRENT_TIME;
+  			mark_inode_dirty(inode);
+ -			if (rc == 0)
+ -				acl = NULL;
+  		}
+  		break;
+  	case ACL_TYPE_DEFAULT:
++diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
++index 2162434728c0..164307b99405 100644
+ --- a/fs/ocfs2/acl.c
+ +++ b/fs/ocfs2/acl.c
+ @@ -241,13 +241,11 @@ int ocfs2_set_acl(handle_t *handle,
+  	case ACL_TYPE_ACCESS:
+  		name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			umode_t mode = inode->i_mode;
+ -			ret = posix_acl_equiv_mode(acl, &mode);
+ -			if (ret < 0)
+ -				return ret;
+ +			umode_t mode;
+  
+ -			if (ret == 0)
+ -				acl = NULL;
+ +			ret = posix_acl_update_mode(inode, &mode, &acl);
+ +			if (ret)
+ +				return ret;
+  
+  			ret = ocfs2_acl_set_mode(inode, di_bh,
+  						 handle, mode);
++diff --git a/fs/orangefs/acl.c b/fs/orangefs/acl.c
++index 28f2195cd798..7a3754488312 100644
+ --- a/fs/orangefs/acl.c
+ +++ b/fs/orangefs/acl.c
 -@@ -76,14 +76,11 @@ int orangefs_set_acl(struct inode *inode
++@@ -73,14 +73,11 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  	case ACL_TYPE_ACCESS:
 - 		name = ORANGEFS_XATTR_NAME_ACL_ACCESS;
++ 		name = XATTR_NAME_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			umode_t mode = inode->i_mode;
+ -			/*
+ -			 * can we represent this with the traditional file
+ -			 * mode permission bits?
+ -			 */
+ -			error = posix_acl_equiv_mode(acl, &mode);
+ -			if (error < 0) {
+ -				gossip_err("%s: posix_acl_equiv_mode err: %d\n",
+ +			umode_t mode;
+ +
+ +			error = posix_acl_update_mode(inode, &mode, &acl);
+ +			if (error) {
+ +				gossip_err("%s: posix_acl_update_mode err: %d\n",
+  					   __func__,
+  					   error);
+  				return error;
 -@@ -93,8 +90,6 @@ int orangefs_set_acl(struct inode *inode
++@@ -90,8 +87,6 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  				SetModeFlag(orangefs_inode);
+  			inode->i_mode = mode;
+  			mark_inode_dirty_sync(inode);
+ -			if (error == 0)
+ -				acl = NULL;
+  		}
+  		break;
+  	case ACL_TYPE_DEFAULT:
++diff --git a/fs/posix_acl.c b/fs/posix_acl.c
++index 59d47ab0791a..bfc3ec388322 100644
+ --- a/fs/posix_acl.c
+ +++ b/fs/posix_acl.c
 -@@ -626,6 +626,37 @@ no_mem:
++@@ -626,6 +626,37 @@ posix_acl_create(struct inode *dir, umode_t *mode,
+  }
+  EXPORT_SYMBOL_GPL(posix_acl_create);
+  
+ +/**
+ + * posix_acl_update_mode  -  update mode in set_acl
+ + *
+ + * Update the file mode when setting an ACL: compute the new file permission
+ + * bits based on the ACL.  In addition, if the ACL is equivalent to the new
+ + * file mode, set *acl to NULL to indicate that no ACL should be set.
+ + *
+ + * As with chmod, clear the setgit bit if the caller is not in the owning group
+ + * or capable of CAP_FSETID (see inode_change_ok).
+ + *
+ + * Called from set_acl inode operations.
+ + */
+ +int posix_acl_update_mode(struct inode *inode, umode_t *mode_p,
+ +			  struct posix_acl **acl)
+ +{
+ +	umode_t mode = inode->i_mode;
+ +	int error;
+ +
+ +	error = posix_acl_equiv_mode(*acl, &mode);
+ +	if (error < 0)
+ +		return error;
+ +	if (error == 0)
+ +		*acl = NULL;
+ +	if (!in_group_p(inode->i_gid) &&
+ +	    !capable_wrt_inode_uidgid(inode, CAP_FSETID))
+ +		mode &= ~S_ISGID;
+ +	*mode_p = mode;
+ +	return 0;
+ +}
+ +EXPORT_SYMBOL(posix_acl_update_mode);
+ +
+  /*
+   * Fix up the uids and gids in posix acl extended attributes in place.
+   */
++diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
++index dbed42f755e0..27376681c640 100644
+ --- a/fs/reiserfs/xattr_acl.c
+ +++ b/fs/reiserfs/xattr_acl.c
 -@@ -242,13 +242,9 @@ __reiserfs_set_acl(struct reiserfs_trans
++@@ -242,13 +242,9 @@ __reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
+  	case ACL_TYPE_ACCESS:
+  		name = XATTR_NAME_POSIX_ACL_ACCESS;
+  		if (acl) {
+ -			error = posix_acl_equiv_mode(acl, &inode->i_mode);
+ -			if (error < 0)
+ +			error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ +			if (error)
+  				return error;
+ -			else {
+ -				if (error == 0)
+ -					acl = NULL;
+ -			}
+  		}
+  		break;
+  	case ACL_TYPE_DEFAULT:
++diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
++index b6e527b8eccb..8a0dec89ca56 100644
+ --- a/fs/xfs/xfs_acl.c
+ +++ b/fs/xfs/xfs_acl.c
 -@@ -257,16 +257,11 @@ xfs_set_acl(struct inode *inode, struct
++@@ -257,16 +257,11 @@ xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
+  		return error;
+  
+  	if (type == ACL_TYPE_ACCESS) {
+ -		umode_t mode = inode->i_mode;
+ -		error = posix_acl_equiv_mode(acl, &mode);
+ -
+ -		if (error <= 0) {
+ -			acl = NULL;
+ -
+ -			if (error < 0)
+ -				return error;
+ -		}
+ +		umode_t mode;
+  
+ +		error = posix_acl_update_mode(inode, &mode, &acl);
+ +		if (error)
+ +			return error;
+  		error = xfs_set_mode(inode, mode);
+  		if (error)
+  			return error;
++diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
++index d5d3d741f028..bf1046d0397b 100644
+ --- a/include/linux/posix_acl.h
+ +++ b/include/linux/posix_acl.h
 -@@ -93,6 +93,7 @@ extern int set_posix_acl(struct inode *,
++@@ -93,6 +93,7 @@ extern int set_posix_acl(struct inode *, int, struct posix_acl *);
+  extern int posix_acl_chmod(struct inode *, umode_t);
+  extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **,
+  		struct posix_acl **);
+ +extern int posix_acl_update_mode(struct inode *, umode_t *, struct posix_acl **);
+  
+  extern int simple_set_acl(struct inode *, struct posix_acl *, int);
+  extern int simple_acl_create(struct inode *, struct inode *);
diff --cc debian/patches/series
index 224164b,cca79cc..ed0f72c
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -93,8 -114,18 +93,11 @@@ features/all/securelevel/arm64-add-kern
  # Security fixes
  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/net-add-recursion-limit-to-gro.patch
+ bugfix/all/posix_acl-clear-sgid-bit-when-setting-file-permissio.patch
 -bugfix/all/scsi-arcmsr-buffer-overflow-in-arcmsr_iop_message_xf.patch
+ bugfix/all/KEYS-Fix-short-sprintf-buffer-in-proc-keys-show-func.patch
 -bugfix/all/mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch
  
  # ABI maintenance
 -debian/i8042-revert-abi-break-in-4.7.3.patch
 -debian/revert-arm64-define-at_vector_size_arch-for-arch_dlinfo.patch
 -debian/uaccess-avoid-abi-change-in-4.7.5.patch
 -debian/uio-fix-abi-change-in-4.7.5.patch
 -debian/gro-fix-abi-change-for-cve-2016-7039-fix.patch
  
  # Tools bug fixes
  bugfix/all/usbip-document-tcp-wrappers.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