Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-20 12:43:24 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-20 12:43:24 +0100
commitaadd38f8a02da04e883d130da596ba35531922f9 (patch)
tree23078637f7d9a006f74036d5a9e67bb8b9324946
parentbd2d3e65bc2a99be44c1ebc5498f48f9f4623a73 (diff)
netrom: switch to sock timer API (bsc#1051510).
-rw-r--r--patches.fixes/netrom-switch-to-sock-timer-API.patch100
-rw-r--r--series.conf1
2 files changed, 101 insertions, 0 deletions
diff --git a/patches.fixes/netrom-switch-to-sock-timer-API.patch b/patches.fixes/netrom-switch-to-sock-timer-API.patch
new file mode 100644
index 0000000000..a79a660511
--- /dev/null
+++ b/patches.fixes/netrom-switch-to-sock-timer-API.patch
@@ -0,0 +1,100 @@
+From 63346650c1a94a92be61a57416ac88c0a47c4327 Mon Sep 17 00:00:00 2001
+From: Cong Wang <xiyou.wangcong@gmail.com>
+Date: Thu, 24 Jan 2019 14:18:18 -0800
+Subject: [PATCH] netrom: switch to sock timer API
+Git-commit: 63346650c1a94a92be61a57416ac88c0a47c4327
+Patch-mainline: v5.0-rc5
+References: bsc#1051510
+
+sk_reset_timer() and sk_stop_timer() properly handle
+sock refcnt for timer function. Switching to them
+could fix a refcounting bug reported by syzbot.
+
+Reported-and-tested-by: syzbot+defa700d16f1bd1b9a05@syzkaller.appspotmail.com
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Cc: linux-hams@vger.kernel.org
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ net/netrom/nr_timer.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
+index cbd51ed5a2d7..908e53ab47a4 100644
+--- a/net/netrom/nr_timer.c
++++ b/net/netrom/nr_timer.c
+@@ -52,21 +52,21 @@ void nr_start_t1timer(struct sock *sk)
+ {
+ struct nr_sock *nr = nr_sk(sk);
+
+- mod_timer(&nr->t1timer, jiffies + nr->t1);
++ sk_reset_timer(sk, &nr->t1timer, jiffies + nr->t1);
+ }
+
+ void nr_start_t2timer(struct sock *sk)
+ {
+ struct nr_sock *nr = nr_sk(sk);
+
+- mod_timer(&nr->t2timer, jiffies + nr->t2);
++ sk_reset_timer(sk, &nr->t2timer, jiffies + nr->t2);
+ }
+
+ void nr_start_t4timer(struct sock *sk)
+ {
+ struct nr_sock *nr = nr_sk(sk);
+
+- mod_timer(&nr->t4timer, jiffies + nr->t4);
++ sk_reset_timer(sk, &nr->t4timer, jiffies + nr->t4);
+ }
+
+ void nr_start_idletimer(struct sock *sk)
+@@ -74,37 +74,37 @@ void nr_start_idletimer(struct sock *sk)
+ struct nr_sock *nr = nr_sk(sk);
+
+ if (nr->idle > 0)
+- mod_timer(&nr->idletimer, jiffies + nr->idle);
++ sk_reset_timer(sk, &nr->idletimer, jiffies + nr->idle);
+ }
+
+ void nr_start_heartbeat(struct sock *sk)
+ {
+- mod_timer(&sk->sk_timer, jiffies + 5 * HZ);
++ sk_reset_timer(sk, &sk->sk_timer, jiffies + 5 * HZ);
+ }
+
+ void nr_stop_t1timer(struct sock *sk)
+ {
+- del_timer(&nr_sk(sk)->t1timer);
++ sk_stop_timer(sk, &nr_sk(sk)->t1timer);
+ }
+
+ void nr_stop_t2timer(struct sock *sk)
+ {
+- del_timer(&nr_sk(sk)->t2timer);
++ sk_stop_timer(sk, &nr_sk(sk)->t2timer);
+ }
+
+ void nr_stop_t4timer(struct sock *sk)
+ {
+- del_timer(&nr_sk(sk)->t4timer);
++ sk_stop_timer(sk, &nr_sk(sk)->t4timer);
+ }
+
+ void nr_stop_idletimer(struct sock *sk)
+ {
+- del_timer(&nr_sk(sk)->idletimer);
++ sk_stop_timer(sk, &nr_sk(sk)->idletimer);
+ }
+
+ void nr_stop_heartbeat(struct sock *sk)
+ {
+- del_timer(&sk->sk_timer);
++ sk_stop_timer(sk, &sk->sk_timer);
+ }
+
+ int nr_t1timer_running(struct sock *sk)
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index df413cd4f3..396d99fba8 100644
--- a/series.conf
+++ b/series.conf
@@ -20313,6 +20313,7 @@
patches.fixes/acpi-nfit-Fix-command-supported-detection.patch
patches.fixes/irqchip-gic-v3-its-Align-PCI-Multi-MSI-allocation-on.patch
patches.suse/sched-wait-Fix-rcuwait_wake_up-ordering.patch
+ patches.fixes/netrom-switch-to-sock-timer-API.patch
patches.drivers/gpio-pcf857x-Fix-interrupts-on-multiple-instances.patch
patches.drivers/gpio-altera-a10sr-Set-proper-output-level-for-direct.patch
patches.drivers/gpio-vf610-Mask-all-GPIO-interrupts.patch