https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255865

            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: [email protected]
          Reporter: [email protected]

Created attachment 224929
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=224929&action=edit
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 bug.

If the later callee ocs_hw_command() failed, the freed ctx is freed again via 
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to