From nobody Fri Dec 17 10:37:06 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 898D218FF1A6; Fri, 17 Dec 2021 10:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JFlm30y3Pz4W1R; Fri, 17 Dec 2021 10:37:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E94481A25C; Fri, 17 Dec 2021 10:37:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BHAb662092394; Fri, 17 Dec 2021 10:37:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHAb6Rj092393; Fri, 17 Dec 2021 10:37:06 GMT (envelope-from git) Date: Fri, 17 Dec 2021 10:37:06 GMT Message-Id: <202112171037.1BHAb6Rj092393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ram Kishore Vegesna Subject: git: f7a7748afc1c - stable/13 - ocs_fc: Fix a use after free in ocs_sport_free List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7a7748afc1ccec9c10a08ce86d882528a0410e3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639737427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IsTI3ZAZoE9YOlYDICglVyP3i2rX6AHT+pYS62w1Mts=; b=rNrHPQx9wfiuCg3+l9BsEaIg/epAvEPB6x1QCzwUXDFHBCmPBAm5knTduFLbq5yIXtF/uD 7L1iThbdTFp6f58jMPU3nvULTFh4ksZRRW4+99dH585nMUvq2ueAgnp6MWMRg60hs+0+gk ijrafs/f6glHWmuPaIC6k2zaWQugpi5wiBv0V39BW5nQTV3AQOHqZKPDSgZjyF7obibgYZ IqabZJ6qxBGeVwKbKcAbl9Rgn8MaM78GKeUaKGEuaX562EnQ9PxuKjdAaxnFT2ZJYFUnF9 NrOfAQujI7OLpY2RYOMQMDu16yO1aaiWspFcFHu6rnUutxd7d7LVPvcVy7hlnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639737427; a=rsa-sha256; cv=none; b=PS9Ej7gsCeRMziK5UnfjWSipnJDbdHJ9yNXL70qTTHfKhQwcBwU2OvM4ibDVjdJ4lsfCsb 992VIUgMEhTOWmvUauHrLnDpbW90kj/Awk6VSd+LAwFNi85TIypHfNaQubejlRyQZSnF9X 1eKSmSd0HdkWMMvYO21gRGXLBm2Uh4QCD9Zer7IuCYl74gcemCddhjU/f1DbDapefvB7FY VMAvOpUOqaw4iX9J18Bhka9bFljXti2BAI2g4d/tOdnlqDv/i8nWnTuxH4D5iZ7Mexk6um pxf13x7VonAvgF2agbarXfZwAbugZVSQSRapNYURAuEDKqR80wwNyJqMVeeKYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=f7a7748afc1ccec9c10a08ce86d882528a0410e3 commit f7a7748afc1ccec9c10a08ce86d882528a0410e3 Author: Ram Kishore Vegesna AuthorDate: 2021-05-28 05:26:13 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-12-17 10:12:09 +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 (cherry picked from commit dd722ccd6efcaed5c6056e51a044db7f1a5b4a0d) --- 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)); } }