Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 May 2021 10:47:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 255865] [PATCH] dev/ocs_fc: Fix uaf & double free bugs in ocs_hw_async_call
Message-ID:  <bug-255865-227@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 255865
           Summary: [PATCH] dev/ocs_fc: Fix uaf & double free bugs in
                    ocs_hw_async_call
           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 224929
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D224929&action=
=3Dedit
returns error message if sli_cmd_common_nop() failed

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

In function ocs_hw_async_call, if sli_cmd_common_nop() failed, ctx will be
freed via ocs_free() at line 11,800. But the freed ctx is used in the later
callee ocs_hw_command(.., ctx->cmd, ..., ctx), which is a use after free bu=
g.

If the later callee ocs_hw_command() failed, the freed ctx is freed again v=
ia=20
ocs_free() at line 11,806, which is a double free bug.

My patch returns the error message if sli_cmd_common_nop() failed, to avoid=
 the
later uaf and double free bugs.

--=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-255865-227>