Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2021 16:11:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 252582] Linuxulator: epoll create drop user data
Message-ID:  <bug-252582-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252582

            Bug ID: 252582
           Summary: Linuxulator: epoll create drop user data
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: ankohuu@outlook.com

Created attachment 221464
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D221464&action=
=3Dedit
patch for epoll create

In function epoll_create_common calls epoll_fd_install when kern_kqueue
success,
I guess this is to initialize the proc emuldata space.
But when epoll has allocated a descriptor equal to EPOLL_DEF_SZ, the above
action will clear the user data of fd EPOLL_DEF_SZ.This should be an error.

static int
epoll_create_common(struct thread *td, int flags)
{
        int error;

        error =3D kern_kqueue(td, flags, NULL);
        if (error !=3D 0)
                return (error);

        epoll_fd_install(td, EPOLL_DEF_SZ, 0);

        return (0);
}

In my scenario, the function epoll_fd_install will cause the electron gpu
thread consumes a lot of cpu resources because the returned fd cannot be
processed correctly.
My patch is in the attachment.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-252582-227>