Commit 54c0a77
ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
[upstream commit 56b88b5]
Takes rwsem lock inside snd_ctl_elem_read instead of snd_ctl_elem_read_user
like it was done for write in commit 1fa4445 ("ALSA: control - introduce
snd_ctl_notify_one() helper"). Doing this way we are also fixing the following
locking issue happening in the compat path which can be easily triggered and
turned into an use-after-free.
64-bits:
snd_ctl_ioctl
snd_ctl_elem_read_user
[takes controls_rwsem]
snd_ctl_elem_read [lock properly held, all good]
[drops controls_rwsem]
32-bits:
snd_ctl_ioctl_compat
snd_ctl_elem_write_read_compat
ctl_elem_write_read
snd_ctl_elem_read [missing lock, not good]
CVE-2023-0266 was assigned for this issue.
Cc: stable@kernel.org # 5.13+
Signed-off-by: Clement Lecigne <clecigne@google.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230113120745.25464-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>1 parent c8628ae commit 54c0a77
1 file changed
+15
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
| 1206 | + | |
1206 | 1207 | | |
1207 | | - | |
1208 | | - | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
1209 | 1212 | | |
1210 | 1213 | | |
1211 | 1214 | | |
1212 | | - | |
1213 | | - | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1214 | 1219 | | |
1215 | 1220 | | |
1216 | 1221 | | |
| |||
1220 | 1225 | | |
1221 | 1226 | | |
1222 | 1227 | | |
1223 | | - | |
| 1228 | + | |
1224 | 1229 | | |
1225 | 1230 | | |
1226 | 1231 | | |
| |||
1230 | 1235 | | |
1231 | 1236 | | |
1232 | 1237 | | |
1233 | | - | |
| 1238 | + | |
1234 | 1239 | | |
1235 | 1240 | | |
1236 | 1241 | | |
1237 | 1242 | | |
1238 | 1243 | | |
1239 | 1244 | | |
1240 | 1245 | | |
1241 | | - | |
| 1246 | + | |
| 1247 | + | |
1242 | 1248 | | |
| 1249 | + | |
| 1250 | + | |
1243 | 1251 | | |
1244 | 1252 | | |
1245 | 1253 | | |
| |||
1253 | 1261 | | |
1254 | 1262 | | |
1255 | 1263 | | |
1256 | | - | |
1257 | 1264 | | |
1258 | | - | |
1259 | 1265 | | |
1260 | 1266 | | |
1261 | 1267 | | |
| |||
0 commit comments