All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [Bug 16624] New: invalid pointer past to RRChangeOutputProperty
Date: Sat,  5 Jul 2008 22:43:23 -0700 (PDT)	[thread overview]
Message-ID: <bug-16624-8800@http.bugs.freedesktop.org/> (raw)

http://bugs.freedesktop.org/show_bug.cgi?id=16624

           Summary: invalid pointer past to RRChangeOutputProperty
           Product: xorg
           Version: git
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Driver/nouveau
        AssignedTo: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
        ReportedBy: obiwan-ajv+KCCKUOlAfugRpC6u6w@public.gmane.org
         QAContact: xorg-team-go0+a7rfsptAfugRpC6u6w@public.gmane.org
                CC: keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org


Created an attachment (id=17547)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=17547)
proposed patch for the issue

In nv_output:

error = RRChangeOutputProperty(output->randr_output, dithering_atom,
                                        XA_INTEGER, 32, PropModeReplace, 1,
&nv_output->dithering,FALSE, FALSE);

&nv_output->dithering is a Boolean, but the property is set up as int32. On big
endian systems, this results in the property set being 0x1000000 instead of
0x1. This currently fails the range check (it can only be 1 or 0). Leading to
an error returned above which made me notice the issue.

Actually I think it may be an idea if X would check the type of the pointer
passed to RRChangeOutputProperty and return a better error if it is not equal
to the type (this problem would go unnoticed without the range check in
nv_output's set_property function), thus I add a cc to keithp about that.

To fix the problem in nouveau, either the property should be set up as Bool, or
we need to do an explicit cast. I provide a patch for the latter (because I am
not sure if we want more than 2 states for this property in the future). Let me
know if the former is preferred.


Cheers,

danny


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

             reply	other threads:[~2008-07-06  5:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06  5:43 bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ [this message]
     [not found] ` <bug-16624-8800-V0hAGp6uBxMKqLRl/0Ahz6D7qz1kEfGD2LY78lusg7I@public.gmane.org/>
2008-07-09 10:23   ` [Bug 16624] invalid pointer passed to RRChangeOutputProperty bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2008-07-31  5:56   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ
2008-07-31  5:56   ` bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-16624-8800@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon-cc+yj3umiyqdupfqwhejaq@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.