From nobody Fri Dec 17 10:03:46 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 27B3618F76FF; Fri, 17 Dec 2021 10:03:47 +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 4JFl1Z4vqKz3t1f; Fri, 17 Dec 2021 10:03:46 +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 827B119B71; Fri, 17 Dec 2021 10:03:46 +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 1BHA3k2k051890; Fri, 17 Dec 2021 10:03:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHA3kp5051889; Fri, 17 Dec 2021 10:03:46 GMT (envelope-from git) Date: Fri, 17 Dec 2021 10:03:46 GMT Message-Id: <202112171003.1BHA3kp5051889@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: 241d13765504 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 241d1376550452d2da5eb80e9ee5d84ae567dd7b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639735426; 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=L7YNlMC0OfNCX2XsopamhcSmIjzcq2mB0Rle8phHLS8=; b=DtrSXpBgSV6EzzXgzT84nUbhGPfKil3IX+j8v3AW30/dEm3YwhVy/drXGEFQmZw2Dct0jG uqSKtg01DVbYGPsMlP5Nm7VGf/OpmYUX9vX+xnvEEVAWitD8TLgRk3XK19F4sFWTz6narA FICZJy0nD6NGLkJSdyRjr5/CfEbevGjL5Uk5CWBR5Mho6JTh7AhVQUOAobJ265WWKQpPop JZSUnsfNVNvc7d/xDrA1OBF4xYrKy0mPOzWtGo6wigqB343nTsv1nfX+sjG3Wn5U/C4AtQ Q3FbiWNQa9cnCZ3Yag7CBaWQJLemCktK0lNpFZjrIjW3dI1RbXpkHI5apE/78g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639735426; a=rsa-sha256; cv=none; b=SI9zxJ6Mjbk4MBQdyfXw9FtqMnNiTljHY7tUqZeUpfeFC2dVa6JQjoLCOqHYJTQaGd0LTR Ct7bB/I6zzzstnwLOK07nWlLsmrtUw+QkExAyCdIGm3/wdVqPboBuSKPf1UWTQqfRkyjtI +sU39r4lRXb9rCqfckvl70B/SzQ3Fm0FI6Jp9pE0xAj+Ti+JpFmAwjspV7CEQMOKGWDMCy 0w+fYDnuyuOlGIZKeVJHmjInoGmK2xW/gh9a6tvqqPVKzO+H2LaxfWFc8qjnLlGFGzpiq+ bDlzw4EFPX9+zfzcgZmzkN+iIvZXfnBVODs/b+AW3N94LhqkOoTDzaXACF6vvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=241d1376550452d2da5eb80e9ee5d84ae567dd7b commit 241d1376550452d2da5eb80e9ee5d84ae567dd7b Author: Ram Kishore Vegesna AuthorDate: 2021-05-28 05:26:13 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-12-17 09:45:59 +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 8031dc8f3692..6ca64adda089 100644 --- a/sys/dev/ocs_fc/ocs_sport.c +++ b/sys/dev/ocs_fc/ocs_sport.c @@ -264,7 +264,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)); } }