From b098031244703475393eb39effa873d30fd0620a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 22 Jul 2017 15:32:50 +0200 Subject: [PATCH] 4.9-stable patches added patches: btrfs-don-t-clear-sgid-when-inheriting-acls.patch igb-explicitly-select-page-0-at-initialization.patch wlcore-fix-64k-page-support.patch --- ...on-t-clear-sgid-when-inheriting-acls.patch | 61 +++++++++++++++++++ ...itly-select-page-0-at-initialization.patch | 47 ++++++++++++++ queue-4.9/series | 3 + queue-4.9/wlcore-fix-64k-page-support.patch | 46 ++++++++++++++ 4 files changed, 157 insertions(+) create mode 100644 queue-4.9/btrfs-don-t-clear-sgid-when-inheriting-acls.patch create mode 100644 queue-4.9/igb-explicitly-select-page-0-at-initialization.patch create mode 100644 queue-4.9/wlcore-fix-64k-page-support.patch diff --git a/queue-4.9/btrfs-don-t-clear-sgid-when-inheriting-acls.patch b/queue-4.9/btrfs-don-t-clear-sgid-when-inheriting-acls.patch new file mode 100644 index 00000000000..759da3bcc46 --- /dev/null +++ b/queue-4.9/btrfs-don-t-clear-sgid-when-inheriting-acls.patch @@ -0,0 +1,61 @@ +From b7f8a09f8097db776b8d160862540e4fc1f51296 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 22 Jun 2017 15:31:07 +0200 +Subject: btrfs: Don't clear SGID when inheriting ACLs + +From: Jan Kara + +commit b7f8a09f8097db776b8d160862540e4fc1f51296 upstream. + +When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit +set, DIR1 is expected to have SGID bit set (and owning group equal to +the owning group of 'DIR0'). However when 'DIR0' also has some default +ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on +'DIR1' to get cleared if user is not member of the owning group. + +Fix the problem by moving posix_acl_update_mode() out of +__btrfs_set_acl() into btrfs_set_acl(). That way the function will not be +called when inheriting ACLs which is what we want as it prevents SGID +bit clearing and the mode has been properly set by posix_acl_create() +anyway. + +Fixes: 073931017b49d9458aa351605b43a7e34598caef +CC: linux-btrfs@vger.kernel.org +CC: David Sterba +Signed-off-by: Jan Kara +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/acl.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +--- a/fs/btrfs/acl.c ++++ b/fs/btrfs/acl.c +@@ -78,12 +78,6 @@ static int __btrfs_set_acl(struct btrfs_ + switch (type) { + case ACL_TYPE_ACCESS: + name = XATTR_NAME_POSIX_ACL_ACCESS; +- if (acl) { +- ret = posix_acl_update_mode(inode, &inode->i_mode, &acl); +- if (ret) +- return ret; +- } +- ret = 0; + break; + case ACL_TYPE_DEFAULT: + if (!S_ISDIR(inode->i_mode)) +@@ -119,6 +113,13 @@ out: + + int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) + { ++ int ret; ++ ++ if (type == ACL_TYPE_ACCESS && acl) { ++ ret = posix_acl_update_mode(inode, &inode->i_mode, &acl); ++ if (ret) ++ return ret; ++ } + return __btrfs_set_acl(NULL, inode, acl, type); + } + diff --git a/queue-4.9/igb-explicitly-select-page-0-at-initialization.patch b/queue-4.9/igb-explicitly-select-page-0-at-initialization.patch new file mode 100644 index 00000000000..b2c84a2cc15 --- /dev/null +++ b/queue-4.9/igb-explicitly-select-page-0-at-initialization.patch @@ -0,0 +1,47 @@ +From 440aeca4b9858248d8f16d724d9fa87a4f65fa33 Mon Sep 17 00:00:00 2001 +From: Matwey V Kornilov +Date: Thu, 24 Nov 2016 13:32:48 +0300 +Subject: igb: Explicitly select page 0 at initialization + +From: Matwey V Kornilov + +commit 440aeca4b9858248d8f16d724d9fa87a4f65fa33 upstream. + +The functions igb_read_phy_reg_gs40g/igb_write_phy_reg_gs40g (which were +removed in 2a3cdea) explicitly selected the required page at every phy_reg +access. Currently, igb_get_phy_id_82575 relays on the fact that page 0 is +already selected. The assumption is not fulfilled for my Lex 3I380CW +motherboard with integrated dual i211 based gigabit ethernet. This leads to igb +initialization failure and network interfaces are not working: + + igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k + igb: Copyright (c) 2007-2014 Intel Corporation. + igb: probe of 0000:01:00.0 failed with error -2 + igb: probe of 0000:02:00.0 failed with error -2 + +In order to fix it, we explicitly select page 0 before first access to phy +registers. + +See also: https://bugzilla.suse.com/show_bug.cgi?id=1009911 +See also: http://www.lex.com.tw/products/pdf/3I380A&3I380CW.pdf + +Fixes: 2a3cdea ("igb: Remove GS40G specific defines/functions") +Signed-off-by: Matwey V Kornilov +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/igb/e1000_82575.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/ethernet/intel/igb/e1000_82575.c ++++ b/drivers/net/ethernet/intel/igb/e1000_82575.c +@@ -246,6 +246,7 @@ static s32 igb_init_phy_params_82575(str + E1000_STATUS_FUNC_SHIFT; + + /* Set phy->phy_addr and phy->id. */ ++ igb_write_phy_reg_82580(hw, I347AT4_PAGE_SELECT, 0); + ret_val = igb_get_phy_id_82575(hw); + if (ret_val) + return ret_val; diff --git a/queue-4.9/series b/queue-4.9/series index 46e8e00c8c4..225f9f7491c 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -24,3 +24,6 @@ perf-intel-pt-ensure-never-to-set-last_ip-when-packet-count-is-zero.patch perf-intel-pt-use-fup-always-when-scanning-for-an-ip.patch perf-intel-pt-clear-fup-flag-on-error.patch bluetooth-use-constant-time-memory-comparison-for-secret-values.patch +wlcore-fix-64k-page-support.patch +btrfs-don-t-clear-sgid-when-inheriting-acls.patch +igb-explicitly-select-page-0-at-initialization.patch diff --git a/queue-4.9/wlcore-fix-64k-page-support.patch b/queue-4.9/wlcore-fix-64k-page-support.patch new file mode 100644 index 00000000000..67f665e11f9 --- /dev/null +++ b/queue-4.9/wlcore-fix-64k-page-support.patch @@ -0,0 +1,46 @@ +From 4a4274bf2dbbd1c7a45be0c89a1687c9d2eef4a0 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 11 May 2017 13:52:09 +0200 +Subject: wlcore: fix 64K page support + +From: Arnd Bergmann + +commit 4a4274bf2dbbd1c7a45be0c89a1687c9d2eef4a0 upstream. + +In the stable linux-3.16 branch, I ran into a warning in the +wlcore driver: + +drivers/net/wireless/ti/wlcore/spi.c: In function 'wl12xx_spi_raw_write': +drivers/net/wireless/ti/wlcore/spi.c:315:1: error: the frame size of 12848 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] + +Newer kernels no longer show the warning, but the bug is still there, +as the allocation is based on the CPU page size rather than the +actual capabilities of the hardware. + +This replaces the PAGE_SIZE macro with the SZ_4K macro, i.e. 4096 bytes +per buffer. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ti/wlcore/spi.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ti/wlcore/spi.c ++++ b/drivers/net/wireless/ti/wlcore/spi.c +@@ -70,10 +70,10 @@ + #define WSPI_MAX_CHUNK_SIZE 4092 + + /* +- * wl18xx driver aggregation buffer size is (13 * PAGE_SIZE) compared to +- * (4 * PAGE_SIZE) for wl12xx, so use the larger buffer needed for wl18xx ++ * wl18xx driver aggregation buffer size is (13 * 4K) compared to ++ * (4 * 4K) for wl12xx, so use the larger buffer needed for wl18xx + */ +-#define SPI_AGGR_BUFFER_SIZE (13 * PAGE_SIZE) ++#define SPI_AGGR_BUFFER_SIZE (13 * SZ_4K) + + /* Maximum number of SPI write chunks */ + #define WSPI_MAX_NUM_OF_CHUNKS \ -- 2.47.3