From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 72732] New: Missing NULL check; radeon_drm_winsys.c Date: Sun, 15 Dec 2013 16:05:50 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1779791282==" Return-path: Received: from culpepper.freedesktop.org (unknown [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 4EED6FA4F6 for ; Sun, 15 Dec 2013 08:05:50 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1779791282== Content-Type: multipart/alternative; boundary="1387123550.a33bbf0.31677"; charset="us-ascii" --1387123550.a33bbf0.31677 Date: Sun, 15 Dec 2013 16:05:50 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=72732 Priority: medium Bug ID: 72732 Assignee: dri-devel@lists.freedesktop.org Summary: Missing NULL check; radeon_drm_winsys.c Severity: normal Classification: Unclassified OS: All Reporter: freedesktop@treblig.org Hardware: Other Status: NEW Version: unspecified Component: Drivers/DRI/R600 Product: Mesa I can sometime trigger a seg in do_winsys_init at radeon_drm_winsys.c on my HD4350 There seems to be a simple missing NULL check: 214 version = drmGetVersion(ws->fd); 215 if (version->version_major != 2 || 216 version->version_minor < 3) { All the other users of drmGetVersion do a NULL check, so I suggest adding: if (!version) { fprintf(stderr,"%s: drmGetVersion NULL - bad fd (%d)?\n", __FUNCTION__, ws->fd); return FALSE; } I believe this to be part of the reason for: https://bugzilla.redhat.com/show_bug.cgi?id=993463 why drmGetVersion is failing is a different matter (probably a bad fd at that point - but why?) , but at least the NULL check would stop the seg. Dave -- You are receiving this mail because: You are the assignee for the bug. --1387123550.a33bbf0.31677 Date: Sun, 15 Dec 2013 16:05:50 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
Priority medium
Bug ID 72732
Assignee dri-devel@lists.freedesktop.org
Summary Missing NULL check; radeon_drm_winsys.c
Severity normal
Classification Unclassified
OS All
Reporter freedesktop@treblig.org
Hardware Other
Status NEW
Version unspecified
Component Drivers/DRI/R600
Product Mesa

I can sometime trigger a seg in do_winsys_init at radeon_drm_winsys.c on my
HD4350

There seems to be a simple missing NULL check:


214    version = drmGetVersion(ws->fd);
215    if (version->version_major != 2 ||
216        version->version_minor < 3) {

All the other users of drmGetVersion do a NULL check, so I suggest adding:

    if (!version) {
      fprintf(stderr,"%s: drmGetVersion NULL - bad fd (%d)?\n", __FUNCTION__,
ws->fd);
      return FALSE;
    }

I believe this to be part of the reason for:
https://bugzilla.redhat.com/show_bug.cgi?id=993463


why drmGetVersion is failing is a different matter (probably a bad fd at that
point - but why?) , but at least the NULL check would stop the seg.

Dave


You are receiving this mail because:
  • You are the assignee for the bug.
--1387123550.a33bbf0.31677-- --===============1779791282== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1779791282==--