Date: Tue, 6 Apr 2021 19:19:51 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 49f3ea024bc1 - releng/12.2 - accept_filter: Fix filter parameter handling Message-ID: <202104061919.136JJpRs097817@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch releng/12.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=49f3ea024bc1a12c82d3729254221d5a0242794d commit 49f3ea024bc1a12c82d3729254221d5a0242794d Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-03-25 21:55:20 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-04-06 18:59:00 +0000 accept_filter: Fix filter parameter handling For filters which implement accf_create, the setsockopt(2) handler caches the filter name in the socket, but it also incorrectly frees the buffer containing the copy, leaving a dangling pointer. Note that no accept filters provided in the base system are susceptible to this, as they don't implement accf_create. Reported by: Alexey Kulaev <alex.qart@gmail.com> Discussed with: emaste Sponsored by: The FreeBSD Foundation Approved by: so Security: CVE-2021-29627 Security: FreeBSD-SA-21:09.accept_filter (cherry picked from commit 653a437c04440495cd8e7712c7cf39444f26f1ee) (cherry picked from commit 6008a5fad3c110c4ec03cc3fe60ce41c4e548b98) --- sys/kern/uipc_accf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/uipc_accf.c b/sys/kern/uipc_accf.c index 9aab541883d6..98cefe0789a8 100644 --- a/sys/kern/uipc_accf.c +++ b/sys/kern/uipc_accf.c @@ -298,6 +298,7 @@ accept_filt_setopt(struct socket *so, struct sockopt *sopt) so->sol_accept_filter = afp; so->sol_accept_filter_arg = accept_filter_arg; so->sol_accept_filter_str = accept_filter_str; + accept_filter_str = NULL; so->so_options |= SO_ACCEPTFILTER; out: SOCK_UNLOCK(so);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104061919.136JJpRs097817>