Commit 6834acd
committed
tee: amdtee: fix race condition in amdtee_open_session
jira VULN-66919
cve CVE-2023-53047
commit-author Rijo Thomas <[email protected]>
commit f8502fb
There is a potential race condition in amdtee_open_session that may
lead to use-after-free. For instance, in amdtee_open_session() after
sess->sess_mask is set, and before setting:
sess->session_info[i] = session_info;
if amdtee_close_session() closes this same session, then 'sess' data
structure will be released, causing kernel panic when 'sess' is
accessed within amdtee_open_session().
The solution is to set the bit sess->sess_mask as the last step in
amdtee_open_session().
Fixes: 757cc3e ("tee: add AMD-TEE driver")
Cc: [email protected]
Signed-off-by: Rijo Thomas <[email protected]>
Acked-by: Sumit Garg <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
(cherry picked from commit f8502fb)
Signed-off-by: Brett Mastbergen <[email protected]>1 parent dccd772 commit 6834acd
1 file changed
+14
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
271 | 280 | | |
272 | 281 | | |
273 | 282 | | |
274 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
275 | 286 | | |
| 287 | + | |
276 | 288 | | |
277 | 289 | | |
278 | 290 | | |
279 | 291 | | |
| 292 | + | |
280 | 293 | | |
281 | 294 | | |
282 | 295 | | |
283 | 296 | | |
284 | 297 | | |
285 | 298 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
| |||
0 commit comments