From 2b32b864c6b802c4c48ce1d1308af6eb6f80fa95 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 24 Jan 2016 13:40:25 -0800 Subject: [PATCH] 3.10-stable patches added patches: af_unix-fix-incorrect-revert-of-lock_interruptible-in-stream.patch --- ...vert-of-lock_interruptible-in-stream.patch | 55 +++++++++++++++++++ queue-3.10/series | 1 + 2 files changed, 56 insertions(+) create mode 100644 queue-3.10/af_unix-fix-incorrect-revert-of-lock_interruptible-in-stream.patch create mode 100644 queue-3.10/series diff --git a/queue-3.10/af_unix-fix-incorrect-revert-of-lock_interruptible-in-stream.patch b/queue-3.10/af_unix-fix-incorrect-revert-of-lock_interruptible-in-stream.patch new file mode 100644 index 00000000000..649e13fac98 --- /dev/null +++ b/queue-3.10/af_unix-fix-incorrect-revert-of-lock_interruptible-in-stream.patch @@ -0,0 +1,55 @@ +From 77f6e82adf349cbccf7e2ec7601b25c994e0b483 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Sun, 24 Jan 2016 09:19:57 +0100 +Subject: af_unix: fix incorrect revert of 'lock_interruptible' in stream receive code + +From: Willy Tarreau + +As reported by Sultan Qasim, commit 3822b5c ("af_unix: Revert +'lock_interruptible' in stream receive code") was accidently applied +at the wrong place in the backport that appeared in 3.10.95, it +affected unix_dgram_recvmsg() instead of unix_stream_recvmsg() due +to now similar code sections there. The dgram part needs to remain +but the stream part needs to be removed. + +Reported-By: Sultan Qasim +Fixes: 3a57e78 (3.10.95) +Signed-off-by: Willy Tarreau +--- + net/unix/af_unix.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/net/unix/af_unix.c ++++ b/net/unix/af_unix.c +@@ -1934,7 +1934,14 @@ static int unix_dgram_recvmsg(struct kio + if (flags&MSG_OOB) + goto out; + +- mutex_lock(&u->readlock); ++ err = mutex_lock_interruptible(&u->readlock); ++ if (unlikely(err)) { ++ /* recvmsg() in non blocking mode is supposed to return -EAGAIN ++ * sk_rcvtimeo is not honored by mutex_lock_interruptible() ++ */ ++ err = noblock ? -EAGAIN : -ERESTARTSYS; ++ goto out; ++ } + + skip = sk_peek_offset(sk, flags); + +@@ -2083,14 +2090,7 @@ static int unix_stream_recvmsg(struct ki + memset(&tmp_scm, 0, sizeof(tmp_scm)); + } + +- err = mutex_lock_interruptible(&u->readlock); +- if (unlikely(err)) { +- /* recvmsg() in non blocking mode is supposed to return -EAGAIN +- * sk_rcvtimeo is not honored by mutex_lock_interruptible() +- */ +- err = noblock ? -EAGAIN : -ERESTARTSYS; +- goto out; +- } ++ mutex_lock(&u->readlock); + + do { + int chunk; diff --git a/queue-3.10/series b/queue-3.10/series new file mode 100644 index 00000000000..f18a4ab2ff9 --- /dev/null +++ b/queue-3.10/series @@ -0,0 +1 @@ +af_unix-fix-incorrect-revert-of-lock_interruptible-in-stream.patch -- 2.47.3