Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 May 2021 05:54:21 GMT
From:      Ram Kishore Vegesna <ram@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: dd722ccd6efc - main - ocs_fc: Fix a use after free in ocs_sport_free
Message-ID:  <202105280554.14S5sLQI016119@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by ram:

URL: https://cgit.FreeBSD.org/src/commit/?id=dd722ccd6efcaed5c6056e51a044db7f1a5b4a0d

commit dd722ccd6efcaed5c6056e51a044db7f1a5b4a0d
Author:     Ram Kishore Vegesna <ram@FreeBSD.org>
AuthorDate: 2021-05-28 05:26:13 +0000
Commit:     Ram Kishore Vegesna <ram@FreeBSD.org>
CommitDate: 2021-05-28 05:26:13 +0000

    ocs_fc: Fix a use after free in ocs_sport_free
    
    Domain which could be freed is used while freeing the sport.
    Use ocs from sport.
    
    PR: 255866
    Reported by: lylgood@foxmail.com
    Approved by:: markj
---
 sys/dev/ocs_fc/ocs_sport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/ocs_fc/ocs_sport.c b/sys/dev/ocs_fc/ocs_sport.c
index 71fe350311f7..7df31b1448f1 100644
--- a/sys/dev/ocs_fc/ocs_sport.c
+++ b/sys/dev/ocs_fc/ocs_sport.c
@@ -263,7 +263,7 @@ ocs_sport_free(ocs_sport_t *sport)
 		ocs_lock_free(&sport->node_group_lock);
 		ocs_scsi_sport_deleted(sport);
 
-		ocs_free(domain->ocs, sport, sizeof(*sport));
+		ocs_free(sport->ocs, sport, sizeof(*sport));
 		
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105280554.14S5sLQI016119>