]> Git Repo - qemu.git/commitdiff
scsi/lsi53c895a: fix use-after-free in lsi_do_msgout (CVE-2022-0216)
authorMauro Matteo Cascella <[email protected]>
Tue, 5 Jul 2022 20:05:43 +0000 (22:05 +0200)
committerPaolo Bonzini <[email protected]>
Wed, 6 Jul 2022 07:31:15 +0000 (09:31 +0200)
Set current_req->req to NULL to prevent reusing a free'd buffer in case of
repeated SCSI cancel requests. Thanks to Thomas Huth for suggesting the patch.

Fixes: CVE-2022-0216
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972
Signed-off-by: Mauro Matteo Cascella <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-Id: <20220705200543.2366809[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
hw/scsi/lsi53c895a.c

index c8773f73f75610add97008c67523165428a7bb36..99ea42d49b08c301406db810ffef74e5a34dace2 100644 (file)
@@ -1028,8 +1028,9 @@ static void lsi_do_msgout(LSIState *s)
         case 0x0d:
             /* The ABORT TAG message clears the current I/O process only. */
             trace_lsi_do_msgout_abort(current_tag);
-            if (current_req) {
+            if (current_req && current_req->req) {
                 scsi_req_cancel(current_req->req);
+                current_req->req = NULL;
             }
             lsi_disconnect(s);
             break;
This page took 0.030111 seconds and 4 git commands to generate.