Commit 0068678
volume: bound init payload reads against its actual size
Init read the per-channel config[] array using the stream channel count
without checking the payload was large enough, reading past the mailbox.
The payload comes in two forms: an all-channels entry (channel_id set to
ALL_CHANNELS_MASK) that carries a single config applied to every channel,
or one config entry per channel. The per-channel loop always indexed
config[channel], so the common all-channels payload (one entry) was read
out of bounds for every channel beyond the first; the result was then
discarded, masking the over-read.
Require at least one entry before dereferencing config[0] to detect the
form, require one entry per channel only for the per-channel form, and
index config[] by the selected entry so no read goes past the payload.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>1 parent 10d5b62 commit 0068678
1 file changed
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
130 | 151 | | |
131 | 152 | | |
132 | 153 | | |
| |||
156 | 177 | | |
157 | 178 | | |
158 | 179 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 180 | + | |
163 | 181 | | |
164 | 182 | | |
165 | | - | |
| 183 | + | |
166 | 184 | | |
167 | 185 | | |
168 | | - | |
| 186 | + | |
169 | 187 | | |
170 | 188 | | |
171 | 189 | | |
| |||
0 commit comments