git: 7f83d23ecfce - releng/12.3 - aio_aqueue(): avoid ucred leak on failure path
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 09 Aug 2022 19:58:53 UTC
The branch releng/12.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7f83d23ecfce15cc83f51aa9d1c4f95c24448ab9 commit 7f83d23ecfce15cc83f51aa9d1c4f95c24448ab9 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-09-24 00:14:56 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-07-25 20:07:02 +0000 aio_aqueue(): avoid ucred leak on failure path Approved by: so Security: FreeBSD-SA-22:10.aio PR: 258698 Submitted by: sigsys@gmail.com (cherry picked from commit 45c2c7c484de7747014492b17ff89e323ee66496) (cherry picked from commit 76ed54dda74ffe8c7284cab10a4b30445a8db12f) --- sys/kern/vfs_aio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index d68301d3d342..ba46a5031410 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1616,7 +1616,7 @@ no_kqueue: else error = fo_aio_queue(fp, job); if (error) - goto aqueue_fail; + goto err4; AIO_LOCK(ki); job->jobflags &= ~KAIOCB_QUEUEING; @@ -1637,6 +1637,8 @@ no_kqueue: AIO_UNLOCK(ki); return (0); +err4: + crfree(job->cred); aqueue_fail: knlist_delete(&job->klist, curthread, 0); if (fp)