Commit 39fdac6
drm/xe/dma-buf: fix UAF with retry loop
commit 155a372a1cc50fa93387c5d3cdfd614a61e1afd1 upstream.
Retry doesn't work here, since bo will be freed on error, leading to
UAF. However, now that we do the alloc & init before the attach, we can
now combine this as one unit and have the init do the alloc for us. This
should make the retry safe.
Reported by Sashiko.
v2: Fix up the error unwind (CI)
Closes: https://sashiko.dev/#/patchset/20260506184332.86743-2-matthew.auld%40intel.com
Fixes: eb289a5 ("drm/xe: Convert xe_dma_buf.c for exhaustive eviction")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: <stable@vger.kernel.org> # v6.18+
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/20260508102635.149172-4-matthew.auld@intel.com
(cherry picked from commit 479669418253e0f27f8cf5db01a731352ea592e7)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 20a99ea commit 39fdac6
1 file changed
Lines changed: 12 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 230 | | |
238 | | - | |
239 | | - | |
| 231 | + | |
240 | 232 | | |
241 | 233 | | |
242 | 234 | | |
| |||
247 | 239 | | |
248 | 240 | | |
249 | 241 | | |
250 | | - | |
251 | | - | |
| 242 | + | |
252 | 243 | | |
253 | | - | |
254 | 244 | | |
255 | 245 | | |
256 | 246 | | |
| |||
259 | 249 | | |
260 | 250 | | |
261 | 251 | | |
262 | | - | |
263 | | - | |
| 252 | + | |
264 | 253 | | |
265 | 254 | | |
266 | 255 | | |
| |||
311 | 300 | | |
312 | 301 | | |
313 | 302 | | |
314 | | - | |
315 | 303 | | |
316 | 304 | | |
317 | 305 | | |
| |||
326 | 314 | | |
327 | 315 | | |
328 | 316 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | 317 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
343 | 323 | | |
344 | | - | |
| 324 | + | |
345 | 325 | | |
346 | 326 | | |
347 | 327 | | |
| |||
351 | 331 | | |
352 | 332 | | |
353 | 333 | | |
354 | | - | |
| 334 | + | |
355 | 335 | | |
356 | | - | |
357 | | - | |
| 336 | + | |
| 337 | + | |
358 | 338 | | |
359 | 339 | | |
360 | 340 | | |
361 | 341 | | |
362 | 342 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | 343 | | |
369 | 344 | | |
370 | 345 | | |
| |||
0 commit comments