Contents of /trunk/kernel-magellan/patches-4.13/0106-4.13.7-all-fixes.patch
Parent Directory | Revision Log
Revision 3010 -
(show annotations)
(download)
Wed Oct 25 09:41:40 2017 UTC (6 years, 11 months ago) by niro
File size: 3381 byte(s)
Wed Oct 25 09:41:40 2017 UTC (6 years, 11 months ago) by niro
File size: 3381 byte(s)
-linux-4.13.7
1 | diff --git a/Documentation/watchdog/watchdog-parameters.txt b/Documentation/watchdog/watchdog-parameters.txt |
2 | index b3526365ea8e..6f9d7b418917 100644 |
3 | --- a/Documentation/watchdog/watchdog-parameters.txt |
4 | +++ b/Documentation/watchdog/watchdog-parameters.txt |
5 | @@ -117,7 +117,7 @@ nowayout: Watchdog cannot be stopped once started |
6 | ------------------------------------------------- |
7 | iTCO_wdt: |
8 | heartbeat: Watchdog heartbeat in seconds. |
9 | - (5<=heartbeat<=74 (TCO v1) or 1226 (TCO v2), default=30) |
10 | + (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30) |
11 | nowayout: Watchdog cannot be stopped once started |
12 | (default=kernel config parameter) |
13 | ------------------------------------------------- |
14 | diff --git a/Makefile b/Makefile |
15 | index 9e1af1af327b..0d4f1b19869d 100644 |
16 | --- a/Makefile |
17 | +++ b/Makefile |
18 | @@ -1,6 +1,6 @@ |
19 | VERSION = 4 |
20 | PATCHLEVEL = 13 |
21 | -SUBLEVEL = 6 |
22 | +SUBLEVEL = 7 |
23 | EXTRAVERSION = |
24 | NAME = Fearless Coyote |
25 | |
26 | diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c |
27 | index c4f65873bfa4..347f0389b089 100644 |
28 | --- a/drivers/watchdog/iTCO_wdt.c |
29 | +++ b/drivers/watchdog/iTCO_wdt.c |
30 | @@ -306,15 +306,16 @@ static int iTCO_wdt_ping(struct watchdog_device *wd_dev) |
31 | |
32 | iTCO_vendor_pre_keepalive(p->smi_res, wd_dev->timeout); |
33 | |
34 | - /* Reset the timeout status bit so that the timer |
35 | - * needs to count down twice again before rebooting */ |
36 | - outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */ |
37 | - |
38 | /* Reload the timer by writing to the TCO Timer Counter register */ |
39 | - if (p->iTCO_version >= 2) |
40 | + if (p->iTCO_version >= 2) { |
41 | outw(0x01, TCO_RLD(p)); |
42 | - else if (p->iTCO_version == 1) |
43 | + } else if (p->iTCO_version == 1) { |
44 | + /* Reset the timeout status bit so that the timer |
45 | + * needs to count down twice again before rebooting */ |
46 | + outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */ |
47 | + |
48 | outb(0x01, TCO_RLD(p)); |
49 | + } |
50 | |
51 | spin_unlock(&p->io_lock); |
52 | return 0; |
53 | @@ -327,8 +328,11 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t) |
54 | unsigned char val8; |
55 | unsigned int tmrval; |
56 | |
57 | - /* The timer counts down twice before rebooting */ |
58 | - tmrval = seconds_to_ticks(p, t) / 2; |
59 | + tmrval = seconds_to_ticks(p, t); |
60 | + |
61 | + /* For TCO v1 the timer counts down twice before rebooting */ |
62 | + if (p->iTCO_version == 1) |
63 | + tmrval /= 2; |
64 | |
65 | /* from the specs: */ |
66 | /* "Values of 0h-3h are ignored and should not be attempted" */ |
67 | @@ -381,8 +385,6 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev) |
68 | spin_lock(&p->io_lock); |
69 | val16 = inw(TCO_RLD(p)); |
70 | val16 &= 0x3ff; |
71 | - if (!(inw(TCO1_STS(p)) & 0x0008)) |
72 | - val16 += (inw(TCOv2_TMR(p)) & 0x3ff); |
73 | spin_unlock(&p->io_lock); |
74 | |
75 | time_left = ticks_to_seconds(p, val16); |
76 | diff --git a/kernel/exit.c b/kernel/exit.c |
77 | index 6d31fc5ba50d..135b36985f8a 100644 |
78 | --- a/kernel/exit.c |
79 | +++ b/kernel/exit.c |
80 | @@ -1611,6 +1611,9 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, |
81 | if (!infop) |
82 | return err; |
83 | |
84 | + if (!access_ok(VERIFY_WRITE, infop, sizeof(*infop))) |
85 | + goto Efault; |
86 | + |
87 | user_access_begin(); |
88 | unsafe_put_user(signo, &infop->si_signo, Efault); |
89 | unsafe_put_user(0, &infop->si_errno, Efault); |
90 | @@ -1736,6 +1739,9 @@ COMPAT_SYSCALL_DEFINE5(waitid, |
91 | if (!infop) |
92 | return err; |
93 | |
94 | + if (!access_ok(VERIFY_WRITE, infop, sizeof(*infop))) |
95 | + goto Efault; |
96 | + |
97 | user_access_begin(); |
98 | unsafe_put_user(signo, &infop->si_signo, Efault); |
99 | unsafe_put_user(0, &infop->si_errno, Efault); |