Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 May 2021 11:00:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 255866] [PATCH] dev/ocs_fc: Fix a use after free in ocs_sport_free
Message-ID:  <bug-255866-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255866

            Bug ID: 255866
           Summary: [PATCH] dev/ocs_fc: Fix a use after free in
                    ocs_sport_free
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: lylgood@foxmail.com

Created attachment 224930
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D224930&action=
=3Dedit
add a new variable ocs

Bug File: sys/dev/ocs_fc/ocs_sport.c

In function ocs_sport_free, domain could be freed via
ocs_domain_post_event(domain,..)->ocs_domain_free(domain)->ocs_free(ocs,
domain, sizeof(*domain)).=20

But the freed domain is still used by domain->ocs at line 266 via
ocs_free(domain->ocs, sport, sizeof(*sport)).

My patch adds a new variable ocs and sets ocs =3Ddomain->ocs before domain =
can be
free, to avoid the uaf bug.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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