3.18.70-stable review
Greg Kroah-Hartman
maintainercover 3.18.70-stable review
This is the start of the stable review cycle for the 3.18.70 release. There are 9 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Sep 7 07:08:47 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.70-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.18.70-rc1
Oleg Nesterov <[email protected]>
epoll: fix race between ep_poll_callback(POLLFREE) and ep_free()/ep_remove()
Xiangliang.Yu <[email protected]>
drm/ttm: Fix accounting error when fail to get pages for pool
Vladis Dronov <[email protected]>
xfrm: policy: check policy direction value
Cong Wang <[email protected]>
wl1251: add a missing spin_lock_init()
Steve French <[email protected]>
CIFS: remove endian related sparse warning
Pavel Shilovsky <[email protected]>
CIFS: Fix maximum SMB2 header size
Tejun Heo <[email protected]>
cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs
Stephen Douthit <[email protected]>
i2c: ismt: Return EMSGSIZE for block reads with bogus length
Stephen Douthit <[email protected]>
i2c: ismt: Don't duplicate the receive length for block reads
-------------
Diffstat:
Makefile | 4 ++-- drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +- drivers/i2c/busses/i2c-ismt.c | 6 ++++-- drivers/net/wireless/ti/wl1251/main.c | 1 + fs/cifs/dir.c | 2 +- fs/cifs/smb2pdu.h | 4 ++-- fs/eventpoll.c | 37 +++++++++++++++++++++++------------ include/asm-generic/topology.h | 6 +++++- net/xfrm/xfrm_policy.c | 6 ++++++ 9 files changed, 46 insertions(+), 22 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/9 i2c: ismt: Dont duplicate the receive length for block reads
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Douthit <[email protected]>
commit b6c159a9cb69c2cf0bf59d4e12c3a2da77e4d994 upstream.
According to Table 15-14 of the C2000 EDS (Intel doc #510524) the rx data pointed to by the descriptor dptr contains the byte count.
desc->rxbytes reports all bytes read on the wire, including the "byte count" byte. So if a device sends 4 bytes in response to a block read, on the wire and in the DMA buffer we see:
count data1 data2 data3 data4
0x04 0xde 0xad 0xbe 0xef
That's what we want to return in data->block to the next level.
Instead we were actually prefixing that with desc->rxbytes:
bad
count count data1 data2 data3 data4
0x05 0x04 0xde 0xad 0xbe 0xef
This was discovered while developing a BMC solution relying on the ipmi_ssif.c driver which was trying to interpret the bogus length field as part of the IPMI response.
--- drivers/i2c/busses/i2c-ismt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-ismt.c +2 -2
@@ -340,8 +340,8 @@ static int ismt_process_desc(const strucbreak ;case I2C_SMBUS_BLOCK_DATA :case I2C_SMBUS_I2C_BLOCK_DATA : -memcpy (&data->block[1 ], dma_buffer, desc->rxbytes); - data->block[0 ] = desc->rxbytes; +memcpy (data->block, dma_buffer, desc->rxbytes); + data->block[0 ] = desc->rxbytes -1 ;break ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 2/9 i2c: ismt: Return EMSGSIZE for block reads with bogus length
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Douthit <[email protected]>
commit ba201c4f5ebe13d7819081756378777d8153f23e upstream.
Compare the number of bytes actually seen on the wire to the byte count field returned by the slave device.
Previously we just overwrote the byte count returned by the slave with the real byte count and let the caller figure out if the message was sane.
--- drivers/i2c/busses/i2c-ismt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-ismt.c +3 -1
@@ -340,8 +340,10 @@ static int ismt_process_desc(const strucbreak ;case I2C_SMBUS_BLOCK_DATA :case I2C_SMBUS_I2C_BLOCK_DATA : +if (desc->rxbytes != dma_buffer[0 ] +1 ) +return -EMSGSIZE ; +memcpy (data->block, dma_buffer, desc->rxbytes); - data->block[0 ] = desc->rxbytes -1 ;break ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 3/9 cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit b339752d054fb32863418452dff350a1086885b1 upstream.
When !NUMA, cpumask_of_node(@node) equals cpu_online_mask regardless of @node. The assumption seems that if !NUMA, there shouldn't be more than one node and thus reporting cpu_online_mask regardless of @node is correct. However, that assumption was broken years ago to support DISCONTIGMEM and whether a system has multiple nodes or not is separately controlled by NEED_MULTIPLE_NODES.
This means that, on a system with !NUMA && NEED_MULTIPLE_NODES, cpumask_of_node() will report cpu_online_mask for all possible nodes, indicating that the CPUs are associated with multiple nodes which is an impossible configuration.
This bug has been around forever but doesn't look like it has caused any noticeable symptoms. However, it triggers a WARN recently added to workqueue to verify NUMA affinity configuration.
Fix it by reporting empty cpumask on non-zero nodes if !NUMA.
--- include/asm-generic/topology.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/asm-generic/topology.h +5 -1
@@ -48,7 +48,11 @@#define parent_node (node) ((void)(node),0)#endif #ifndef cpumask_of_node -#define cpumask_of_node (node) ((void)node, cpu_online_mask) +#ifdef CONFIG_NEED_MULTIPLE_NODES +#define cpumask_of_node (node) ((node) == 0 ? cpu_online_mask : cpu_none_mask) +#else +#define cpumask_of_node (node) ((void)node, cpu_online_mask) +#endif #endif #ifndef pcibus_to_node#define pcibus_to_node (bus) ((void)(bus), -1)
Greg Kroah-Hartman
maintainerPATCH 4/9 CIFS: Fix maximum SMB2 header size
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Shilovsky <[email protected]>
commit 9e37b1784f2be9397a903307574ee565bbadfd75 upstream.
Currently the maximum size of SMB2/3 header is set incorrectly which leads to hanging of directory listing operations on encrypted SMB3 connections. Fix this by setting the maximum size to 170 bytes that is calculated as RFC1002 length field size (4) + transform header size (52) + SMB2 header size (64) + create response size (56).
--- fs/cifs/smb2pdu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/smb2pdu.h +2 -2
@@ -82,8 +82,8 @@#define NUMBER_OF_SMB2_COMMANDS 0x0013 -/* BB FIXME - analyze following length BB */ -#define MAX_SMB2_HDR_SIZE 0x78/* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */ +/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */ +#define MAX_SMB2_HDR_SIZE 0x00b0#define SMB2_PROTO_NUMBER __constant_cpu_to_le32(0x424d53fe)
Greg Kroah-Hartman
maintainerPATCH 5/9 CIFS: remove endian related sparse warning
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steve French <[email protected]>
commit 6e3c1529c39e92ed64ca41d53abadabbaa1d5393 upstream.
Recent patch had an endian warning ie
cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()
--- fs/cifs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dir.c +1 -1
@@ -194,7 +194,7 @@ check_name(struct dentry *direntry, struint i;if (unlikely (direntry->d_name.len > - tcon->fsAttrInfo.MaxPathNameComponentLength)) +le32_to_cpu (tcon->fsAttrInfo.MaxPathNameComponentLength)))return -ENAMETOOLONG ;if (!(cifs_sb->mnt_cifs_flags &CIFS_MOUNT_POSIX_PATHS )) {
Greg Kroah-Hartman
maintainerPATCH 6/9 wl1251: add a missing spin_lock_init()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
commit f581a0dd744fe32b0a8805e279c59ec1ac676d60 upstream.
wl1251: add a missing spin_lock_init()
This fixes the following kernel warning:
[ 5668.771453] BUG: spinlock bad magic on CPU#0, kworker/u2:3/9745 [ 5668.771850] lock: 0xce63ef20, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 [ 5668.772277] CPU: 0 PID: 9745 Comm: kworker/u2:3 Tainted: G W 4.12.0-03002-gec979a4-dirty #40 [ 5668.772796] Hardware name: Nokia RX-51 board [ 5668.773071] Workqueue: phy1 wl1251_irq_work [ 5668.773345] [<c010c9e4>] (unwind_backtrace) from [<c010a274>] (show_stack+0x10/0x14) [ 5668.773803] [<c010a274>] (show_stack) from [<c01545a4>] (do_raw_spin_lock+0x6c/0xa0) [ 5668.774230] [<c01545a4>] (do_raw_spin_lock) from [<c06ca578>] (_raw_spin_lock_irqsave+0x10/0x18) [ 5668.774658] [<c06ca578>] (_raw_spin_lock_irqsave) from [<c048c010>] (wl1251_op_tx+0x38/0x5c) [ 5668.775115] [<c048c010>] (wl1251_op_tx) from [<c06a12e8>] (ieee80211_tx_frags+0x188/0x1c0) [ 5668.775543] [<c06a12e8>] (ieee80211_tx_frags) from [<c06a138c>] (__ieee80211_tx+0x6c/0x130) [ 5668.775970] [<c06a138c>] (__ieee80211_tx) from [<c06a3dbc>] (ieee80211_tx+0xdc/0x104) [ 5668.776367] [<c06a3dbc>] (ieee80211_tx) from [<c06a4af0>] (__ieee80211_subif_start_xmit+0x454/0x8c8) [ 5668.776824] [<c06a4af0>] (__ieee80211_subif_start_xmit) from [<c06a4f94>] (ieee80211_subif_start_xmit+0x30/0x2fc) [ 5668.777343] [<c06a4f94>] (ieee80211_subif_start_xmit) from [<c0578848>] (dev_hard_start_xmit+0x80/0x118)
...
by adding the missing spin_lock_init().
--- drivers/net/wireless/ti/wl1251/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ti/wl1251/main.c +1 -0
@@ -1572,6 +1572,7 @@ struct ieee80211_hw *wl1251_alloc_hw(voi wl->state =WL1251_STATE_OFF ;mutex_init (&wl->mutex); +spin_lock_init (&wl->wl_lock); wl->tx_mgmt_frm_rate =DEFAULT_HW_GEN_TX_RATE ; wl->tx_mgmt_frm_mod =DEFAULT_HW_GEN_MODULATION_TYPE ;
Greg Kroah-Hartman
maintainerPATCH 7/9 xfrm: policy: check policy direction value
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladis Dronov <[email protected]>
commit 7bab09631c2a303f87a7eb7e3d69e888673b9b7e upstream.
The 'dir' parameter in xfrm_migrate() is a user-controlled byte which is used as an array index. This can lead to an out-of-bound access, kernel lockup and DoS. Add a check for the 'dir' value.
This fixes CVE-2017-11600.
References: https://bugzilla.redhat.com/show_bug.cgi?id=1474928
--- net/xfrm/xfrm_policy.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/xfrm/xfrm_policy.c +6 -0
@@ -3248,9 +3248,15 @@ int xfrm_migrate(const struct xfrm_selecstruct xfrm_state *x_new[XFRM_MAX_DEPTH ];struct xfrm_migrate *mp; +/* Stage 0 - sanity checks */ if ((err =xfrm_migrate_check (m, num_migrate)) <0 ) goto out; +if (dir >=XFRM_POLICY_MAX ) { + err = -EINVAL ; + goto out; + } +/* Stage 1 - find policy */ if ((pol =xfrm_migrate_policy_find (sel, dir, type, net)) ==NULL ) { err = -ENOENT ;
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.70 release. There are 9 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Sep 7 07:08:47 UTC 2017. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 111 pass: 111 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.70 release. There are 9 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu Sep 7 07:08:47 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.70-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah