1 |
commit: cb0333eb392976ebff5a7d56008620f7c0862790 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 2 12:08:15 2015 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 2 12:08:15 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=cb0333eb |
7 |
|
8 |
inet: Patch to fix potential deadlock in reqsk_queue_unlink() |
9 |
|
10 |
0000_README | 4 +++ |
11 |
2000_inet-deadlock-in-reqsk-queue-unlink-fix.patch | 32 ++++++++++++++++++++++ |
12 |
2 files changed, 36 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 46b8cb0..348e8f5 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -91,6 +91,10 @@ Patch: 1600_dm-crypt-limit-max-segment-size.patch |
19 |
From: https://bugzilla.kernel.org/show_bug.cgi?id=104421 |
20 |
Desc: dm crypt: constrain crypt device's max_segment_size to PAGE_SIZE. |
21 |
|
22 |
+Patch: 2000_inet-deadlock-in-reqsk-queue-unlink-fix.patch |
23 |
+From: http://git.kernel.org/ |
24 |
+Desc: inet: Patch to fix potential deadlock in reqsk_queue_unlink() |
25 |
+ |
26 |
Patch: 2700_ThinkPad-30-brightness-control-fix.patch |
27 |
From: Seth Forshee <seth.forshee@×××××××××.com> |
28 |
Desc: ACPI: Disable Windows 8 compatibility for some Lenovo ThinkPads. |
29 |
|
30 |
diff --git a/2000_inet-deadlock-in-reqsk-queue-unlink-fix.patch b/2000_inet-deadlock-in-reqsk-queue-unlink-fix.patch |
31 |
new file mode 100644 |
32 |
index 0000000..890f5e5 |
33 |
--- /dev/null |
34 |
+++ b/2000_inet-deadlock-in-reqsk-queue-unlink-fix.patch |
35 |
@@ -0,0 +1,32 @@ |
36 |
+From 83fccfc3940c4a2db90fd7e7079f5b465cd8c6af Mon Sep 17 00:00:00 2001 |
37 |
+From: Eric Dumazet <edumazet@××××××.com> |
38 |
+Date: Thu, 13 Aug 2015 15:44:51 -0700 |
39 |
+Subject: inet: fix potential deadlock in reqsk_queue_unlink() |
40 |
+ |
41 |
+When replacing del_timer() with del_timer_sync(), I introduced |
42 |
+a deadlock condition : |
43 |
+ |
44 |
+reqsk_queue_unlink() is called from inet_csk_reqsk_queue_drop() |
45 |
+ |
46 |
+inet_csk_reqsk_queue_drop() can be called from many contexts, |
47 |
+one being the timer handler itself (reqsk_timer_handler()). |
48 |
+ |
49 |
+In this case, del_timer_sync() loops forever. |
50 |
+ |
51 |
+Simple fix is to test if timer is pending. |
52 |
+ |
53 |
+Fixes: 2235f2ac75fd ("inet: fix races with reqsk timers") |
54 |
+Signed-off-by: Eric Dumazet <edumazet@××××××.com> |
55 |
+Signed-off-by: David S. Miller <davem@×××××××××.net> |
56 |
+ |
57 |
+--- a/net/ipv4/inet_connection_sock.c 2015-10-02 07:49:42.759957268 -0400 |
58 |
++++ b/net/ipv4/inet_connection_sock.c 2015-10-02 07:50:12.929957111 -0400 |
59 |
+@@ -584,7 +584,7 @@ static bool reqsk_queue_unlink(struct re |
60 |
+ } |
61 |
+ |
62 |
+ spin_unlock(&queue->syn_wait_lock); |
63 |
+- if (del_timer_sync(&req->rsk_timer)) |
64 |
++ if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer)) |
65 |
+ reqsk_put(req); |
66 |
+ return found; |
67 |
+ } |