All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 66332] New: drmHandleEvent returns 0 on read() failure
@ 2013-06-28 16:31 bugzilla-daemon
  2019-09-24 17:08 ` [Bug 66332] " bugzilla-daemon
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla-daemon @ 2013-06-28 16:31 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=66332

          Priority: medium
            Bug ID: 66332
          Assignee: dri-devel@lists.freedesktop.org
           Summary: drmHandleEvent returns 0 on read() failure
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: mgold@qnx.com
          Hardware: All
            Status: NEW
           Version: XOrg CVS
         Component: libdrm
           Product: DRI

drmHandleEvent contains this code:
        len = read(fd, buffer, sizeof buffer);
        if (len == 0)
                return 0;
        if (len < sizeof *e)
                return -1;
In the (len < sizeof *e) check, len gets promoted to size_t (which is
unsigned); so when len is negative "return -1" won't be executed. Instead, the
function continues to the end and returns 0. (The documentation states
drmHandleEvent will return -1 if the read fails.)

If there's an error like EBADF, the caller won't detect it and might end up
busy-waiting. Rewriting the condition as (len < (int)(sizeof *e)) will fix
this.

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

[-- Attachment #1.2: Type: text/html, Size: 2474 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug 66332] drmHandleEvent returns 0 on read() failure
  2013-06-28 16:31 [Bug 66332] New: drmHandleEvent returns 0 on read() failure bugzilla-daemon
@ 2019-09-24 17:08 ` bugzilla-daemon
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla-daemon @ 2019-09-24 17:08 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 838 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=66332

GitLab Migration User <gitlab-migration@fdo.invalid> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |MOVED
             Status|NEW                         |RESOLVED

--- Comment #1 from GitLab Migration User <gitlab-migration@fdo.invalid> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance: https://gitlab.freedesktop.org/mesa/drm/issues/11.

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

[-- Attachment #1.2: Type: text/html, Size: 2413 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-24 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 16:31 [Bug 66332] New: drmHandleEvent returns 0 on read() failure bugzilla-daemon
2019-09-24 17:08 ` [Bug 66332] " bugzilla-daemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.