[Bug 258698] aio(4): ucred leak in aio_aqueue()'s failure path

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 23 Sep 2021 22:44:30 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258698

            Bug ID: 258698
           Summary: aio(4): ucred leak in aio_aqueue()'s failure path
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: sigsys@gmail.com

diff --git c/sys/kern/vfs_aio.c i/sys/kern/vfs_aio.c
index ebe91ff0fdaf..a3a099873ff1 100644
--- c/sys/kern/vfs_aio.c
+++ i/sys/kern/vfs_aio.c
@@ -1714,7 +1714,7 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct
aioliojob *lj,
        else
                error = fo_aio_queue(fp, job);
        if (error)
-               goto err3;
+               goto err4;

        AIO_LOCK(ki);
        job->jobflags &= ~KAIOCB_QUEUEING;
@@ -1735,6 +1735,8 @@ aio_aqueue(struct thread *td, struct aiocb *ujob, struct
aioliojob *lj,
        AIO_UNLOCK(ki);
        return (0);

+err4:
+       crfree(job->cred);
 err3:
        if (fp)
                fdrop(fp, td);

-- 
You are receiving this mail because:
You are the assignee for the bug.