Merge lp:~tj/ubuntu/trusty/alsa-utils/lp1269731 into lp:ubuntu/trusty/alsa-utils

Proposed by TJ on 2014-01-16
Status: Rejected
Rejected by: Luke Yelavich on 2014-01-16
Proposed branch: lp:~tj/ubuntu/trusty/alsa-utils/lp1269731
Merge into: lp:ubuntu/trusty/alsa-utils
Diff against target: 195 lines (+113/-3)
10 files modified
.pc/applied-patches (+1/-0)
.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-restore.upstart (+18/-0)
.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-state.upstart (+22/-0)
.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-store.upstart (+18/-0)
debian/alsa-restore.upstart (+1/-1)
debian/alsa-state.upstart (+1/-1)
debian/alsa-store.upstart (+1/-1)
debian/changelog (+7/-0)
debian/patches/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff (+43/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~tj/ubuntu/trusty/alsa-utils/lp1269731
Reviewer Review Type Date Requested Status
Ubuntu branches 2014-01-16 Pending
Review via email: mp+202014@code.launchpad.net

Description of the change

Critical fix for kernel panic in upstart init deamon caused by incorrect shell constructions in upstart conf files

To post a comment you must log in.
Luke Yelavich (themuso) :
Luke Yelavich (themuso) wrote :

Thanks for your work, however ou don't patch files in the debian directory. You edit them directly.

Secondly, as per the bug, the original shell code is syntactically correct, and I forgot to add an env declaration to the ALSACTLHOME variable, whichi I already have a fix for, and am about to upload.

Thanks again.

TJ (tj) wrote :

On 16/01/14 23:52, Luke Yelavich wrote:
> Thanks for your work, however ou don't patch files in the debian directory. You edit them directly.

Seems obviously now after a full nights sleep - when I identified the work-around I just wanted to tie it off and get some sleep and it looks like my brain had stopped working!
>
> Secondly, as per the bug, the original shell code is syntactically correct, and I forgot to add an env declaration to the ALSACTLHOME variable, whichi I already have a fix for, and am about to upload.
>
Right - we used a process of elimination and comparison to identify the syntax issue and the "if test..." construct wasn't being used in that form in any other init script.

Of course the prime cause is the lack of a guard around the pointer dereference in the upstart code, but that needs someone familiar with that code-base to deal with since there are other issues
around not failing-safe when it doesn't accept the syntax.

Unmerged revisions

95. By TJ on 2014-01-16

Fix kernel panic in init caused by incorrect shell constructs in upstart jobs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2013-07-26 10:56:44 +0000
3+++ .pc/applied-patches 2014-01-16 22:58:26 +0000
4@@ -3,3 +3,4 @@
5 unset_pulse_internal.patch
6 add_extra_volume_defaults.patch
7 vmware_audio_volume.patch
8+lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff
9
10=== added directory '.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff'
11=== added file '.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/.timestamp'
12=== added directory '.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian'
13=== added file '.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-restore.upstart'
14--- .pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-restore.upstart 1970-01-01 00:00:00 +0000
15+++ .pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-restore.upstart 2014-01-16 22:58:26 +0000
16@@ -0,0 +1,18 @@
17+# alsa-restore - restore sound card(s') mixer state(s)
18+#
19+# This task restores the sound card(s') mixer state(s) to
20+# /var/lib/alsa/asound.state on startup
21+
22+description "Restore Sound Card State"
23+
24+start on runlevel [2345]
25+
26+task
27+
28+pre-start script
29+ if test -f /var/lib/alsa/state-daemon.conf ; then
30+ stop; exit 0
31+ fi
32+end script
33+
34+exec /usr/sbin/alsactl restore
35
36=== added file '.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-state.upstart'
37--- .pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-state.upstart 1970-01-01 00:00:00 +0000
38+++ .pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-state.upstart 2014-01-16 22:58:26 +0000
39@@ -0,0 +1,22 @@
40+# alsa-state - Manage Sound Card State (restore and store)
41+#
42+# This task launches the alsactl daemon to manage sound
43+# card state (restore and store).
44+
45+description "Restore Sound Card State"
46+
47+start on runlevel [2345]
48+
49+expect fork
50+
51+pre-start script
52+ if ! test -f /var/lib/alsa/state-daemon.conf ; then
53+ stop; exit 0
54+ fi
55+end script
56+
57+exec /usr/sbin/alsactl -s -n 19 -b -c rdaemon
58+
59+pre-stop script
60+ /usr/sbin/alsactl -s kill save_and_quit
61+end script
62
63=== added file '.pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-store.upstart'
64--- .pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-store.upstart 1970-01-01 00:00:00 +0000
65+++ .pc/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff/debian/alsa-store.upstart 2014-01-16 22:58:26 +0000
66@@ -0,0 +1,18 @@
67+# alsa-store - Store sound card state
68+#
69+# This task saves the sound card(s') mixer state(s) to
70+# /var/lib/alsa/asound.state on reboot or shutdown
71+
72+description "Store Sound Card State"
73+
74+start on runlevel [!2345]
75+
76+task
77+
78+pre-start script
79+ if test -f /var/lib/alsa/state-daemon.conf ; then
80+ stop; exit 0
81+ fi
82+end script
83+
84+exec /usr/sbin/alsactl store
85
86=== modified file 'debian/alsa-restore.upstart'
87--- debian/alsa-restore.upstart 2013-07-26 10:56:44 +0000
88+++ debian/alsa-restore.upstart 2014-01-16 22:58:26 +0000
89@@ -10,7 +10,7 @@
90 task
91
92 pre-start script
93- if test -f /var/lib/alsa/state-daemon.conf ; then
94+ if [ -f /var/lib/alsa/state-daemon.conf ]; then
95 stop; exit 0
96 fi
97 end script
98
99=== modified file 'debian/alsa-state.upstart'
100--- debian/alsa-state.upstart 2013-07-26 10:56:44 +0000
101+++ debian/alsa-state.upstart 2014-01-16 22:58:26 +0000
102@@ -10,7 +10,7 @@
103 expect fork
104
105 pre-start script
106- if ! test -f /var/lib/alsa/state-daemon.conf ; then
107+ if [ ! -f /var/lib/alsa/state-daemon.conf ]; then
108 stop; exit 0
109 fi
110 end script
111
112=== modified file 'debian/alsa-store.upstart'
113--- debian/alsa-store.upstart 2013-07-26 10:56:44 +0000
114+++ debian/alsa-store.upstart 2014-01-16 22:58:26 +0000
115@@ -10,7 +10,7 @@
116 task
117
118 pre-start script
119- if test -f /var/lib/alsa/state-daemon.conf ; then
120+ if [ -f /var/lib/alsa/state-daemon.conf ]; then
121 stop; exit 0
122 fi
123 end script
124
125=== modified file 'debian/changelog'
126--- debian/changelog 2013-07-26 10:56:44 +0000
127+++ debian/changelog 2014-01-16 22:58:26 +0000
128@@ -1,3 +1,10 @@
129+alsa-utils (1.0.27.1-1ubuntu2) UNRELEASED; urgency=high
130+
131+ * Fix kernel panic in init caused by incorrect shell constructs in upstart
132+ jobs (LP: #1269731)
133+
134+ -- TJ <ubuntu@iam.tj> Thu, 16 Jan 2014 22:35:05 +0000
135+
136 alsa-utils (1.0.27.1-1ubuntu1) saucy; urgency=low
137
138 * Merge from debian unstable. Remaining changes:
139
140=== added file 'debian/patches/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff'
141--- debian/patches/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff 1970-01-01 00:00:00 +0000
142+++ debian/patches/lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff 2014-01-16 22:58:26 +0000
143@@ -0,0 +1,43 @@
144+Description: Fix kernel panic in init caused by incorrect shell constructs in upstart jobs
145+Author: TJ <ubuntu@iam.tj>
146+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+bug/1269731
147+Last-Update: 2014-01-16
148+Index: alsa-utils/debian/alsa-restore.upstart
149+===================================================================
150+--- alsa-utils.orig/debian/alsa-restore.upstart 2014-01-16 22:16:29.926882000 +0000
151++++ alsa-utils/debian/alsa-restore.upstart 2014-01-16 22:31:40.592706849 +0000
152+@@ -10,7 +10,7 @@
153+ task
154+
155+ pre-start script
156+- if test -f /var/lib/alsa/state-daemon.conf ; then
157++ if [ -f /var/lib/alsa/state-daemon.conf ]; then
158+ stop; exit 0
159+ fi
160+ end script
161+Index: alsa-utils/debian/alsa-state.upstart
162+===================================================================
163+--- alsa-utils.orig/debian/alsa-state.upstart 2014-01-16 22:16:29.926882000 +0000
164++++ alsa-utils/debian/alsa-state.upstart 2014-01-16 22:32:25.080927426 +0000
165+@@ -10,7 +10,7 @@
166+ expect fork
167+
168+ pre-start script
169+- if ! test -f /var/lib/alsa/state-daemon.conf ; then
170++ if [ ! -f /var/lib/alsa/state-daemon.conf ]; then
171+ stop; exit 0
172+ fi
173+ end script
174+Index: alsa-utils/debian/alsa-store.upstart
175+===================================================================
176+--- alsa-utils.orig/debian/alsa-store.upstart 2014-01-16 22:16:29.926882000 +0000
177++++ alsa-utils/debian/alsa-store.upstart 2014-01-16 22:31:59.216799043 +0000
178+@@ -10,7 +10,7 @@
179+ task
180+
181+ pre-start script
182+- if test -f /var/lib/alsa/state-daemon.conf ; then
183++ if [ -f /var/lib/alsa/state-daemon.conf ]; then
184+ stop; exit 0
185+ fi
186+ end script
187
188=== modified file 'debian/patches/series'
189--- debian/patches/series 2013-07-26 10:56:44 +0000
190+++ debian/patches/series 2014-01-16 22:58:26 +0000
191@@ -3,3 +3,4 @@
192 unset_pulse_internal.patch
193 add_extra_volume_defaults.patch
194 vmware_audio_volume.patch
195+lp1269731_incorrect_shell_constructions_cause_upstart_kernel_panic.diff

Subscribers

People subscribed via source and target branches

to all changes: