Commit 8c0bc7d
committed
drm/vmwgfx: Fix possible invalid drm gem put calls
jira VULN-8161
cve CVE-2023-5633
commit-author Zack Rusin <zackr@vmware.com>
commit f9e96bf
vmw_bo_unreference sets the input buffer to null on exit, resulting in
null ptr deref's on the subsequent drm gem put calls.
This went unnoticed because only very old userspace would be exercising
those paths but it wouldn't be hard to hit on old distros with brand
new kernels.
Introduce a new function that abstracts unrefing of user bo's to make
the code cleaner and more explicit.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reported-by: Ian Forbes <iforbes@vmware.com>
Fixes: 9ef8d83 ("drm/vmwgfx: Do not drop the reference to the handle too soon")
Cc: <stable@vger.kernel.org> # v6.4+
Reviewed-by: Maaz Mombasawala<mombasawalam@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230818041301.407636-1-zack@kde.org
(cherry picked from commit f9e96bf)
Signed-off-by: Sultan Alsawaf <sultan@ciq.com>1 parent ee76bdd commit 8c0bc7d
File tree
6 files changed
+16
-16
lines changed- drivers/gpu/drm/vmwgfx
6 files changed
+16
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | | - | |
| 515 | + | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | 518 | | |
520 | 519 | | |
521 | 520 | | |
| |||
555 | 554 | | |
556 | 555 | | |
557 | 556 | | |
558 | | - | |
559 | | - | |
| 557 | + | |
560 | 558 | | |
561 | 559 | | |
562 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1164 | 1164 | | |
1165 | 1165 | | |
1166 | 1166 | | |
1167 | | - | |
1168 | | - | |
| 1167 | + | |
1169 | 1168 | | |
1170 | 1169 | | |
1171 | 1170 | | |
| |||
1221 | 1220 | | |
1222 | 1221 | | |
1223 | 1222 | | |
1224 | | - | |
1225 | | - | |
| 1223 | + | |
1226 | 1224 | | |
1227 | 1225 | | |
1228 | 1226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1725 | 1725 | | |
1726 | 1726 | | |
1727 | 1727 | | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
| 1728 | + | |
| 1729 | + | |
1732 | 1730 | | |
1733 | 1731 | | |
1734 | 1732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
461 | | - | |
| 460 | + | |
462 | 461 | | |
463 | 462 | | |
464 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
813 | | - | |
| 812 | + | |
814 | 813 | | |
815 | 814 | | |
816 | 815 | | |
| |||
0 commit comments