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/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255866 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=224930&action=edit 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)). 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 =domain->ocs before domain can be free, to avoid the uaf bug. -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255866-227>
