* [PATCH 3.14 01/46] tcp: make challenge acks faster
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 02/46] usb: renesas_usbhs: protect the CFIFOSEL setting in usbhsg_ep_enable() Greg Kroah-Hartman
` (24 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Yue Cao, Eric Dumazet, Linus Torvalds,
Yuchung Cheng, Neal Cardwell, David S. Miller, Chas Williams,
Willy Tarreau
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When backporting upstream commit 75ff39ccc1bd ("tcp: make challenge acks
less predictable") I negelected to use the correct ACCESS* type macros.
This fixes that up to hopefully speed things up a bit more.
Thanks to Chas Wiliams for the 3.10 backport which reminded me of this.
Cc: Yue Cao <ycao009@ucr.edu>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Chas Williams <ciwillia@brocade.com>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp_input.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3299,12 +3299,12 @@ static void tcp_send_challenge_ack(struc
u32 half = (sysctl_tcp_challenge_ack_limit + 1) >> 1;
challenge_timestamp = now;
- challenge_count = half +
+ ACCESS_ONCE(challenge_count) = half +
prandom_u32_max(sysctl_tcp_challenge_ack_limit);
}
- count = challenge_count;
+ count = ACCESS_ONCE(challenge_count);
if (count > 0) {
- challenge_count = count - 1;
+ ACCESS_ONCE(challenge_count) = count - 1;
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPCHALLENGEACK);
tcp_send_ack(sk);
}
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 02/46] usb: renesas_usbhs: protect the CFIFOSEL setting in usbhsg_ep_enable()
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 01/46] tcp: make challenge acks faster Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 11/46] cifs: Check for existing directory when opening file with O_CREAT Greg Kroah-Hartman
` (23 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Yoshihiro Shimoda, Felipe Balbi
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
commit 15e4292a2d21e9997fdb2b8c014cc461b3f268f0 upstream.
This patch fixes an issue that the CFIFOSEL register value is possible
to be changed by usbhsg_ep_enable() wrongly. And then, a data transfer
using CFIFO may not work correctly.
For example:
# modprobe g_multi file=usb-storage.bin
# ifconfig usb0 192.168.1.1 up
(During the USB host is sending file to the mass storage)
# ifconfig usb0 down
In this case, since the u_ether.c may call usb_ep_enable() in
eth_stop(), if the renesas_usbhs driver is also using CFIFO for
mass storage, the mass storage may not work correctly.
So, this patch adds usbhs_lock() and usbhs_unlock() calling in
usbhsg_ep_enable() to protect CFIFOSEL register. This is because:
- CFIFOSEL.CURPIPE = 0 is also needed for the pipe configuration
- The CFIFOSEL (fifo->sel) is already protected by usbhs_lock()
Fixes: 97664a207bc2 ("usb: renesas_usbhs: shrink spin lock area")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/renesas_usbhs/mod_gadget.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -558,6 +558,9 @@ static int usbhsg_ep_enable(struct usb_e
struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
struct usbhs_pipe *pipe;
int ret = -EIO;
+ unsigned long flags;
+
+ usbhs_lock(priv, flags);
/*
* if it already have pipe,
@@ -566,7 +569,8 @@ static int usbhsg_ep_enable(struct usb_e
if (uep->pipe) {
usbhs_pipe_clear(uep->pipe);
usbhs_pipe_sequence_data0(uep->pipe);
- return 0;
+ ret = 0;
+ goto usbhsg_ep_enable_end;
}
pipe = usbhs_pipe_malloc(priv,
@@ -594,6 +598,9 @@ static int usbhsg_ep_enable(struct usb_e
ret = 0;
}
+usbhsg_ep_enable_end:
+ usbhs_unlock(priv, flags);
+
return ret;
}
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 11/46] cifs: Check for existing directory when opening file with O_CREAT
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 01/46] tcp: make challenge acks faster Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 02/46] usb: renesas_usbhs: protect the CFIFOSEL setting in usbhsg_ep_enable() Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 12/46] cifs: fix crash due to race in hmac(md5) handling Greg Kroah-Hartman
` (22 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Sachin Prabhu, Steve French,
Xiaoli Feng
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sachin Prabhu <sprabhu@redhat.com>
commit 8d9535b6efd86e6c07da59f97e68f44efb7fe080 upstream.
When opening a file with O_CREAT flag, check to see if the file opened
is an existing directory.
This prevents the directory from being opened which subsequently causes
a crash when the close function for directories cifs_closedir() is called
which frees up the file->private_data memory while the file is still
listed on the open file list for the tcon.
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/dir.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -229,6 +229,13 @@ cifs_do_create(struct inode *inode, stru
goto cifs_create_get_file_info;
}
+ if (S_ISDIR(newinode->i_mode)) {
+ CIFSSMBClose(xid, tcon, fid->netfid);
+ iput(newinode);
+ rc = -EISDIR;
+ goto out;
+ }
+
if (!S_ISREG(newinode->i_mode)) {
/*
* The server may allow us to open things like
@@ -399,10 +406,14 @@ cifs_create_set_dentry:
if (rc != 0) {
cifs_dbg(FYI, "Create worked, get_inode_info failed rc = %d\n",
rc);
- if (server->ops->close)
- server->ops->close(xid, tcon, fid);
- goto out;
+ goto out_err;
}
+
+ if (S_ISDIR(newinode->i_mode)) {
+ rc = -EISDIR;
+ goto out_err;
+ }
+
d_drop(direntry);
d_add(direntry, newinode);
@@ -410,6 +421,13 @@ out:
kfree(buf);
kfree(full_path);
return rc;
+
+out_err:
+ if (server->ops->close)
+ server->ops->close(xid, tcon, fid);
+ if (newinode)
+ iput(newinode);
+ goto out;
}
int
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 12/46] cifs: fix crash due to race in hmac(md5) handling
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (2 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 11/46] cifs: Check for existing directory when opening file with O_CREAT Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 14/46] random: properly align get_random_int_hash Greg Kroah-Hartman
` (21 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Rabin Vincent, Sachin Prabhu,
Steve French
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rabin Vincent <rabinv@axis.com>
commit bd975d1eead2558b76e1079e861eacf1f678b73b upstream.
The secmech hmac(md5) structures are present in the TCP_Server_Info
struct and can be shared among multiple CIFS sessions. However, the
server mutex is not currently held when these structures are allocated
and used, which can lead to a kernel crashes, as in the scenario below:
mount.cifs(8) #1 mount.cifs(8) #2
Is secmech.sdeschmaccmd5 allocated?
// false
Is secmech.sdeschmaccmd5 allocated?
// false
secmech.hmacmd = crypto_alloc_shash..
secmech.sdeschmaccmd5 = kzalloc..
sdeschmaccmd5->shash.tfm = &secmec.hmacmd;
secmech.sdeschmaccmd5 = kzalloc
// sdeschmaccmd5->shash.tfm
// not yet assigned
crypto_shash_update()
deref NULL sdeschmaccmd5->shash.tfm
Unable to handle kernel paging request at virtual address 00000030
epc : 8027ba34 crypto_shash_update+0x38/0x158
ra : 8020f2e8 setup_ntlmv2_rsp+0x4bc/0xa84
Call Trace:
crypto_shash_update+0x38/0x158
setup_ntlmv2_rsp+0x4bc/0xa84
build_ntlmssp_auth_blob+0xbc/0x34c
sess_auth_rawntlmssp_authenticate+0xac/0x248
CIFS_SessSetup+0xf0/0x178
cifs_setup_session+0x4c/0x84
cifs_get_smb_ses+0x2c8/0x314
cifs_mount+0x38c/0x76c
cifs_do_mount+0x98/0x440
mount_fs+0x20/0xc0
vfs_kern_mount+0x58/0x138
do_mount+0x1e8/0xccc
SyS_mount+0x88/0xd4
syscall_common+0x30/0x54
Fix this by locking the srv_mutex around the code which uses these
hmac(md5) structures. All the other secmech algos already have similar
locking.
Fixes: 95dc8dd14e2e84cc ("Limit allocation of crypto mechanisms to dialect which requires")
Signed-off-by: Rabin Vincent <rabinv@axis.com>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/cifsencrypt.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -727,24 +727,26 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, c
memcpy(ses->auth_key.response + baselen, tiblob, tilen);
+ mutex_lock(&ses->server->srv_mutex);
+
rc = crypto_hmacmd5_alloc(ses->server);
if (rc) {
cifs_dbg(VFS, "could not crypto alloc hmacmd5 rc %d\n", rc);
- goto setup_ntlmv2_rsp_ret;
+ goto unlock;
}
/* calculate ntlmv2_hash */
rc = calc_ntlmv2_hash(ses, ntlmv2_hash, nls_cp);
if (rc) {
cifs_dbg(VFS, "could not get v2 hash rc %d\n", rc);
- goto setup_ntlmv2_rsp_ret;
+ goto unlock;
}
/* calculate first part of the client response (CR1) */
rc = CalcNTLMv2_response(ses, ntlmv2_hash);
if (rc) {
cifs_dbg(VFS, "Could not calculate CR1 rc: %d\n", rc);
- goto setup_ntlmv2_rsp_ret;
+ goto unlock;
}
/* now calculate the session key for NTLMv2 */
@@ -753,13 +755,13 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, c
if (rc) {
cifs_dbg(VFS, "%s: Could not set NTLMV2 Hash as a key\n",
__func__);
- goto setup_ntlmv2_rsp_ret;
+ goto unlock;
}
rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
if (rc) {
cifs_dbg(VFS, "%s: Could not init hmacmd5\n", __func__);
- goto setup_ntlmv2_rsp_ret;
+ goto unlock;
}
rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash,
@@ -767,7 +769,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, c
CIFS_HMAC_MD5_HASH_SIZE);
if (rc) {
cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
- goto setup_ntlmv2_rsp_ret;
+ goto unlock;
}
rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
@@ -775,6 +777,8 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, c
if (rc)
cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
+unlock:
+ mutex_unlock(&ses->server->srv_mutex);
setup_ntlmv2_rsp_ret:
kfree(tiblob);
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 14/46] random: properly align get_random_int_hash
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (3 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 12/46] cifs: fix crash due to race in hmac(md5) handling Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-19 3:14 ` Eric Biggers
2016-08-18 13:54 ` [PATCH 3.14 15/46] random: print a warning for the first ten uninitialized random users Greg Kroah-Hartman
` (20 subsequent siblings)
25 siblings, 1 reply; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Eric Biggers, Theodore Tso
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <ebiggers3@gmail.com>
commit b1132deac01c2332d234fa821a70022796b79182 upstream.
get_random_long() reads from the get_random_int_hash array using an
unsigned long pointer. For this code to be guaranteed correct on all
architectures, the array must be aligned to an unsigned long boundary.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/random.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1632,13 +1632,15 @@ int random_int_secret_init(void)
return 0;
}
+static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash)
+ __aligned(sizeof(unsigned long));
+
/*
* Get a random word for internal kernel use only. Similar to urandom but
* with the goal of minimal entropy pool depletion. As a result, the random
* value is not cryptographically secure but for several uses the cost of
* depleting entropy is too high
*/
-static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash);
unsigned int get_random_int(void)
{
__u32 *hash;
^ permalink raw reply [flat|nested] 30+ messages in thread* Re: [PATCH 3.14 14/46] random: properly align get_random_int_hash
2016-08-18 13:54 ` [PATCH 3.14 14/46] random: properly align get_random_int_hash Greg Kroah-Hartman
@ 2016-08-19 3:14 ` Eric Biggers
2016-08-19 7:33 ` Greg Kroah-Hartman
0 siblings, 1 reply; 30+ messages in thread
From: Eric Biggers @ 2016-08-19 3:14 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, Theodore Tso, Eric Biggers
get_random_long() was added in v4.5 and doesn't appear to have been backported
to any stable branches, so my patch doesn't actually need to be backported to
anything older than v4.5. It won't break anything, though.
On Thu, Aug 18, 2016 at 03:54:36PM +0200, Greg Kroah-Hartman wrote:
> 3.14-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Eric Biggers <ebiggers3@gmail.com>
>
> commit b1132deac01c2332d234fa821a70022796b79182 upstream.
>
> get_random_long() reads from the get_random_int_hash array using an
> unsigned long pointer. For this code to be guaranteed correct on all
> architectures, the array must be aligned to an unsigned long boundary.
>
> Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/char/random.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -1632,13 +1632,15 @@ int random_int_secret_init(void)
> return 0;
> }
>
> +static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash)
> + __aligned(sizeof(unsigned long));
> +
> /*
> * Get a random word for internal kernel use only. Similar to urandom but
> * with the goal of minimal entropy pool depletion. As a result, the random
> * value is not cryptographically secure but for several uses the cost of
> * depleting entropy is too high
> */
> -static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash);
> unsigned int get_random_int(void)
> {
> __u32 *hash;
>
>
^ permalink raw reply [flat|nested] 30+ messages in thread* Re: [PATCH 3.14 14/46] random: properly align get_random_int_hash
2016-08-19 3:14 ` Eric Biggers
@ 2016-08-19 7:33 ` Greg Kroah-Hartman
0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-19 7:33 UTC (permalink / raw)
To: Eric Biggers; +Cc: linux-kernel, stable, Theodore Tso, Eric Biggers
On Thu, Aug 18, 2016 at 08:14:17PM -0700, Eric Biggers wrote:
> get_random_long() was added in v4.5 and doesn't appear to have been backported
> to any stable branches, so my patch doesn't actually need to be backported to
> anything older than v4.5. It won't break anything, though.
Ah, thanks for that, I'll go remove this from 3.14 and the 4.4 stable
kernel queues.
greg k-h
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 3.14 15/46] random: print a warning for the first ten uninitialized random users
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (4 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 14/46] random: properly align get_random_int_hash Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 20/46] nfs: dont create zero-length requests Greg Kroah-Hartman
` (19 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Theodore Tso
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <tytso@mit.edu>
commit 9b4d008787f864f17d008c9c15bbe8a0f7e2fc24 upstream.
Since systemd is consistently using /dev/urandom before it is
initialized, we can't see the other potentially dangerous users of
/dev/urandom immediately after boot. So print the first ten such
complaints instead.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/random.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1339,12 +1339,16 @@ random_read(struct file *file, char __us
static ssize_t
urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
{
+ static int maxwarn = 10;
int ret;
- if (unlikely(nonblocking_pool.initialized == 0))
- printk_once(KERN_NOTICE "random: %s urandom read "
- "with %d bits of entropy available\n",
- current->comm, nonblocking_pool.entropy_total);
+ if (unlikely(nonblocking_pool.initialized == 0) &&
+ maxwarn > 0) {
+ maxwarn--;
+ printk(KERN_NOTICE "random: %s: uninitialized urandom read "
+ "(%zd bytes read, %d bits of entropy available)\n",
+ current->comm, nbytes, nonblocking_pool.entropy_total);
+ }
ret = extract_entropy_user(&nonblocking_pool, buf, nbytes);
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 20/46] nfs: dont create zero-length requests
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (5 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 15/46] random: print a warning for the first ten uninitialized random users Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 30/46] balloon: check the number of available pages in leak balloon Greg Kroah-Hartman
` (18 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Benjamin Coddington, Alexey Dobriyan,
Weston Andros Adamson, Trond Myklebust
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <bcodding@redhat.com>
commit 149a4fddd0a72d526abbeac0c8deaab03559836a upstream.
NFS doesn't expect requests with wb_bytes set to zero and may make
unexpected decisions about how to handle that request at the page IO layer.
Skip request creation if we won't have any wb_bytes in the request.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/write.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -965,6 +965,9 @@ int nfs_updatepage(struct file *file, st
dprintk("NFS: nfs_updatepage(%pD2 %d@%lld)\n",
file, count, (long long)(page_file_offset(page) + offset));
+ if (!count)
+ goto out;
+
if (nfs_can_extend_write(file, page, inode)) {
count = max(count + offset, nfs_page_length(page));
offset = 0;
@@ -975,7 +978,7 @@ int nfs_updatepage(struct file *file, st
nfs_set_pageerror(page);
else
__set_page_dirty_nobuffers(page);
-
+out:
dprintk("NFS: nfs_updatepage returns %d (isize %lld)\n",
status, (long long)i_size_read(inode));
return status;
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 30/46] balloon: check the number of available pages in leak balloon
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (6 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 20/46] nfs: dont create zero-length requests Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 31/46] ftrace/recordmcount: Work around for addition of metag magic but not relocations Greg Kroah-Hartman
` (17 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Konstantin Neumoin, Denis V. Lunev,
Michael S. Tsirkin
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Neumoin <kneumoin@virtuozzo.com>
commit 37cf99e08c6fb4dcea0f9ad2b13b6daa8c76a711 upstream.
The balloon has a special mechanism that is subscribed to the oom
notification which leads to deflation for a fixed number of pages.
The number is always fixed even when the balloon is fully deflated.
But leak_balloon did not expect that the pages to deflate will be more
than taken, and raise a "BUG" in balloon_page_dequeue when page list
will be empty.
So, the simplest solution would be to check that the number of releases
pages is less or equal to the number taken pages.
Signed-off-by: Konstantin Neumoin <kneumoin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/virtio/virtio_balloon.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -178,6 +178,8 @@ static void leak_balloon(struct virtio_b
num = min(num, ARRAY_SIZE(vb->pfns));
mutex_lock(&vb->balloon_lock);
+ /* We can't release more pages than taken */
+ num = min(num, (size_t)vb->num_pages);
for (vb->num_pfns = 0; vb->num_pfns < num;
vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
page = balloon_page_dequeue(vb_dev_info);
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 31/46] ftrace/recordmcount: Work around for addition of metag magic but not relocations
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (7 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 30/46] balloon: check the number of available pages in leak balloon Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 32/46] metag: Fix __cmpxchg_u32 asm constraint for CMP Greg Kroah-Hartman
` (16 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, James Hogan, Ross Burton,
Laura Abbott, Steven Rostedt
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laura Abbott <labbott@redhat.com>
commit b2e1c26f0b62531636509fbcb6dab65617ed8331 upstream.
glibc recently did a sync up (94e73c95d9b5 "elf.h: Sync with the gabi
webpage") that added a #define for EM_METAG but did not add relocations
This triggers build errors:
scripts/recordmcount.c: In function 'do_file':
scripts/recordmcount.c:466:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
case EM_METAG: reltype = R_METAG_ADDR32;
^~~~~~~~~~~~~~
scripts/recordmcount.c:466:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/recordmcount.c:468:20: error: 'R_METAG_NONE' undeclared (first use in this function)
rel_type_nop = R_METAG_NONE;
^~~~~~~~~~~~
Work around this change with some more #ifdefery for the relocations.
Fedora Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1354034
Link: http://lkml.kernel.org/r/1468005530-14757-1-git-send-email-labbott@redhat.com
Cc: James Hogan <james.hogan@imgtec.com>
Fixes: 00512bdd4573 ("metag: ftrace support")
Reported-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
scripts/recordmcount.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,10 +33,17 @@
#include <string.h>
#include <unistd.h>
+/*
+ * glibc synced up and added the metag number but didn't add the relocations.
+ * Work around this in a crude manner for now.
+ */
#ifndef EM_METAG
-/* Remove this when these make it to the standard system elf.h. */
#define EM_METAG 174
+#endif
+#ifndef R_METAG_ADDR32
#define R_METAG_ADDR32 2
+#endif
+#ifndef R_METAG_NONE
#define R_METAG_NONE 3
#endif
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 32/46] metag: Fix __cmpxchg_u32 asm constraint for CMP
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (8 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 31/46] ftrace/recordmcount: Work around for addition of metag magic but not relocations Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 33/46] IB/mlx5: Fix MODIFY_QP command input structure Greg Kroah-Hartman
` (15 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, James Hogan, linux-metag
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hogan <james.hogan@imgtec.com>
commit 6154c187b97ee7513046bb4eb317a89f738f13ef upstream.
The LNKGET based atomic sequence in __cmpxchg_u32 has slightly incorrect
constraints for the return value which under certain circumstances can
allow an address unit register to be used as the first operand of a CMP
instruction. This isn't a valid instruction however as the encodings
only allow a data unit to be specified. This would result in an
assembler error like the following:
Error: failed to assemble instruction: "CMP A0.2,D0Ar6"
Fix by changing the constraint from "=&da" (assigned, early clobbered,
data or address unit register) to "=&d" (data unit register only).
The constraint for the second operand, "bd" (an op2 register where op1
is a data unit register and the instruction supports O2R) is already
correct assuming the first operand is a data unit register.
Other cases of CMP in inline asm have had their constraints checked, and
appear to all be fine.
Fixes: 6006c0d8ce94 ("metag: Atomics, locks and bitops")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/metag/include/asm/cmpxchg_lnkget.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/metag/include/asm/cmpxchg_lnkget.h
+++ b/arch/metag/include/asm/cmpxchg_lnkget.h
@@ -73,7 +73,7 @@ static inline unsigned long __cmpxchg_u3
" DCACHE [%2], %0\n"
#endif
"2:\n"
- : "=&d" (temp), "=&da" (retval)
+ : "=&d" (temp), "=&d" (retval)
: "da" (m), "bd" (old), "da" (new)
: "cc"
);
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 33/46] IB/mlx5: Fix MODIFY_QP command input structure
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (9 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 32/46] metag: Fix __cmpxchg_u32 asm constraint for CMP Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 34/46] IB/mlx5: Fix returned values of query QP Greg Kroah-Hartman
` (14 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Artemy Kovalyov, Leon Romanovsky,
Doug Ledford
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artemy Kovalyov <artemyko@mellanox.com>
commit e3353c268b06236d6c40fa1714c114f21f44451c upstream.
Make MODIFY_QP command input structure compliant to specification
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/mlx5/qp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -378,9 +378,9 @@ struct mlx5_destroy_qp_mbox_out {
struct mlx5_modify_qp_mbox_in {
struct mlx5_inbox_hdr hdr;
__be32 qpn;
- u8 rsvd1[4];
- __be32 optparam;
u8 rsvd0[4];
+ __be32 optparam;
+ u8 rsvd1[4];
struct mlx5_qp_context ctx;
};
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 34/46] IB/mlx5: Fix returned values of query QP
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (10 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 33/46] IB/mlx5: Fix MODIFY_QP command input structure Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 35/46] IB/mlx5: Fix post send fence logic Greg Kroah-Hartman
` (13 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Noa Osherovich, Leon Romanovsky,
Sagi Grimberg, Doug Ledford
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Noa Osherovich <noaos@mellanox.com>
commit 0540d8148d419bf769e5aa99c77027febd8922f0 upstream.
Some variables were not initialized properly: max_recv_wr,
max_recv_sge, max_send_wr, qp_context and max_inline_data.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB...')
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx5/qp.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -169,6 +169,8 @@ static int set_rq_size(struct mlx5_ib_de
qp->rq.max_gs = 0;
qp->rq.wqe_cnt = 0;
qp->rq.wqe_shift = 0;
+ cap->max_recv_wr = 0;
+ cap->max_recv_sge = 0;
} else {
if (ucmd) {
qp->rq.wqe_cnt = ucmd->rq_wqe_count;
@@ -2503,17 +2505,19 @@ int mlx5_ib_query_qp(struct ib_qp *ibqp,
qp_attr->cap.max_recv_sge = qp->rq.max_gs;
if (!ibqp->uobject) {
- qp_attr->cap.max_send_wr = qp->sq.wqe_cnt;
+ qp_attr->cap.max_send_wr = qp->sq.max_post;
qp_attr->cap.max_send_sge = qp->sq.max_gs;
+ qp_init_attr->qp_context = ibqp->qp_context;
} else {
qp_attr->cap.max_send_wr = 0;
qp_attr->cap.max_send_sge = 0;
}
- /* We don't support inline sends for kernel QPs (yet), and we
- * don't know what userspace's value should be.
- */
- qp_attr->cap.max_inline_data = 0;
+ qp_init_attr->qp_type = ibqp->qp_type;
+ qp_init_attr->recv_cq = ibqp->recv_cq;
+ qp_init_attr->send_cq = ibqp->send_cq;
+ qp_init_attr->srq = ibqp->srq;
+ qp_attr->cap.max_inline_data = qp->max_inline_data;
qp_init_attr->cap = qp_attr->cap;
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 35/46] IB/mlx5: Fix post send fence logic
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (11 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 34/46] IB/mlx5: Fix returned values of query QP Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 36/46] IB/IPoIB: Dont update neigh validity for unresolved entries Greg Kroah-Hartman
` (12 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Eli Cohen, Leon Romanovsky,
Doug Ledford
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eli Cohen <eli@mellanox.com>
commit c9b254955b9f8814966f5dabd34c39d0e0a2b437 upstream.
If the caller specified IB_SEND_FENCE in the send flags of the work
request and no previous work request stated that the successive one
should be fenced, the work request would be executed without a fence.
This could result in RDMA read or atomic operations failure due to a MR
being invalidated. Fix this by adding the mlx5 enumeration for fencing
RDMA/atomic operations and fix the logic to apply this.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx5/qp.c | 7 ++++---
include/linux/mlx5/qp.h | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2037,10 +2037,11 @@ static u8 get_fence(u8 fence, struct ib_
return MLX5_FENCE_MODE_SMALL_AND_FENCE;
else
return fence;
-
- } else {
- return 0;
+ } else if (unlikely(wr->send_flags & IB_SEND_FENCE)) {
+ return MLX5_FENCE_MODE_FENCE;
}
+
+ return 0;
}
int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -137,6 +137,7 @@ enum {
enum {
MLX5_FENCE_MODE_NONE = 0 << 5,
MLX5_FENCE_MODE_INITIATOR_SMALL = 1 << 5,
+ MLX5_FENCE_MODE_FENCE = 2 << 5,
MLX5_FENCE_MODE_STRONG_ORDERING = 3 << 5,
MLX5_FENCE_MODE_SMALL_AND_FENCE = 4 << 5,
};
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 36/46] IB/IPoIB: Dont update neigh validity for unresolved entries
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (12 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 35/46] IB/mlx5: Fix post send fence logic Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:54 ` [PATCH 3.14 37/46] IB/mlx4: Fix the SQ size of an RC QP Greg Kroah-Hartman
` (11 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Erez Shitrit, Leon Romanovsky,
Doug Ledford
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erez Shitrit <erezsh@mellanox.com>
commit 61c78eea9516a921799c17b4c20558e2aa780fd3 upstream.
ipoib_neigh_get unconditionally updates the "alive" variable member on
any packet send. This prevents the neighbor garbage collection from
cleaning out a dead neighbor entry if we are still queueing packets
for it. If the queue for this neighbor is full, then don't update the
alive timestamp. That way the neighbor can time out even if packets
are still being queued as long as none of them are being sent.
Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup in xmit path")
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -884,7 +884,9 @@ struct ipoib_neigh *ipoib_neigh_get(stru
neigh = NULL;
goto out_unlock;
}
- neigh->alive = jiffies;
+
+ if (likely(skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE))
+ neigh->alive = jiffies;
goto out_unlock;
}
}
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 37/46] IB/mlx4: Fix the SQ size of an RC QP
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (13 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 36/46] IB/IPoIB: Dont update neigh validity for unresolved entries Greg Kroah-Hartman
@ 2016-08-18 13:54 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 38/46] ubi: Make volume resize power cut aware Greg Kroah-Hartman
` (10 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:54 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Yishai Hadas, Jack Morgenstein,
Eran Ben Elisha, Leon Romanovsky, Doug Ledford
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@mellanox.com>
commit f2940e2c76bb554a7fbdd28ca5b90904117a9e96 upstream.
When calculating the required size of an RC QP send queue, leave
enough space for masked atomic operations, which require more space than
"regular" atomic operation.
Fixes: 6fa8f719844b ("IB/mlx4: Add support for masked atomic operations")
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Jack Morgenstein <jackm@mellanox.co.il>
Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx4/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -361,7 +361,7 @@ static int send_wqe_overhead(enum mlx4_i
sizeof (struct mlx4_wqe_raddr_seg);
case MLX4_IB_QPT_RC:
return sizeof (struct mlx4_wqe_ctrl_seg) +
- sizeof (struct mlx4_wqe_atomic_seg) +
+ sizeof (struct mlx4_wqe_masked_atomic_seg) +
sizeof (struct mlx4_wqe_raddr_seg);
case MLX4_IB_QPT_SMI:
case MLX4_IB_QPT_GSI:
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 38/46] ubi: Make volume resize power cut aware
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (14 preceding siblings ...)
2016-08-18 13:54 ` [PATCH 3.14 37/46] IB/mlx4: Fix the SQ size of an RC QP Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 39/46] ubi: Fix race condition between ubi device creation and udev Greg Kroah-Hartman
` (9 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Boris Brezillon, Richard Weinberger
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Weinberger <richard@nod.at>
commit 4946784bd3924b1374f05eebff2fd68660bae866 upstream.
When the volume resize operation shrinks a volume,
LEBs will be unmapped. Since unmapping will not erase these
LEBs immediately we have to wait for that operation to finish.
Otherwise in case of a power cut right after writing the new
volume table the UBI attach process can find more LEBs than the
volume table knows. This will render the UBI image unattachable.
Fix this issue by waiting for erase to complete and write the new
volume table afterward.
Reported-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/ubi/vmt.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -534,13 +534,6 @@ int ubi_resize_volume(struct ubi_volume_
spin_unlock(&ubi->volumes_lock);
}
- /* Change volume table record */
- vtbl_rec = ubi->vtbl[vol_id];
- vtbl_rec.reserved_pebs = cpu_to_be32(reserved_pebs);
- err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec);
- if (err)
- goto out_acc;
-
if (pebs < 0) {
for (i = 0; i < -pebs; i++) {
err = ubi_eba_unmap_leb(ubi, vol, reserved_pebs + i);
@@ -558,6 +551,24 @@ int ubi_resize_volume(struct ubi_volume_
spin_unlock(&ubi->volumes_lock);
}
+ /*
+ * When we shrink a volume we have to flush all pending (erase) work.
+ * Otherwise it can happen that upon next attach UBI finds a LEB with
+ * lnum > highest_lnum and refuses to attach.
+ */
+ if (pebs < 0) {
+ err = ubi_wl_flush(ubi, vol_id, UBI_ALL);
+ if (err)
+ goto out_acc;
+ }
+
+ /* Change volume table record */
+ vtbl_rec = ubi->vtbl[vol_id];
+ vtbl_rec.reserved_pebs = cpu_to_be32(reserved_pebs);
+ err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec);
+ if (err)
+ goto out_acc;
+
vol->reserved_pebs = reserved_pebs;
if (vol->vol_type == UBI_DYNAMIC_VOLUME) {
vol->used_ebs = reserved_pebs;
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 39/46] ubi: Fix race condition between ubi device creation and udev
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (15 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 38/46] ubi: Make volume resize power cut aware Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 40/46] target: Fix race between iscsi-target connection shutdown + ABORT_TASK Greg Kroah-Hartman
` (8 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Iosif Harutyunov, Richard Weinberger
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iosif Harutyunov <iharutyunov@SonicWALL.com>
commit 714fb87e8bc05ff78255afc0dca981e8c5242785 upstream.
Install the UBI device object before we arm sysfs.
Otherwise udev tries to read sysfs attributes before UBI is ready and
udev rules will not match.
Signed-off-by: Iosif Harutyunov <iharutyunov@sonicwall.com>
[rw: massaged commit message]
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/ubi/build.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -999,6 +999,9 @@ int ubi_attach_mtd_dev(struct mtd_info *
goto out_detach;
}
+ /* Make device "available" before it becomes accessible via sysfs */
+ ubi_devices[ubi_num] = ubi;
+
err = uif_init(ubi, &ref);
if (err)
goto out_detach;
@@ -1043,7 +1046,6 @@ int ubi_attach_mtd_dev(struct mtd_info *
wake_up_process(ubi->bgt_thread);
spin_unlock(&ubi->wl_lock);
- ubi_devices[ubi_num] = ubi;
ubi_notify_all(ubi, UBI_VOLUME_ADDED, NULL);
return ubi_num;
@@ -1054,6 +1056,7 @@ out_uif:
ubi_assert(ref);
uif_close(ubi);
out_detach:
+ ubi_devices[ubi_num] = NULL;
ubi_wl_close(ubi);
ubi_free_internal_volumes(ubi);
vfree(ubi->vtbl);
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 40/46] target: Fix race between iscsi-target connection shutdown + ABORT_TASK
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (16 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 39/46] ubi: Fix race condition between ubi device creation and udev Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 41/46] target: Fix max_unmap_lba_count calc overflow Greg Kroah-Hartman
` (7 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mike Christie, Quinn Tran,
Himanshu Madhani, Christoph Hellwig, Hannes Reinecke,
Nicholas Bellinger
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit 064cdd2d91c2805d788876082f31cc63506f22c3 upstream.
This patch fixes a race in iscsit_release_commands_from_conn() ->
iscsit_free_cmd() -> transport_generic_free_cmd() + wait_for_tasks=1,
where CMD_T_FABRIC_STOP could end up being set after the final
kref_put() is called from core_tmr_abort_task() context.
This results in transport_generic_free_cmd() blocking indefinately
on se_cmd->cmd_wait_comp, because the target_release_cmd_kref()
check for CMD_T_FABRIC_STOP returns false.
To address this bug, make iscsit_release_commands_from_conn()
do list_splice and set CMD_T_FABRIC_STOP early while holding
iscsi_conn->cmd_lock. Also make iscsit_aborted_task() only
remove iscsi_cmd_t if CMD_T_FABRIC_STOP has not already been
set.
Finally in target_release_cmd_kref(), only honor fabric_stop
if CMD_T_ABORTED has been set.
Cc: Mike Christie <mchristi@redhat.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Tested-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/target/iscsi/iscsi_target.c | 22 ++++++++++++++++------
drivers/target/target_core_transport.c | 3 ++-
2 files changed, 18 insertions(+), 7 deletions(-)
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -505,7 +505,8 @@ static void iscsit_aborted_task(struct i
bool scsi_cmd = (cmd->iscsi_opcode == ISCSI_OP_SCSI_CMD);
spin_lock_bh(&conn->cmd_lock);
- if (!list_empty(&cmd->i_conn_node))
+ if (!list_empty(&cmd->i_conn_node) &&
+ !(cmd->se_cmd.transport_state & CMD_T_FABRIC_STOP))
list_del_init(&cmd->i_conn_node);
spin_unlock_bh(&conn->cmd_lock);
@@ -4160,6 +4161,7 @@ transport_err:
static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
{
+ LIST_HEAD(tmp_list);
struct iscsi_cmd *cmd = NULL, *cmd_tmp = NULL;
struct iscsi_session *sess = conn->sess;
/*
@@ -4168,18 +4170,26 @@ static void iscsit_release_commands_from
* has been reset -> returned sleeping pre-handler state.
*/
spin_lock_bh(&conn->cmd_lock);
- list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_conn_node) {
+ list_splice_init(&conn->conn_cmd_list, &tmp_list);
+ list_for_each_entry(cmd, &tmp_list, i_conn_node) {
+ struct se_cmd *se_cmd = &cmd->se_cmd;
+
+ if (se_cmd->se_tfo != NULL) {
+ spin_lock(&se_cmd->t_state_lock);
+ se_cmd->transport_state |= CMD_T_FABRIC_STOP;
+ spin_unlock(&se_cmd->t_state_lock);
+ }
+ }
+ spin_unlock_bh(&conn->cmd_lock);
+
+ list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) {
list_del_init(&cmd->i_conn_node);
- spin_unlock_bh(&conn->cmd_lock);
iscsit_increment_maxcmdsn(cmd, sess);
-
iscsit_free_cmd(cmd, true);
- spin_lock_bh(&conn->cmd_lock);
}
- spin_unlock_bh(&conn->cmd_lock);
}
static void iscsit_stop_timers_for_cmds(
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2407,7 +2407,8 @@ static void target_release_cmd_kref(stru
}
spin_lock(&se_cmd->t_state_lock);
- fabric_stop = (se_cmd->transport_state & CMD_T_FABRIC_STOP);
+ fabric_stop = (se_cmd->transport_state & CMD_T_FABRIC_STOP) &&
+ (se_cmd->transport_state & CMD_T_ABORTED);
spin_unlock(&se_cmd->t_state_lock);
if (se_cmd->cmd_wait_set || fabric_stop) {
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 41/46] target: Fix max_unmap_lba_count calc overflow
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (17 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 40/46] target: Fix race between iscsi-target connection shutdown + ABORT_TASK Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 42/46] Input: i8042 - break load dependency between atkbd/psmouse and i8042 Greg Kroah-Hartman
` (6 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, Mike Christie, Bart Van Assche,
Nicholas Bellinger
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <mchristi@redhat.com>
commit ea263c7fada4af8ec7fe5fcfd6e7d7705a89351b upstream.
max_discard_sectors only 32bits, and some non scsi backend
devices will set this to the max 0xffffffff, so we can end up
overflowing during the max_unmap_lba_count calculation.
This fixes a regression caused by my patch:
commit 8a9ebe717a133ba7bc90b06047f43cc6b8bcb8b3
Author: Mike Christie <mchristi@redhat.com>
Date: Mon Jan 18 14:09:27 2016 -0600
target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors
which can result in extra discards being sent to due the overflow
causing max_unmap_lba_count to be smaller than what the backing
device can actually support.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/target/target_core_device.c | 8 +++++---
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
include/target/target_core_backend.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -1583,13 +1583,15 @@ struct se_device *target_alloc_device(st
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q, int block_size)
+ struct request_queue *q)
{
+ int block_size = queue_logical_block_size(q);
+
if (!blk_queue_discard(q))
return false;
- attrib->max_unmap_lba_count = (q->limits.max_discard_sectors << 9) /
- block_size;
+ attrib->max_unmap_lba_count =
+ q->limits.max_discard_sectors >> (ilog2(block_size) - 9);
/*
* Currently hardcoded to 1 in Linux/SCSI code..
*/
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -165,8 +165,7 @@ static int fd_configure_device(struct se
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q,
- fd_dev->fd_block_size))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -126,8 +126,7 @@ static int iblock_configure_device(struc
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q,
- dev->dev_attrib.hw_block_size))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -96,6 +96,6 @@ void array_free(void *array, int n);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q, int block_size);
+ struct request_queue *q);
#endif /* TARGET_CORE_BACKEND_H */
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 42/46] Input: i8042 - break load dependency between atkbd/psmouse and i8042
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (18 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 41/46] target: Fix max_unmap_lba_count calc overflow Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 43/46] PCI: Mark Atheros AR9485 and QCA9882 to avoid bus reset Greg Kroah-Hartman
` (5 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Mark Laws, Dmitry Torokhov
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
commit 4097461897df91041382ff6fcd2bfa7ee6b2448c upstream.
As explained in 1407814240-4275-1-git-send-email-decui@microsoft.com we
have a hard load dependency between i8042 and atkbd which prevents
keyboard from working on Gen2 Hyper-V VMs.
> hyperv_keyboard invokes serio_interrupt(), which needs a valid serio
> driver like atkbd.c. atkbd.c depends on libps2.c because it invokes
> ps2_command(). libps2.c depends on i8042.c because it invokes
> i8042_check_port_owner(). As a result, hyperv_keyboard actually
> depends on i8042.c.
>
> For a Generation 2 Hyper-V VM (meaning no i8042 device emulated), if a
> Linux VM (like Arch Linux) happens to configure CONFIG_SERIO_I8042=m
> rather than =y, atkbd.ko can't load because i8042.ko can't load(due to
> no i8042 device emulated) and finally hyperv_keyboard can't work and
> the user can't input: https://bugs.archlinux.org/task/39820
> (Ubuntu/RHEL/SUSE aren't affected since they use CONFIG_SERIO_I8042=y)
To break the dependency we move away from using i8042_check_port_owner()
and instead allow serio port owner specify a mutex that clients should use
to serialize PS/2 command stream.
Reported-by: Mark Laws <mdl@60hz.org>
Tested-by: Mark Laws <mdl@60hz.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/serio/i8042.c | 16 +---------------
drivers/input/serio/libps2.c | 10 ++++------
include/linux/i8042.h | 6 ------
include/linux/serio.h | 24 +++++++++++++++++++-----
4 files changed, 24 insertions(+), 32 deletions(-)
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1230,6 +1230,7 @@ static int __init i8042_create_kbd_port(
serio->start = i8042_start;
serio->stop = i8042_stop;
serio->close = i8042_port_close;
+ serio->ps2_cmd_mutex = &i8042_mutex;
serio->port_data = port;
serio->dev.parent = &i8042_platform_device->dev;
strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name));
@@ -1321,21 +1322,6 @@ static void i8042_unregister_ports(void)
}
}
-/*
- * Checks whether port belongs to i8042 controller.
- */
-bool i8042_check_port_owner(const struct serio *port)
-{
- int i;
-
- for (i = 0; i < I8042_NUM_PORTS; i++)
- if (i8042_ports[i].serio == port)
- return true;
-
- return false;
-}
-EXPORT_SYMBOL(i8042_check_port_owner);
-
static void i8042_free_irqs(void)
{
if (i8042_aux_irq_registered)
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -56,19 +56,17 @@ EXPORT_SYMBOL(ps2_sendbyte);
void ps2_begin_command(struct ps2dev *ps2dev)
{
- mutex_lock(&ps2dev->cmd_mutex);
+ struct mutex *m = ps2dev->serio->ps2_cmd_mutex ?: &ps2dev->cmd_mutex;
- if (i8042_check_port_owner(ps2dev->serio))
- i8042_lock_chip();
+ mutex_lock(m);
}
EXPORT_SYMBOL(ps2_begin_command);
void ps2_end_command(struct ps2dev *ps2dev)
{
- if (i8042_check_port_owner(ps2dev->serio))
- i8042_unlock_chip();
+ struct mutex *m = ps2dev->serio->ps2_cmd_mutex ?: &ps2dev->cmd_mutex;
- mutex_unlock(&ps2dev->cmd_mutex);
+ mutex_unlock(m);
}
EXPORT_SYMBOL(ps2_end_command);
--- a/include/linux/i8042.h
+++ b/include/linux/i8042.h
@@ -62,7 +62,6 @@ struct serio;
void i8042_lock_chip(void);
void i8042_unlock_chip(void);
int i8042_command(unsigned char *param, int command);
-bool i8042_check_port_owner(const struct serio *);
int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
struct serio *serio));
int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
@@ -83,11 +82,6 @@ static inline int i8042_command(unsigned
return -ENODEV;
}
-static inline bool i8042_check_port_owner(const struct serio *serio)
-{
- return false;
-}
-
static inline int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
struct serio *serio))
{
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -29,7 +29,8 @@ struct serio {
struct serio_device_id id;
- spinlock_t lock; /* protects critical sections from port's interrupt handler */
+ /* Protects critical sections from port's interrupt handler */
+ spinlock_t lock;
int (*write)(struct serio *, unsigned char);
int (*open)(struct serio *);
@@ -38,16 +39,29 @@ struct serio {
void (*stop)(struct serio *);
struct serio *parent;
- struct list_head child_node; /* Entry in parent->children list */
+ /* Entry in parent->children list */
+ struct list_head child_node;
struct list_head children;
- unsigned int depth; /* level of nesting in serio hierarchy */
+ /* Level of nesting in serio hierarchy */
+ unsigned int depth;
- struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
- struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
+ /*
+ * serio->drv is accessed from interrupt handlers; when modifying
+ * caller should acquire serio->drv_mutex and serio->lock.
+ */
+ struct serio_driver *drv;
+ /* Protects serio->drv so attributes can pin current driver */
+ struct mutex drv_mutex;
struct device dev;
struct list_head node;
+
+ /*
+ * For use by PS/2 layer when several ports share hardware and
+ * may get indigestion when exposed to concurrent access (i8042).
+ */
+ struct mutex *ps2_cmd_mutex;
};
#define to_serio_port(d) container_of(d, struct serio, dev)
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 43/46] PCI: Mark Atheros AR9485 and QCA9882 to avoid bus reset
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (19 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 42/46] Input: i8042 - break load dependency between atkbd/psmouse and i8042 Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 44/46] dm flakey: error READ bios during the down_interval Greg Kroah-Hartman
` (4 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chris Blake, Bjorn Helgaas
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Blake <chrisrblake93@gmail.com>
commit 9ac0108c2bac3f1d0255f64fb89fc27e71131b24 upstream.
Similar to the AR93xx series, the AR94xx and the Qualcomm QCA988x also have
the same quirk for the Bus Reset.
Fixes: c3e59ee4e766 ("PCI: Mark Atheros AR93xx to avoid bus reset")
Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pci/quirks.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3017,13 +3017,15 @@ static void quirk_no_bus_reset(struct pc
}
/*
- * Atheros AR93xx chips do not behave after a bus reset. The device will
- * throw a Link Down error on AER-capable systems and regardless of AER,
- * config space of the device is never accessible again and typically
- * causes the system to hang or reset when access is attempted.
+ * Some Atheros AR9xxx and QCA988x chips do not behave after a bus reset.
+ * The device will throw a Link Down error on AER-capable systems and
+ * regardless of AER, config space of the device is never accessible again
+ * and typically causes the system to hang or reset when access is attempted.
* http://www.spinics.net/lists/linux-pci/msg34797.html
*/
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0032, quirk_no_bus_reset);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x003c, quirk_no_bus_reset);
static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
struct pci_fixup *end)
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 44/46] dm flakey: error READ bios during the down_interval
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (20 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 43/46] PCI: Mark Atheros AR9485 and QCA9882 to avoid bus reset Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 45/46] module: Invalidate signatures on force-loaded modules Greg Kroah-Hartman
` (3 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Akira Hayakawa, Mike Snitzer
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@redhat.com>
commit 99f3c90d0d85708e7401a81ce3314e50bf7f2819 upstream.
When the corrupt_bio_byte feature was introduced it caused READ bios to
no longer be errored with -EIO during the down_interval. This had to do
with the complexity of needing to submit READs if the corrupt_bio_byte
feature was used.
Fix it so READ bios are properly errored with -EIO; doing so early in
flakey_map() as long as there isn't a match for the corrupt_bio_byte
feature.
Fixes: a3998799fb4df ("dm flakey: add corrupt_bio_byte feature")
Reported-by: Akira Hayakawa <ruby.wktk@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-flakey.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
--- a/drivers/md/dm-flakey.c
+++ b/drivers/md/dm-flakey.c
@@ -287,10 +287,16 @@ static int flakey_map(struct dm_target *
pb->bio_submitted = true;
/*
- * Map reads as normal.
+ * Map reads as normal only if corrupt_bio_byte set.
*/
- if (bio_data_dir(bio) == READ)
- goto map_bio;
+ if (bio_data_dir(bio) == READ) {
+ /* If flags were specified, only corrupt those that match. */
+ if (fc->corrupt_bio_byte && (fc->corrupt_bio_rw == READ) &&
+ all_corrupt_bio_flags_match(bio, fc))
+ goto map_bio;
+ else
+ return -EIO;
+ }
/*
* Drop writes?
@@ -328,12 +334,13 @@ static int flakey_end_io(struct dm_targe
/*
* Corrupt successful READs while in down state.
- * If flags were specified, only corrupt those that match.
*/
- if (fc->corrupt_bio_byte && !error && pb->bio_submitted &&
- (bio_data_dir(bio) == READ) && (fc->corrupt_bio_rw == READ) &&
- all_corrupt_bio_flags_match(bio, fc))
- corrupt_bio_data(bio, fc);
+ if (!error && pb->bio_submitted && (bio_data_dir(bio) == READ)) {
+ if (fc->corrupt_bio_byte)
+ corrupt_bio_data(bio, fc);
+ else
+ return -EIO;
+ }
return error;
}
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 45/46] module: Invalidate signatures on force-loaded modules
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (21 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 44/46] dm flakey: error READ bios during the down_interval Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 13:55 ` [PATCH 3.14 46/46] Documentation/module-signing.txt: Note need for version info if reusing a key Greg Kroah-Hartman
` (2 subsequent siblings)
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ben Hutchings, Rusty Russell
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <ben@decadent.org.uk>
commit bca014caaa6130e57f69b5bf527967aa8ee70fdd upstream.
Signing a module should only make it trusted by the specific kernel it
was built for, not anything else. Loading a signed module meant for a
kernel with a different ABI could have interesting effects.
Therefore, treat all signatures as invalid when a module is
force-loaded.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/module.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2449,13 +2449,18 @@ static inline void kmemleak_load_module(
#endif
#ifdef CONFIG_MODULE_SIG
-static int module_sig_check(struct load_info *info)
+static int module_sig_check(struct load_info *info, int flags)
{
int err = -ENOKEY;
const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
const void *mod = info->hdr;
- if (info->len > markerlen &&
+ /*
+ * Require flags == 0, as a module with version information
+ * removed is no longer the module that was signed
+ */
+ if (flags == 0 &&
+ info->len > markerlen &&
memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) {
/* We truncate the module to discard the signature */
info->len -= markerlen;
@@ -2477,7 +2482,7 @@ static int module_sig_check(struct load_
return err;
}
#else /* !CONFIG_MODULE_SIG */
-static int module_sig_check(struct load_info *info)
+static int module_sig_check(struct load_info *info, int flags)
{
return 0;
}
@@ -3210,7 +3215,7 @@ static int load_module(struct load_info
struct module *mod;
long err;
- err = module_sig_check(info);
+ err = module_sig_check(info, flags);
if (err)
goto free_copy;
^ permalink raw reply [flat|nested] 30+ messages in thread* [PATCH 3.14 46/46] Documentation/module-signing.txt: Note need for version info if reusing a key
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (22 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 45/46] module: Invalidate signatures on force-loaded modules Greg Kroah-Hartman
@ 2016-08-18 13:55 ` Greg Kroah-Hartman
2016-08-18 20:05 ` [PATCH 3.14 00/46] 3.14.77-stable review Guenter Roeck
2016-08-18 21:34 ` Shuah Khan
25 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-18 13:55 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ben Hutchings, Rusty Russell
3.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <ben@decadent.org.uk>
commit b8612e517c3c9809e1200b72c474dbfd969e5a83 upstream.
Signing a module should only make it trusted by the specific kernel it
was built for, not anything else. If a module signing key is used for
multiple ABI-incompatible kernels, the modules need to include enough
version information to distinguish them.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/module-signing.txt | 6 ++++++
1 file changed, 6 insertions(+)
--- a/Documentation/module-signing.txt
+++ b/Documentation/module-signing.txt
@@ -238,3 +238,9 @@ Since the private key is used to sign mo
the private key to sign modules and compromise the operating system. The
private key must be either destroyed or moved to a secure location and not kept
in the root node of the kernel source tree.
+
+If you use the same private key to sign modules for multiple kernel
+configurations, you must ensure that the module version information is
+sufficient to prevent loading a module into a different kernel. Either
+set CONFIG_MODVERSIONS=y or ensure that each configuration has a different
+kernel release string by changing EXTRAVERSION or CONFIG_LOCALVERSION.
^ permalink raw reply [flat|nested] 30+ messages in thread* Re: [PATCH 3.14 00/46] 3.14.77-stable review
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (23 preceding siblings ...)
2016-08-18 13:55 ` [PATCH 3.14 46/46] Documentation/module-signing.txt: Note need for version info if reusing a key Greg Kroah-Hartman
@ 2016-08-18 20:05 ` Guenter Roeck
2016-08-19 7:38 ` Greg Kroah-Hartman
2016-08-18 21:34 ` Shuah Khan
25 siblings, 1 reply; 30+ messages in thread
From: Guenter Roeck @ 2016-08-18 20:05 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, torvalds, akpm, shuah.kh, patches, stable
On Thu, Aug 18, 2016 at 03:54:22PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.14.77 release.
> There are 46 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 Sat Aug 20 13:54:21 UTC 2016.
> Anything received after that time might be too late.
>
Build results:
total: 131 pass: 129 fail: 2
Failed builds:
powerpc:defconfig
powerpc:allmodconfig
Qemu test results:
total: 89 pass: 88 fail: 1
Failed tests:
powerpc:pseries_defconfig
Build error:
arch/powerpc/kvm/built-in.o: In function `kvmppc_h_cede': (.text+0x1460):
undefined reference to `kvmppc_save_tm'
arch/powerpc/kvm/built-in.o: In function `kvm_end_cede':
arch/powerpc/kvm/book3s_hv_rmhandlers.o:(.text+0x14b8):
undefined reference to `kvmppc_restore_tm'
Caused by commit 5c2337847932 ("KVM: PPC: Book3S HV: Save/restore TM state
in H_CEDE").
Guenter
^ permalink raw reply [flat|nested] 30+ messages in thread* Re: [PATCH 3.14 00/46] 3.14.77-stable review
2016-08-18 20:05 ` [PATCH 3.14 00/46] 3.14.77-stable review Guenter Roeck
@ 2016-08-19 7:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 30+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-19 7:38 UTC (permalink / raw)
To: Guenter Roeck; +Cc: linux-kernel, torvalds, akpm, shuah.kh, patches, stable
On Thu, Aug 18, 2016 at 01:05:48PM -0700, Guenter Roeck wrote:
> On Thu, Aug 18, 2016 at 03:54:22PM +0200, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 3.14.77 release.
> > There are 46 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 Sat Aug 20 13:54:21 UTC 2016.
> > Anything received after that time might be too late.
> >
>
> Build results:
> total: 131 pass: 129 fail: 2
> Failed builds:
> powerpc:defconfig
> powerpc:allmodconfig
>
> Qemu test results:
> total: 89 pass: 88 fail: 1
> Failed tests:
> powerpc:pseries_defconfig
>
> Build error:
>
> arch/powerpc/kvm/built-in.o: In function `kvmppc_h_cede': (.text+0x1460):
> undefined reference to `kvmppc_save_tm'
> arch/powerpc/kvm/built-in.o: In function `kvm_end_cede':
> arch/powerpc/kvm/book3s_hv_rmhandlers.o:(.text+0x14b8):
> undefined reference to `kvmppc_restore_tm'
>
> Caused by commit 5c2337847932 ("KVM: PPC: Book3S HV: Save/restore TM state
> in H_CEDE").
Argh, that was my fault, it shouldn't have been applied there.
Now removed, thanks for letting me know.
greg k-h
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 3.14 00/46] 3.14.77-stable review
2016-08-18 13:54 ` [PATCH 3.14 00/46] 3.14.77-stable review Greg Kroah-Hartman
` (24 preceding siblings ...)
2016-08-18 20:05 ` [PATCH 3.14 00/46] 3.14.77-stable review Guenter Roeck
@ 2016-08-18 21:34 ` Shuah Khan
25 siblings, 0 replies; 30+ messages in thread
From: Shuah Khan @ 2016-08-18 21:34 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-kernel
Cc: torvalds, akpm, linux, patches, stable, Shuah Khan
On 08/18/2016 07:54 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.14.77 release.
> There are 46 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 Sat Aug 20 13:54:21 UTC 2016.
> 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.14.77-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.14.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com
^ permalink raw reply [flat|nested] 30+ messages in thread